public TaxonomyUploadVo saveCodeLoaderDef(TaxonomyUploadVo codeLoaderDef) throws DomainInterfaceException, StaleObjectException, ForeignKeyViolationException { if (!codeLoaderDef.isValidated()) { throw new DomainRuntimeException("Column Map VO has not been validated."); } DomainFactory factory = getDomainFactory(); TaxonomyUpload tmBo = TaxonomyUploadVoAssembler.extractTaxonomyUpload(factory, codeLoaderDef); if (codeLoaderDef.getID_TaxonomyUploadIsNotNull()) { //update factory.update(tmBo); } else { //insert factory.save(tmBo); } return TaxonomyUploadVoAssembler.create(tmBo); }
public TaxonomyUploadVo getCodeLoaderDef(TaxonomyUploadRefVo codeLoaderDefRef) throws DomainInterfaceException { if(codeLoaderDefRef == null || codeLoaderDefRef.getBoId() == null) throw new DomainInterfaceException("Invalid TaxonomyUpload reference"); return TaxonomyUploadVoAssembler.create((TaxonomyUpload)getDomainFactory().getDomainObject(codeLoaderDefRef)); }
public TaxonomyUploadVo getCodeLoaderDef(Integer externalCodeTypeId, Integer taxonomyElementId) throws DomainInterfaceException { if(externalCodeTypeId == null) throw new DomainInterfaceException("Invalid TaxonomyUpload reference"); DomainFactory factory = getDomainFactory(); String hql = " from TaxonomyUpload as ct where ct.taxonomyCode = " + externalCodeTypeId + " and ct.taxonomyElement = " + taxonomyElementId; List taxMap = factory.find(hql); if (taxMap != null && taxMap.size() > 0) return TaxonomyUploadVoAssembler.create((TaxonomyUpload)taxMap.get(0)); return null; }