Hi all,
It would seem that it is not possible to use Select Distinct with the Criteria API. Spring offers in its HibernateTemplate support no direct use of Query. You have to use the Criteria api to implement pagination.
ResultTransformer is no joy because it distincts a list after sql, making it useless for pagination.
Now, I saw some solutions projecting results into resultsets. This just seems to me like throwing expensive computing power at something that should just be a trivial programmatic solution. Something like Restrictions.distinct("column name")
After running into this and looking for a solution, I saw that this issue has been around for years and years and is a continuous source of complaints. At the risk of sounding arrogant, I'm just wondering: why? Is there a reason or limitation why this is not being made possible?
Cheers,
Marc
|