public PrivateInsuranceCompanyVo getPrivateInsuranceCompany(String extId,TaxonomyType taxonomyType) { if (extId == null || taxonomyType == null) return null; DomainFactory factory = getDomainFactory(); String hql = " from PrivateInsuranceCompany company " + " join company.codeMappings as cm" + " where cm.taxonomyName = :taxType " + " and cm.taxonomyCode = :extId "; List<?> companyList = factory.find(hql,new String[]{"taxType", "extId"}, new Object[]{getDomLookup(taxonomyType),extId}); if (companyList != null && companyList.size() > 0) { PrivateInsuranceCompany company = (PrivateInsuranceCompany)companyList.get(0); return PrivateInsuranceCompanyVoAssembler.create(company); } return null; }
/** * Retrieves a PrivateInsuranceCompanyVo */ public ims.core.vo.PrivateInsuranceCompanyVoCollection listPrivateInsuranceCompanyVo(Boolean active) { ArrayList names = new ArrayList(); ArrayList values = new ArrayList(); DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer("from PrivateInsuranceCompany pic "); if (active.equals(Boolean.TRUE)) { hql.append (" where pic.isActive = :isActive"); names.add("isActive"); values.add(Boolean.TRUE); } hql.append(" order by pic.upperName asc"); //WDEV-20219 upper(pic.name) List list = factory.find(hql.toString(), names,values); return(PrivateInsuranceCompanyVoAssembler.createPrivateInsuranceCompanyVoCollectionFromPrivateInsuranceCompany(list)); }
/** * Saves a PrivateInsuranceCompanyVo */ public ims.core.vo.PrivateInsuranceCompanyVo savePrivateInsuranceCompanyVo(ims.core.vo.PrivateInsuranceCompanyVo privateInsuranceCompanyVo) throws ims.domain.exceptions.StaleObjectException { // Check for value to save if (privateInsuranceCompanyVo == null) throw new DomainRuntimeException("Domain Error - Can not save a null privateInsuranceCompanyVo record"); // Check for validated record if (!privateInsuranceCompanyVo.isValidated()) throw new DomainRuntimeException("Domain Error - privateInsuranceCompanyVo record must be validated before save"); DomainFactory factory = getDomainFactory(); PrivateInsuranceCompany privateInsuranceCompany = PrivateInsuranceCompanyVoAssembler.extractPrivateInsuranceCompany(factory, privateInsuranceCompanyVo); privateInsuranceCompany.getCodeMappings().clear(); List mappings = TaxonomyMapAssembler.extractTaxonomyMapList(factory, privateInsuranceCompanyVo.getCodeMappings()); privateInsuranceCompany.setCodeMappings(mappings); factory.save(privateInsuranceCompany); privateInsuranceCompanyVo = PrivateInsuranceCompanyVoAssembler.create(privateInsuranceCompany); return privateInsuranceCompanyVo; }
public ims.core.vo.PrivateInsuranceCompanyVoCollection listPrivateInsuranceCompanyVo() { DomainFactory factory = getDomainFactory(); String query = "select p1_1 from PrivateInsuranceCompany as p1_1 where (p1_1.isActive = 1) order by p1_1.upperName asc "; List<?> privateInsuranceComp = factory.find(query); if( privateInsuranceComp != null && privateInsuranceComp.size() > 0) { return PrivateInsuranceCompanyVoAssembler.createPrivateInsuranceCompanyVoCollectionFromPrivateInsuranceCompany(privateInsuranceComp); } return null; }
@Override public PrivateInsuranceCompanyVoCollection listPrivateInsuranceCompanyVo() { DomainFactory factory = getDomainFactory(); String query = "select p1_1 from PrivateInsuranceCompany as p1_1 where (p1_1.isActive = 1) order by p1_1.upperName asc "; List<?> privateInsuranceComp = factory.find(query); if( privateInsuranceComp != null && privateInsuranceComp.size() > 0) { return PrivateInsuranceCompanyVoAssembler.createPrivateInsuranceCompanyVoCollectionFromPrivateInsuranceCompany(privateInsuranceComp); } return null; }
/** * getPrivateInsuranceCompanyVo */ public ims.core.vo.PrivateInsuranceCompanyVo getPrivateInsuranceCompanyVo(ims.core.configuration.vo.PrivateInsuranceCompanyRefVo privateInsuranceCompanyRefVo) { if (privateInsuranceCompanyRefVo == null || !privateInsuranceCompanyRefVo.getID_PrivateInsuranceCompanyIsNotNull()) return null; PrivateInsuranceCompany pim = (PrivateInsuranceCompany) getDomainFactory().getDomainObject(PrivateInsuranceCompany.class, privateInsuranceCompanyRefVo.getID_PrivateInsuranceCompany()); return PrivateInsuranceCompanyVoAssembler.create(pim); }
public PrivateInsuranceCompanyVoCollection listCompanies() { ArrayList names = new ArrayList(); ArrayList values = new ArrayList(); DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer("from PrivateInsuranceCompany pic "); hql.append (" where pic.isActive = :isActive"); names.add("isActive"); values.add(Boolean.TRUE); List list = factory.find(hql.toString(), names,values); return(PrivateInsuranceCompanyVoAssembler.createPrivateInsuranceCompanyVoCollectionFromPrivateInsuranceCompany(list).sort()); }
public PrivateInsuranceCompanyVoCollection listPrivateInsuranceCompanyVo() { DomainFactory factory = getDomainFactory(); String query = "select p1_1 from PrivateInsuranceCompany as p1_1 where (p1_1.isActive = 1) order by p1_1.upperName asc "; List<?> privateInsuranceComp = factory.find(query); if( privateInsuranceComp != null && privateInsuranceComp.size() > 0) { return PrivateInsuranceCompanyVoAssembler.createPrivateInsuranceCompanyVoCollectionFromPrivateInsuranceCompany(privateInsuranceComp); } return null; }