public Opcs4Vo saveOpcs4Record(Opcs4Vo vo) throws DomainInterfaceException, StaleObjectException, UniqueKeyViolationException { if (!vo.isValidated()) { throw new DomainRuntimeException("Opcs4 Vo has not been validated."); } DomainFactory factory = getDomainFactory(); Opcs4 opcs4Bo = Opcs4VoAssembler.extractOpcs4(factory, vo); if (vo.getID_Opcs4IsNotNull()) { //update factory.update(opcs4Bo); } else { //insert factory.save(opcs4Bo); } return Opcs4VoAssembler.create(opcs4Bo); }
public Opcs4Vo getOPCS4(String code) { if(code == null) return null; DomainFactory factory = getDomainFactory(); String hqlList = "select opcs4 from Opcs4 opcs4 where opcs4.opcode = :Code"; List codesList = factory.find(hqlList, new String[] {"Code"}, new Object[] {code}); if(codesList == null || codesList.size() == 0) return null; return Opcs4VoAssembler.create((Opcs4) codesList.get(0)); }
public Opcs4Vo getOpcs4Code(String code) throws DomainInterfaceException { if(code == null || code.trim().length() == 0) return null; ims.admin.vo.Opcs4VoCollection coll = Opcs4VoAssembler.createOpcs4VoCollectionFromOpcs4(getDomainFactory().find("from Opcs4 opcs4 WHERE opcs4.opcode = '" + code + "'")); if (coll != null && coll.size()>0) return coll.get(0); return null; }