public EmergencyDeptType getEDDeptType(LocationRefVo locationRef) { if(locationRef == null || locationRef.getID_Location() == null) return null; DomainFactory factory = getDomainFactory(); String query = "from DefaultEDLocationDeptType as defaultEdDeptType where defaultEdDeptType.location.id = :EmergencyLocation"; List<?> edDeptType = factory.find(query, new String[] {"EmergencyLocation"}, new Object[] {locationRef.getID_Location()}); if(edDeptType != null && edDeptType.size() > 0 && edDeptType.get(0)!=null) { return (DefaultEDLocationDeptTypeVoAssembler.create((DefaultEDLocationDeptType) edDeptType.get(0))).getDefaultDeptType(); } return null; }