use of org.hibernate.Query in project head by mifos.
the class AccountingDaoHibernate method findExistedGlBalacesBOs.
public List<GlBalancesBO> findExistedGlBalacesBOs(Integer officeLevelId, String officeId, String glCodeValue, Integer financialYearId) {
List<GlBalancesBO> balancesBOs = null;
Query query = createdNamedQuery("getExistedGlBalancesBO");
query.setInteger("OFFICE_LEVEL", officeLevelId);
query.setString("OFFICE_ID", officeId);
query.setString("GLCODEVALUE", glCodeValue);
query.setInteger("FINANCIALYEARID", financialYearId);
balancesBOs = query.list();
return balancesBOs;
}
use of org.hibernate.Query in project head by mifos.
the class GenericDaoHibernate method executeNamedQueryWithResultTransformer.
@SuppressWarnings("unchecked")
@Override
public final List<? extends Object> executeNamedQueryWithResultTransformer(final String queryName, final Map<String, ?> nameQueryParameters, final Class<?> className) {
try {
Session session = getSession();
Query query = session.getNamedQuery(queryName).setResultTransformer(Transformers.aliasToBean(className));
query.setProperties(nameQueryParameters);
return query.list();
} catch (Exception e) {
throw new MifosRuntimeException(e);
}
}
use of org.hibernate.Query in project head by mifos.
the class GenericDaoHibernate method executeUniqueResultNamedQueryWithResultTransformer.
@Override
public final Object executeUniqueResultNamedQueryWithResultTransformer(final String queryName, final Map<String, ?> nameQueryParameters, final Class<?> className) {
try {
Session session = getSession();
Query query = session.getNamedQuery(queryName).setResultTransformer(Transformers.aliasToBean(className));
query.setProperties(nameQueryParameters);
return query.uniqueResult();
} catch (Exception e) {
throw new MifosRuntimeException(e);
}
}
use of org.hibernate.Query in project head by mifos.
the class GenericDaoHibernate method executeNamedQuery.
@SuppressWarnings("unchecked")
@Override
public final List<? extends Object> executeNamedQuery(final String queryName, final Map<String, ?> queryParameters) {
try {
Session session = getSession();
Query query = session.getNamedQuery(queryName);
query.setProperties(queryParameters);
return query.list();
} catch (Exception e) {
throw new MifosRuntimeException(e);
}
}
use of org.hibernate.Query in project head by mifos.
the class GenericDaoHibernate method executeUniqueResultNamedQuery.
@Override
public final Object executeUniqueResultNamedQuery(final String queryName, final Map<String, ?> queryParameters) {
try {
Session session = getSession();
Query query = session.getNamedQuery(queryName);
query.setProperties(queryParameters);
return query.uniqueResult();
} catch (Exception e) {
throw new MifosRuntimeException(e);
}
}
Aggregations