Hi,
I have this simple HQL query.
Code:
String hqlQuery = "from Department d where d.deptId="+deptId+"";
I have few Criteria queries which is used for the search functionality.
Between these two dates it searches for the data. This part is working fine.
Code:
getSession().createCriteria(DepartmentBean.class).
add(Restrictions.between("createdDateTime",toDate,fromDate));
But now my problem is
1. To combine my hqlQuery with this criteria query so that there is an additional condition for search i.e, search will now depend on the deptId that's passed.
2.
Code:
Query query = getSession().createQuery(pass that consolidated query here);
return query.list();
Please advice.
Thanks,
MJ