@SuppressWarnings("unchecked") public ConsultantProcedureCategoryVoCollection listConsultantsProcedureCategory(HcpLiteVo hcp) throws DomainInterfaceException { StringBuilder query = new StringBuilder("select c1_1 from ConsultantProcedureCategory as c1_1 " + "left join c1_1.performingHCP as h1_1 left join h1_1.mos as m1_1"); ArrayList<String> paramNames = new ArrayList<String>(); ArrayList<Object> paramValues = new ArrayList<Object>(); if (hcp != null) { query.append(" where (c1_1.performingHCP.id = :Hcp_id)"); paramNames.add("Hcp_id"); paramValues.add(hcp.getID_Hcp()); } query.append(" order by m1_1.name.surname asc "); List domObjs = getDomainFactory().find(query.toString(),paramNames,paramValues); if (domObjs == null || domObjs.size()==0) return null; return ConsultantProcedureCategoryVoAssembler.createConsultantProcedureCategoryVoCollectionFromConsultantProcedureCategory(domObjs); }
public ims.admin.vo.ConsultantProcedureCategoryVo save(ims.admin.vo.ConsultantProcedureCategoryVo record) throws ims.domain.exceptions.DomainInterfaceException, ims.domain.exceptions.StaleObjectException, ims.domain.exceptions.UniqueKeyViolationException { if (record == null) throw new DomainInterfaceException("The record you want to save is null"); if (!record.isValidated()) throw new DomainInterfaceException("The record you want to save is not validated"); ConsultantProcedureCategory domObj = ConsultantProcedureCategoryVoAssembler.extractConsultantProcedureCategory(getDomainFactory(), record); getDomainFactory().save(domObj); return ConsultantProcedureCategoryVoAssembler.create(domObj); }
public void deleteConfiguredConsultant(ConsultantProcedureCategoryVo confdConsultant) throws DomainInterfaceException, StaleObjectException, ForeignKeyViolationException { if (!confdConsultant.getID_ConsultantProcedureCategoryIsNotNull()) { throw new DomainInterfaceException("New record recived for deletion "); } ConsultantProcedureCategory obj = ConsultantProcedureCategoryVoAssembler.extractConsultantProcedureCategory(getDomainFactory(),confdConsultant); getDomainFactory().delete(obj); }
public ConsultantProcedureCategoryVo getConsultantProcedureCategoryByHcp(HcpLiteVo hcp) throws DomainInterfaceException { if(hcp == null) throw new CodingRuntimeException("hcp is null"); DomainFactory factory = getDomainFactory(); List conProcCateList = factory.find("from ConsultantProcedureCategory cpc where cpc.performingHCP.id = :idHcp)", new String[]{"idHcp"}, new Object[]{hcp.getID_Hcp()}); ConsultantProcedureCategoryVoCollection coll = ConsultantProcedureCategoryVoAssembler.createConsultantProcedureCategoryVoCollectionFromConsultantProcedureCategory(conProcCateList); if(coll.size()!= 0) return coll.get(0); else return null; }