Hibernate version: 3.0
I am trying to convert my HQL to criteria to better dynamically create the queries. However I ran into a problem when doing this HQL Statement:
select distinct o.id, o.order from User u, OrgUnit o where...[simple restrictions]...and u.id = o.id;
OrgUnit is distinct from User so no association is in the mapping files.
First how do I create a criteria object using both UserOrg.class and OrgUnit.class. Second, i assume you just alias these instances but how do you add the restriction of u.id = o.id. Third, how is distinct done in criteria.
Thanks for the help
|