public ims.emergency.vo.AttendanceKPIConfigVo getAttendanceKPIConfigVo(ims.core.resource.place.vo.LocationRefVo locRef) { if( locRef == null ) return null; DomainFactory factory = getDomainFactory(); String hsql = "select a1_1 from AttendanceKPIConfig as a1_1 left join a1_1.eDLocation as l1_1 where (l1_1.id = :idLocation)"; List locs = factory.find(hsql, new String[] {"idLocation"}, new Object[] {locRef.getID_Location()}); if(locs!= null && locs.size() > 0) { AttendanceKPIConfigVoCollection tempCol = AttendanceKPIConfigVoAssembler.createAttendanceKPIConfigVoCollectionFromAttendanceKPIConfig(locs); if( tempCol != null && tempCol.size() > 0) return tempCol.get(0); } return null; }
public ims.emergency.vo.AttendanceKPIConfigVo saveAttendanceKPIConfig(ims.emergency.vo.AttendanceKPIConfigVo record) throws ims.domain.exceptions.StaleObjectException, ims.domain.exceptions.UniqueKeyViolationException { if (record == null) throw new CodingRuntimeException("Cannot save null AttendanceKPIConfigVo"); DomainFactory factory = getDomainFactory(); AttendanceKPIConfig doAttendanceKPIConfig = AttendanceKPIConfigVoAssembler.extractAttendanceKPIConfig(factory, record); try { factory.save(doAttendanceKPIConfig); } catch(UnqViolationUncheckedException e) { throw new UniqueKeyViolationException(); } return AttendanceKPIConfigVoAssembler.create(doAttendanceKPIConfig); }
public AttendanceKPIConfigVo getAttendanceKPIConfig(ILocation edLocation) { if(edLocation == null) throw new CodingRuntimeException("Cannot get AttendanceKPIConfig for a null EDLocation Id."); DomainFactory factory = getDomainFactory(); String query = "select kpi from AttendanceKPIConfig as kpi left join kpi.eDLocation as loc where loc.id = :EDLoc"; List<?> list = factory.find(query, new String[] {"EDLoc"}, new Object[] {edLocation.getID()}); if(list == null || list.size() == 0) return null; return AttendanceKPIConfigVoAssembler.create((AttendanceKPIConfig) list.get(0)); }