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; }
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); } }