public RoomDetailsVoCollection getRoomDetails(EnvironmentalVisitRefVo recordRef) { if( recordRef == null) return null; String hql = new String("select r1_1 from EnvironmentalVisit as e1_1 left join e1_1.rooms as r1_1 where (e1_1.id = :VISITID) "); java.util.List list = getDomainFactory().find(hql, "VISITID", recordRef.getID_EnvironmentalVisit()); return RoomDetailsVoAssembler.createRoomDetailsVoCollectionFromRoomDetails(list); }
public RoomDetailsVoCollection listRooms(HomeVisitRefVo homeVisit) { if(homeVisit == null || homeVisit.getID_HomeVisit() == null) throw new CodingRuntimeException("Cannot get Rooms on null HomeVisit Id."); DomainFactory factory = getDomainFactory(); String query = "select r from HomeVisit as hv left join hv.rooms as r where hv.id = :HomeVisit"; List<?> list = factory.find(query, new String[] {"HomeVisit"}, new Object[] {homeVisit.getID_HomeVisit()}); return RoomDetailsVoAssembler.createRoomDetailsVoCollectionFromRoomDetails(list); }