private void open() { clear(); LocationLiteVoCollection locColl = domain.getLocations(); DefaultEDLocationDeptTypeVoCollection defedlocColl = domain.getDefaultEDLocationDeptTypes(); EmergencyDeptTypeCollection lkpEmergencyDeptTypeCollection = getDefaultDeptType(); if( locColl != null && locColl.size() > 0 ) { for( LocationLiteVo locVo : locColl) { if( locVo != null ) { addRow(locVo,defedlocColl,lkpEmergencyDeptTypeCollection); } } } form.setMode(FormMode.VIEW); }
private DefaultEDLocationDeptTypeVo getSavedefaultEDLocationDeptTypeVoForLocation(LocationLiteVo locVo, DefaultEDLocationDeptTypeVoCollection defedlocColl) { if( locVo == null) return null; if( defedlocColl == null || defedlocColl.size() == 0 ) return null; for( DefaultEDLocationDeptTypeVo defualtVo : defedlocColl ) { if( defualtVo != null ) { if( locVo.getID_LocationIsNotNull() && defualtVo.getLocationIsNotNull() && defualtVo.getLocation().getID_LocationIsNotNull() && locVo.getID_Location().equals(defualtVo.getLocation().getID_Location())) return defualtVo; } } return null; }
private boolean save() { String[] uiErrors = getUiErrors(); if (uiErrors != null && uiErrors.length > 0) { engine.showErrors(uiErrors); return false; } DefaultEDLocationDeptTypeVoCollection recordsColl = populateDataFromScreen(); try { domain.saveDefaultEDLocationDeptType(recordsColl); } catch (StaleObjectException e) { engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); } return true; }
public void saveDefaultEDLocationDeptType(DefaultEDLocationDeptTypeVoCollection records) throws StaleObjectException { if (records == null) throw new CodingRuntimeException("Cannot save null DefaultEDLocationDeptTypeVoCollection"); DomainFactory factory = getDomainFactory(); for( DefaultEDLocationDeptTypeVo record: records) { //wdev-19431 if( record != null && !record.getID_DefaultEDLocationDeptTypeIsNotNull() && record.getLocationIsNotNull()) { StringBuffer hql = new StringBuffer(); hql.append("select d1_1 from DefaultEDLocationDeptType as d1_1 left join d1_1.location as l1_1 where (l1_1.id = :loc and (d1_1.isRIE = null or d1_1.isRIE = 0))"); java.util.List list = getDomainFactory().find(hql.toString(), "loc",record.getLocation().getID_Location()); if (list != null && list.size() > 0) throw new StaleObjectException(null); } //----------- DefaultEDLocationDeptType doDefaultEDLocationDeptType = DefaultEDLocationDeptTypeVoAssembler.extractDefaultEDLocationDeptType(factory, record); factory.save(doDefaultEDLocationDeptType); } }
public void saveDefaultEDLocationDeptType(DefaultEDLocationDeptTypeVoCollection records) throws StaleObjectException { if (records == null) throw new CodingRuntimeException("Cannot save null DefaultEDLocationDeptTypeVoCollection"); DomainFactory factory = getDomainFactory(); for( DefaultEDLocationDeptTypeVo record: records) { DefaultEDLocationDeptType doDefaultEDLocationDeptType = DefaultEDLocationDeptTypeVoAssembler.extractDefaultEDLocationDeptType(factory, record); factory.save(doDefaultEDLocationDeptType); } }
public ims.emergency.vo.DefaultEDLocationDeptTypeVoCollection getDefaultEDLocationDeptTypes() { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(); hql.append("select d1_1 from DefaultEDLocationDeptType as d1_1 order by d1_1.systemInformation.creationDateTime desc"); List<?> list = factory.find(hql.toString()); if ( list != null && list.size() > 0) { DefaultEDLocationDeptTypeVoCollection tempColl = DefaultEDLocationDeptTypeVoAssembler.createDefaultEDLocationDeptTypeVoCollectionFromDefaultEDLocationDeptType(list); return tempColl; } return null; }