public HCGTestItemVo getHCGItem(HCGTestItemRefVo hcgItemRef) { if (hcgItemRef == null || hcgItemRef.getID_HCGTestItem() == null) { throw new CodingRuntimeException("Cannot get HCGItem on null Id "); } DomainFactory factory = getDomainFactory(); HCGTestItem domainHCGItem = (HCGTestItem) factory.getDomainObject(HCGTestItem.class, hcgItemRef.getID_HCGTestItem()); return HCGTestItemVoAssembler.create(domainHCGItem); }
public Boolean isStale(HCGTestItemRefVo hcgItemRef) { if(hcgItemRef == null) return false; DomainFactory factory = getDomainFactory(); List<?> appts = factory.find("select hcgItem.id from HCGTestItem as hcgItem where hcgItem.id = :hcgItemId and hcgItem.version > :hcgItemVersion", new String[] {"hcgItemId", "hcgItemVersion"}, new Object[] {hcgItemRef.getID_HCGTestItem(), hcgItemRef.getVersion_HCGTestItem()}); if(appts != null && appts.size() > 0) return true; return false; }