How do I use Hibernate’s criterion?

This example demonstrate the use of Hibernate’s criterion. This restriction will query for some record based on a collection of parameter defined for a specific property of the bean.

How do I use min, max, avg and sum Projections?

The code below demonstration the use of Projections.min(), Projections.max(), Projections.avg() and Projections.sum().

How do I select a single record using Criteria?

The Criteria.uniqueResult() method make it easier to query a single instance of a persistence object. When no persistence found this method will return a null value.