use of org.mifos.framework.exceptions.HibernateProcessException in project head by mifos.
the class ReportsPersistence method createReportsDataSource.
public void createReportsDataSource(ReportsDataSource reportsDataSource) throws ApplicationException, SystemException {
Session session = null;
try {
session = StaticHibernateUtil.getSessionTL();
StaticHibernateUtil.startTransaction();
session.save(reportsDataSource);
session.flush();
StaticHibernateUtil.commitTransaction();
} catch (HibernateProcessException hpe) {
StaticHibernateUtil.rollbackTransaction();
throw new ApplicationException(hpe);
} catch (HibernateException e) {
StaticHibernateUtil.rollbackTransaction();
throw new ReportException(ReportsConstants.CREATE_FAILED_EXCEPTION, e);
} catch (Exception e) {
StaticHibernateUtil.rollbackTransaction();
throw new ReportException(ReportsConstants.CREATE_FAILED_EXCEPTION, e);
} finally {
StaticHibernateUtil.closeSession();
}
}
use of org.mifos.framework.exceptions.HibernateProcessException in project head by mifos.
the class ReportsPersistence method deleteReportsParamsMap.
/**
* Deletes a link between report and a parameter
*/
public void deleteReportsParamsMap(ReportsParamsMapValue reportsParamsMapValue) throws ApplicationException, SystemException {
Session session = null;
try {
session = StaticHibernateUtil.getSessionTL();
StaticHibernateUtil.startTransaction();
session.delete(reportsParamsMapValue);
session.flush();
StaticHibernateUtil.commitTransaction();
} catch (HibernateProcessException hpe) {
StaticHibernateUtil.rollbackTransaction();
throw new ApplicationException(hpe);
} catch (HibernateException e) {
StaticHibernateUtil.rollbackTransaction();
throw new ReportException(ReportsConstants.CREATE_FAILED_EXCEPTION, e);
} catch (Exception e) {
StaticHibernateUtil.rollbackTransaction();
throw new ReportException(ReportsConstants.CREATE_FAILED_EXCEPTION, e);
} finally {
StaticHibernateUtil.closeSession();
}
}
use of org.mifos.framework.exceptions.HibernateProcessException in project head by mifos.
the class ReportsPersistence method deleteReportParams.
public void deleteReportParams(ReportsParamsValue reportsParams) throws ApplicationException, SystemException {
Session session = null;
try {
session = StaticHibernateUtil.getSessionTL();
StaticHibernateUtil.startTransaction();
session.delete(reportsParams);
session.flush();
StaticHibernateUtil.commitTransaction();
} catch (HibernateProcessException hpe) {
StaticHibernateUtil.rollbackTransaction();
throw new ApplicationException(hpe);
} catch (HibernateException e) {
StaticHibernateUtil.rollbackTransaction();
throw new ReportException(ReportsConstants.CREATE_FAILED_EXCEPTION, e);
} catch (Exception e) {
StaticHibernateUtil.rollbackTransaction();
throw new ReportException(ReportsConstants.CREATE_FAILED_EXCEPTION, e);
} finally {
StaticHibernateUtil.closeSession();
}
}
use of org.mifos.framework.exceptions.HibernateProcessException in project head by mifos.
the class ReportsPersistence method updateReportsJasperMap.
/**
* sets a link between report and a jasper file
*/
public void updateReportsJasperMap(ReportsJasperMap reportsJasperMap) throws ApplicationException, SystemException {
Session session = null;
try {
session = StaticHibernateUtil.getSessionTL();
StaticHibernateUtil.startTransaction();
session.update(reportsJasperMap);
session.flush();
StaticHibernateUtil.commitTransaction();
} catch (HibernateProcessException e) {
StaticHibernateUtil.rollbackTransaction();
throw new ApplicationException(e);
} catch (HibernateException e) {
StaticHibernateUtil.rollbackTransaction();
throw new ReportException(ReportsConstants.CREATE_FAILED_EXCEPTION, e);
} catch (Exception e) {
StaticHibernateUtil.rollbackTransaction();
throw new ReportException(ReportsConstants.CREATE_FAILED_EXCEPTION, e);
} finally {
StaticHibernateUtil.closeSession();
}
}
use of org.mifos.framework.exceptions.HibernateProcessException in project head by mifos.
the class LegacyPersonnelDao method getAllPersonnelNotes.
public QueryResult getAllPersonnelNotes(Short personnelId) throws PersistenceException {
QueryResult notesResult = null;
try {
Session session = null;
notesResult = QueryFactory.getQueryResult("NotesSearch");
session = StaticHibernateUtil.getSessionTL();
Query query = session.getNamedQuery(NamedQueryConstants.GETALLPERSONNELNOTES);
query.setInteger("PERSONNEL_ID", personnelId);
notesResult.executeQuery(query);
} catch (HibernateProcessException hpe) {
throw new PersistenceException(hpe);
} catch (HibernateSearchException hse) {
throw new PersistenceException(hse);
}
return notesResult;
}
Aggregations