how can we get distinct result by using criteria in hibernate.
A more flexible solution may be:
criteria.setProjection(Projections.distinct(Projections.property("property")));
criteria.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
See also https://forum.hibernate.org/viewtopic.php?t=941669
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With