Search in sources :

Example 1 with ReportException

use of org.mifos.reports.exceptions.ReportException 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();
    }
}
Also used : HibernateProcessException(org.mifos.framework.exceptions.HibernateProcessException) ApplicationException(org.mifos.framework.exceptions.ApplicationException) HibernateException(org.hibernate.HibernateException) ReportException(org.mifos.reports.exceptions.ReportException) SystemException(org.mifos.framework.exceptions.SystemException) ReportException(org.mifos.reports.exceptions.ReportException) HibernateProcessException(org.mifos.framework.exceptions.HibernateProcessException) PersistenceException(org.mifos.framework.exceptions.PersistenceException) HibernateException(org.hibernate.HibernateException) ApplicationException(org.mifos.framework.exceptions.ApplicationException) Session(org.hibernate.Session)

Example 2 with ReportException

use of org.mifos.reports.exceptions.ReportException 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();
    }
}
Also used : HibernateProcessException(org.mifos.framework.exceptions.HibernateProcessException) ApplicationException(org.mifos.framework.exceptions.ApplicationException) HibernateException(org.hibernate.HibernateException) ReportException(org.mifos.reports.exceptions.ReportException) SystemException(org.mifos.framework.exceptions.SystemException) ReportException(org.mifos.reports.exceptions.ReportException) HibernateProcessException(org.mifos.framework.exceptions.HibernateProcessException) PersistenceException(org.mifos.framework.exceptions.PersistenceException) HibernateException(org.hibernate.HibernateException) ApplicationException(org.mifos.framework.exceptions.ApplicationException) Session(org.hibernate.Session)

Example 3 with ReportException

use of org.mifos.reports.exceptions.ReportException 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();
    }
}
Also used : HibernateProcessException(org.mifos.framework.exceptions.HibernateProcessException) ApplicationException(org.mifos.framework.exceptions.ApplicationException) HibernateException(org.hibernate.HibernateException) ReportException(org.mifos.reports.exceptions.ReportException) SystemException(org.mifos.framework.exceptions.SystemException) ReportException(org.mifos.reports.exceptions.ReportException) HibernateProcessException(org.mifos.framework.exceptions.HibernateProcessException) PersistenceException(org.mifos.framework.exceptions.PersistenceException) HibernateException(org.hibernate.HibernateException) ApplicationException(org.mifos.framework.exceptions.ApplicationException) Session(org.hibernate.Session)

Example 4 with ReportException

use of org.mifos.reports.exceptions.ReportException 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();
    }
}
Also used : HibernateProcessException(org.mifos.framework.exceptions.HibernateProcessException) ApplicationException(org.mifos.framework.exceptions.ApplicationException) HibernateException(org.hibernate.HibernateException) ReportException(org.mifos.reports.exceptions.ReportException) SystemException(org.mifos.framework.exceptions.SystemException) ReportException(org.mifos.reports.exceptions.ReportException) HibernateProcessException(org.mifos.framework.exceptions.HibernateProcessException) PersistenceException(org.mifos.framework.exceptions.PersistenceException) HibernateException(org.hibernate.HibernateException) ApplicationException(org.mifos.framework.exceptions.ApplicationException) Session(org.hibernate.Session)

Example 5 with ReportException

use of org.mifos.reports.exceptions.ReportException in project head by mifos.

the class ReportsPersistence method deleteReportsDataSource.

public void deleteReportsDataSource(ReportsDataSource reportsDataSource) throws ApplicationException, SystemException {
    Session session = null;
    try {
        session = StaticHibernateUtil.getSessionTL();
        StaticHibernateUtil.startTransaction();
        session.delete(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();
    }
}
Also used : HibernateProcessException(org.mifos.framework.exceptions.HibernateProcessException) ApplicationException(org.mifos.framework.exceptions.ApplicationException) HibernateException(org.hibernate.HibernateException) ReportException(org.mifos.reports.exceptions.ReportException) SystemException(org.mifos.framework.exceptions.SystemException) ReportException(org.mifos.reports.exceptions.ReportException) HibernateProcessException(org.mifos.framework.exceptions.HibernateProcessException) PersistenceException(org.mifos.framework.exceptions.PersistenceException) HibernateException(org.hibernate.HibernateException) ApplicationException(org.mifos.framework.exceptions.ApplicationException) Session(org.hibernate.Session)

Aggregations

HibernateException (org.hibernate.HibernateException)7 Session (org.hibernate.Session)7 ApplicationException (org.mifos.framework.exceptions.ApplicationException)7 HibernateProcessException (org.mifos.framework.exceptions.HibernateProcessException)7 PersistenceException (org.mifos.framework.exceptions.PersistenceException)7 SystemException (org.mifos.framework.exceptions.SystemException)7 ReportException (org.mifos.reports.exceptions.ReportException)7 Transaction (org.hibernate.Transaction)1