public TrackingAreaLiteVo getRegistrationAreaByLocation(LocationRefVo locationRef) { if(locationRef == null) throw new CodingRuntimeException("Can not get TrackingArea value on null locationID."); StringBuffer hql = new StringBuffer(); hql.append("select trackArea from TrackingArea as trackArea "); hql.append("where trackArea.eDLocation.id = :locationID and trackArea.isRegistrationArea = 1"); DomainFactory factory = getDomainFactory(); List<?> list = factory.find(hql.toString(), new String[] {"locationID"}, new Object[] {locationRef.getID_Location()}); if (list!=null && list.size()>0) { return TrackingAreaLiteVoAssembler.create((TrackingArea)list.get(0)); } return null; }
public TrackingAreaLiteVoCollection getAreasByLocation(LocationRefVo locationRef) { if( locationRef == null ) return null; DomainFactory factory = getDomainFactory(); List <?> trackingAreas = null; String hsql = "select t1_1 from TrackingArea as t1_1 left join t1_1.eDLocation as l1_1 where l1_1.id = :idLocation "; trackingAreas = factory.find(hsql, new String[] {"idLocation"}, new Object[] {locationRef.getID_Location()}); return TrackingAreaLiteVoAssembler.createTrackingAreaLiteVoCollectionFromTrackingArea(trackingAreas); }
public TrackingAreaLiteVo getTrackingAreaLite(TrackingAreaRefVo trackingAreaRef) { if(trackingAreaRef == null) throw new CodingRuntimeException("Cannot get TrackingArea on null Id."); return TrackingAreaLiteVoAssembler.create((TrackingArea) getDomainFactory().getDomainObject(TrackingArea.class, trackingAreaRef.getID_TrackingArea())); }