public ims.ocrr.vo.ImportResultsConfigVo saveImportResultsConfig(ims.ocrr.vo.ImportResultsConfigVo voSaveImportResultsConfig, ims.ocrr.vo.ImportResultsConfigVo voDeleteImportResultsConfig) throws ims.domain.exceptions.StaleObjectException, ForeignKeyViolationException { if (!voSaveImportResultsConfig.isValidated()) throw new DomainRuntimeException("ImportResultsConfig has not been validated"); DomainFactory factory = getDomainFactory(); if(voDeleteImportResultsConfig!=null){ ImportResultsConfig doDelete = ImportResultsConfigVoAssembler.extractImportResultsConfig(factory, voDeleteImportResultsConfig); factory.delete(doDelete); } ImportResultsConfig doSave = ImportResultsConfigVoAssembler.extractImportResultsConfig(factory, voSaveImportResultsConfig); factory.save(doSave); return ImportResultsConfigVoAssembler.create(doSave); }
public ims.ocrr.vo.ImportResultsConfigVo getImportResultsConfig() { DomainFactory factory = getDomainFactory(); String hql = "from ImportResultsConfig res "; ImportResultsConfigVoCollection coll = ImportResultsConfigVoAssembler.createImportResultsConfigVoCollectionFromImportResultsConfig(factory.find(hql)).sort(); if(coll!=null && coll.size()>0) return coll.get(0); return null; }