public DrugToxicologyItemVo getDrugToxicologyItem(DrugToxicologyItemRefVo drugToxicologyItemRef) { if (drugToxicologyItemRef == null || drugToxicologyItemRef.getID_DrugToxicologyItem() == null) { throw new CodingRuntimeException("Cannot get DrugToxicologyItem on null Id "); } DomainFactory factory = getDomainFactory(); DrugToxicologyItem domainDrugToxicologyItem = (DrugToxicologyItem) factory.getDomainObject(DrugToxicologyItem.class, drugToxicologyItemRef.getID_DrugToxicologyItem()); return DrugToxicologyItemVoAssembler.create(domainDrugToxicologyItem); }
public Boolean isStale(DrugToxicologyItemRefVo drugToxicologyRef) { if(drugToxicologyRef == null) return false; DomainFactory factory = getDomainFactory(); List<?> appts = factory.find("select drugToxItem.id from DrugToxicologyItem as drugToxItem where drugToxItem.id = :drugToxItemId and drugToxItem.version > :drugToxItemVersion", new String[] {"drugToxItemId", "drugToxItemVersion"}, new Object[] {drugToxicologyRef.getID_DrugToxicologyItem(), drugToxicologyRef.getVersion_DrugToxicologyItem()}); if(appts != null && appts.size() > 0) return true; return false; }