public NewResultOcsOrderVo getNewResultOcsOrderVo(OrderInvestigationRefVo resultId) { if(resultId == null || resultId.getID_OrderInvestigation() == null) throw new DomainRuntimeException("Invalid OrderInvestigation id"); if(resultId != null) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" select o2_1 from OrderInvestigation as o1_1 left join o1_1.orderDetails as o2_1 where "); String andStr = " "; ArrayList<String> markers = new ArrayList<String>(); ArrayList<Serializable> values = new ArrayList<Serializable>(); hql.append(andStr + " o1_1.id = :OrderInvId"); markers.add("OrderInvId"); values.add(resultId.getID_OrderInvestigation()); andStr = " and "; List<?> list = factory.find(hql.toString(), markers,values); if(list != null && list.size() > 0) { NewResultOcsOrderVoCollection voColl = NewResultOcsOrderVoAssembler.createNewResultOcsOrderVoCollectionFromOcsOrderSession(list);// WDEV-16232 if(voColl != null && voColl.size() > 0) return voColl.get(0); } } return null; }