public AppFormListVo getAppFormListByTaxonomyType(String extId, TaxonomyType taxonomyType) { if (extId == null || taxonomyType == null) return null; DomainFactory factory = (DomainFactory) this.getDomainFactory(); String hql = " from AppForm af join af.codeMappings as cm where cm.taxonomyName = :taxType and cm.taxonomyCode = :extId "; List appFormList = factory.find(hql,new String[]{"taxType", "extId"}, new Object[]{getDomLookup(taxonomyType),extId}); if (appFormList != null && appFormList.size() == 1) return AppFormListVoAssembler.create((AppForm) appFormList.get(0)); else if (appFormList != null && appFormList.size() > 1) throw new DomainRuntimeException("Non unique hit on AppForm by TaxonomyType " + taxonomyType.getText() + " and code " + extId); return null; }
public AppFormListVo getAppFormList(Integer id) { if(id == null) throw new CodingRuntimeException("AppForm id is null"); DomainFactory factory = (DomainFactory) getDomainFactory(); return AppFormListVoAssembler.create((AppForm)factory.getDomainObject(AppForm.class,id)); }
public AppFormListVo saveForm(AppFormListVo listFormVo) throws StaleObjectException { if (Boolean.FALSE.equals(listFormVo.isValidated())) throw new DomainRuntimeException("AppFormListVo was not validated!"); DomainFactory factory = (DomainFactory) this.getDomainFactory(); AppForm dom = AppFormListVoAssembler.extractAppForm(factory, listFormVo); factory.save(dom); return AppFormListVoAssembler.create(dom); }