use of org.hibernate.Query in project head by mifos.
the class CustomerPersistence method getAllCustomerNotes.
public QueryResult getAllCustomerNotes(final Integer customerId) throws PersistenceException {
QueryResult notesResult = null;
try {
Session session = null;
notesResult = QueryFactory.getQueryResult("NotesSearch");
session = StaticHibernateUtil.getSessionTL();
Query query = session.getNamedQuery(NamedQueryConstants.GETALLCUSTOMERNOTES);
query.setInteger("CUSTOMER_ID", customerId);
notesResult.executeQuery(query);
} catch (HibernateProcessException hpe) {
throw new PersistenceException(hpe);
} catch (HibernateSearchException hse) {
throw new PersistenceException(hse);
}
return notesResult;
}
use of org.hibernate.Query in project head by mifos.
the class LoanRepaymentTag method getMemberScheduleDetails.
@SuppressWarnings("unchecked")
private List<LoanBO> getMemberScheduleDetails(Integer parentId) {
Session hibSession = StaticHibernateUtil.getSessionTL();
Query query = hibSession.getNamedQuery("LoanBO.getMemberDetails");
query.setParameter("ACCOUNT_ID", parentId);
return (List<LoanBO>) query.list();
}
use of org.hibernate.Query in project head by mifos.
the class LoanArrearsAgingHelper method generateLoanArrearsAging.
private void generateLoanArrearsAging() throws BatchJobException {
StaticHibernateUtil.startTransaction();
try {
Query insert_select = StaticHibernateUtil.getSessionTL().getNamedQuery("generateLoanArrearsAging");
insert_select.setParameter("CURRENT_DATE", new LocalDate().toString());
insert_select.executeUpdate();
StaticHibernateUtil.commitTransaction();
} catch (Exception e) {
StaticHibernateUtil.rollbackTransaction();
throw new BatchJobException(e);
}
}
use of org.hibernate.Query in project head by mifos.
the class LoanArrearsAgingHelper method deleteAllLoanArrearsAging.
private void deleteAllLoanArrearsAging() throws BatchJobException {
StaticHibernateUtil.startTransaction();
try {
Query delete = StaticHibernateUtil.getSessionTL().getNamedQuery("deleteAllLoanArrearsAging");
delete.executeUpdate();
StaticHibernateUtil.commitTransaction();
} catch (Exception e) {
StaticHibernateUtil.rollbackTransaction();
throw new BatchJobException(e);
}
}
use of org.hibernate.Query in project head by mifos.
the class FinancialInitializer method initalizeFinancialAction.
@SuppressWarnings("unchecked")
public static void initalizeFinancialAction() throws FinancialException {
Session session = StaticHibernateUtil.getSessionTL();
try {
Query queryFinancialAction = session.getNamedQuery(FinancialQueryConstants.GET_ALL_FINANCIAL_ACTION);
List<FinancialActionTypeEntity> listFinancialAction = queryFinancialAction.list();
for (FinancialActionTypeEntity fabo : listFinancialAction) {
FinancialActionCache.addToCache(fabo);
}
} catch (Exception e) {
throw new FinancialException(FinancialExceptionConstants.FINANCIALACTION_INITFAILED, e);
}
}
Aggregations