public class Restrictions
extends Object
The criterion package may be used by applications as a framework for building new kinds of Criterion. However, it is intended that most applications will simply use the built-in criterion types via the static factory methods of this class.

1. in(String,Collection)
public static Criterion in(String propertyName,
                           Collection values)
Apply an "in" constraint to the named property
propertyName -
values -

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.

The Session is a factory for Criteria. Criterion instances are usually obtained via the factory methods on Restrictions. eg.

List cats = session.createCriteria(Cat.class) .add("name", "Iz%") ) .add( "weight", new Float(minWeight) ) ) .addOrder( Order.asc("age") ) .list();

1. add(Criterion)
Add a Criterion to constrain the results to be retrieved.
      2. list()
      get all the results.