O'Reilly logo

Spring: Developing Java Applications for the Enterprise by Ravi Kant Soni, Rajesh RV, Amuthan Ganeshan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hibernate Criteria Query Language

There is an alternative way provided by Hibernate to manipulate objects and in turn the data available in an RDBMS table. A Java programmer might feel it is easier to use Hibernate Criteria Query Language (HCQL) as it supports methods to add criteria on a query.

The Criteria interface

We can build a criteria object using the Criteria interface, where we can apply logical conditions and filtration rules. The Session interface of Hibernate provides the createCriteria() method to create a Criteria object that returns an instance of a persistence object's class when your application executes a criteria query.

The following is a list of commonly used methods from the Criteria interface:

Method

Description

public Criteria ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required