how can we get distinct result by using criteria in hibernate.
+1
A:
A more flexible solution may be:
criteria.setProjection(Projections.dinstinct(Projections.property("property")));
waxwing
2009-05-27 11:58:10
A:
depends on your query/criteria. if you provide a unique id you can call criteria.uniqueResult() otherwise you call criteria.setMaxResults(1) and call criteria.uniqueResult()
Salandur
2009-05-27 12:01:02