Hi,
Does anyone know how to do this HQL with a criteria in stead:
String sql = SELECT cp FROM Company cp, Person ps, WHERE cp.person = ps.id AND ps.cpr = ?
List list = getHibernateTemplate().find(sql, cpr);
So what i actually want to do is to make a search by associating two entities that are not related in my hibernate mapping with a criteria query.
Is that possible using the criteria query ?
The reason for me wanting to change this query to criteria, is because the possibility of paging with criteria, like:
criteria.setFirstResult(firstResult).setMaxResults(maxResults);
If it is not possible to do the association in a criteria query, is it then possible to do a "paging" search with HQL ?
Thanks in advance.
Best Regards
Cemil
|