public TreatmentInterventionForAdviceLeafletVo getTreatmentIntervention(TaxonomyType taxonomyType, String taxonomyCode) { if( taxonomyType == null && taxonomyCode == null) throw new CodingRuntimeException("TaxonomyType and taxonomyCode are null."); DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(); hql.append("select t1_1 from TreatmentIntervention as t1_1 left join t1_1.taxonomyMap as t2_1 left join t2_1.taxonomyName as l1_1 where (t2_1.taxonomyCode = :taxonomyCode and l1_1.id = :taxonomyType and t1_1.isActive = 1)"); List<?> list = factory.find(hql.toString(), new String[] {"taxonomyCode","taxonomyType"}, new Object[] {taxonomyCode,taxonomyType.getID()}); if( list != null && list.size() > 0 ) return TreatmentInterventionForAdviceLeafletVoAssembler.createTreatmentInterventionForAdviceLeafletVoCollectionFromTreatmentIntervention(list).get(0); return null; }