public HrgConfigLiteVo saveHRG(HrgConfigLiteVo hrg) throws DomainInterfaceException, StaleObjectException, UniqueKeyViolationException { if (!hrg.isValidated()) { throw new DomainRuntimeException("HRGConfigLiteVo has not been validated."); } DomainFactory factory = getDomainFactory(); HrgConfig hrgDo = HrgConfigLiteVoAssembler.extractHrgConfig(factory, hrg); if (hrg.getID_HrgConfigIsNotNull()) { //update factory.update(hrgDo); } else { //insert factory.save(hrgDo); } return HrgConfigLiteVoAssembler.create(hrgDo); }
/** * List all the HRG Configuration in the system */ public ims.core.vo.HrgConfigLiteVoCollection listHRGConfiguration() { // Build the query String query = "from HrgConfig as hrg"; DomainFactory factory = getDomainFactory(); return HrgConfigLiteVoAssembler.createHrgConfigLiteVoCollectionFromHrgConfig(factory.find(query)); }
public HrgConfigLiteVo getHRGCode(String code) { if(code == null || code.trim().length() == 0) return null; HrgConfigLiteVoCollection coll = HrgConfigLiteVoAssembler.createHrgConfigLiteVoCollectionFromHrgConfig(getDomainFactory().find("from HrgConfig hrg WHERE hrg.hRGCode = :HRGCode", new String[] {"HRGCode"}, new Object[] {code})); if (coll != null && coll.size()>0) return coll.get(0); return null; }
public HrgConfigLiteVo getHRG(String code) { if(code == null) return null; DomainFactory factory = getDomainFactory(); String hqlList = "select hrg from HrgConfig as hrg where hrg.hRGCode = :Code"; List codesList = factory.find(hqlList, new String[] {"Code"}, new Object[] {code}); if(codesList == null || codesList.size() == 0) return null; return HrgConfigLiteVoAssembler.create((HrgConfig) codesList.get(0)); }