View RSS Feed

My Java Tips

  1. Criteria instance

    by , 06-02-2011 at 07:22 PM (My Java Tips)
    Hibernate provides an interface org.hibernate.Criteria, which represents a query against a particular persistent class.

    Review the following example:

    Java Code:
    Criteria crit = session.createCriteria(Student.class);
    crit.setMaxResults(50);
    List students = crit.list();
    Resultset can be narrowed according to requirement. The class org.hibernate.criterion.Restrictions defines factory methods for obtaining certain built-in Criterion types. ...
    Categories
    Hibernate