use of org.mifos.application.importexport.business.ImportedFilesEntity in project head by mifos.
the class ImportedFilesServiceImpl method saveImportedFileName.
@Override
public void saveImportedFileName(String fileName, PersonnelBO submittedBy, List<AccountTrxDto> idsToUndoImport, Boolean phaseOut, Boolean undoable) {
Timestamp submittedOn = new Timestamp(new DateTimeService().getCurrentDateTime().getMillis());
Set<AccountTrxnEntity> accTrxEnt = new HashSet<AccountTrxnEntity>();
ImportedFilesEntity importedFile = new ImportedFilesEntity(fileName, submittedOn, submittedBy, accTrxEnt, phaseOut, undoable);
if (null != idsToUndoImport) {
for (AccountTrxDto trx : idsToUndoImport) {
accTrxEnt.add(importedFileDao.getAccTrxById(trx.getId()));
}
importedFile.setImportedTrxn(accTrxEnt);
}
try {
hibernateTransactionHelper.startTransaction();
importedFileDao.saveImportedFile(importedFile);
hibernateTransactionHelper.commitTransaction();
} catch (Exception e) {
hibernateTransactionHelper.rollbackTransaction();
throw new MifosRuntimeException(e);
} finally {
hibernateTransactionHelper.closeSession();
}
}
Aggregations