26. Explain Criteria API

Criteria is a simplified API for retrieving entities by composing Criterion objects. This is a very convenient approach for functionality like "search" screens where there is a variable number of conditions to be placed upon the result set.

Example :

employees = session.createCriteria(Employee.class)
           .add(Restrictions.like("name", "a%") )
"address", "Boston"))
"name") )

No comments:

Post a Comment