Geetings,
This is just a quick 'is this possible' kind of question. We need to count the number of hits for a query using Projection. Because of a number of left outer joins in the query we need to make the root entity distinct - this seems simple enough using one property:
Code:
criteria.setProjection( Projections.countDistinct("eventCode") );
The problem is we need the distinction to be made based on a combination of two properties in the root entity, not just one.
Is this at all possible with using Projections?
Basically the resultant sql needs to have the same effect as this:
Code:
select count(distinct event_code,event_name ) from event;
Regards,
Alan.