Hibernate version: 3.0.2
Mapping documents: CmChart.hbm.xml, CmClient.hbm.xml
Hello
I'm trying to figure out what Criteria code I would use for the following HQL query:
Code:
SELECT DISTINCT chart.client FROM CmChart chart WHERE chart.client IS NOT NULL AND chart.client.isActive = :isActive ORDER BY chart.client.clientName
Where a chart has a single client, which has the properties isActive and clientName. Basically, I'm trying to select all the unique clients who are associated with a chart and are active, ordered by their name. The above HQL works perfectly well, however when I try and create a Criteria to do the same thing I can't manage to get it to work (usually "can't resolve property XXX of YYY"). I can manage to get parts of it to work, but I can't put all of the addOrder() and setProjection() and createCriteria() together no matter how I try.
Thanks
James