public DoseFormIndicatorCollection getForms(MedicationRefVo medication) { if (!medication.getID_MedicationIsNotNull()) throw new DomainRuntimeException("Medication with null as id"); String hql = "select forms from Medication as med left join med.forms as forms where (med.id = :medId)"; List<?> dos = getDomainFactory().find(hql,"medId",medication.getID_Medication()); if (dos == null || dos.size() == 0) return null; MedicationFormLiteVoCollection meds = MedicationFormLiteVoAssembler.createMedicationFormLiteVoCollectionFromMedicationForm(dos); DoseFormIndicatorCollection result = new DoseFormIndicatorCollection(); for (int i = 0 ;i<meds.size() ; i++) { if (meds.get(i)!=null && meds.get(i).getFormIsNotNull()) result.add(meds.get(i).getForm()); } return result; }