/** * There will only be one secs record */ public SECSVo getSecs() //wdev-13392 { List secs = getDomainFactory().find("from SECS as s1_1 order by s1_1.systemInformation.creationDateTime desc "); SECSVoCollection secsVoColl = SECSVoAssembler.createSECSVoCollectionFromSECS(secs); //wdev-13392 if(secsVoColl != null && secsVoColl.size() > 0) return secsVoColl.get(0); return null; }
public SECSVo saveSECS(SECSVo voSecs) throws StaleObjectException,UniqueKeyViolationException { if(voSecs == null) throw new CodingRuntimeException("voSecs parameter is null in method saveSECS"); if(!voSecs.isValidated()) throw new CodingRuntimeException("voSecs has not been validated"); DomainFactory factory = getDomainFactory(); //wdev-13392 if(voSecs.getID_SECS() == null) { SECSVoCollection list = getSecsConfiguration(); if(list != null && list.size() > 0) { throw new UniqueKeyViolationException("A SECS Configuration already exists."); } } //--------------- SECS doSecs = SECSVoAssembler.extractSECS(factory, voSecs); factory.save(doSecs); return SECSVoAssembler.create(doSecs); }
public SECSVo getSecs() //wdev-13392 { List secs = getDomainFactory().find("from SECS as s1_1 order by s1_1.systemInformation.creationDateTime desc "); SECSVoCollection secsVoColl = SECSVoAssembler.createSECSVoCollectionFromSECS(secs); //wdev-13392 if(secsVoColl != null && secsVoColl.size() > 0) return secsVoColl.get(0); return null; }
public SECSVoCollection getSecsColection() { List secs = getDomainFactory().find("from SECS as s1_1 order by s1_1.systemInformation.creationDateTime desc "); SECSVoCollection secsVoColl = SECSVoAssembler.createSECSVoCollectionFromSECS(secs); return secsVoColl; }
private SECSVoCollection getSecsConfiguration() { DomainFactory factory = getDomainFactory(); String hql; hql = " from SECS "; SECSVoCollection collSystemReview = SECSVoAssembler.createSECSVoCollectionFromSECS(factory.find(hql)); return collSystemReview; }