Hibernate

Step To Execute HQL queries Using Hibernate
Previous Home Next

The following three steps are required in executeing HQL queries.

  1. Obtaining an instance of org.hibernate.Query
  2. Customize the Query object
  3. Execute the Query
Obtaining an instance of org.hibernate.Query

A Query instance is obtained by calling Session.createQuery() or Session.getNamedQuery method. The createQuery() method is used to create a new instance of Query for given HQL Query.

Customize the Query object

After obtaining the query object we may want to customize it by setting query parameter,cache mode, Flush mode,fetch size ,an upper limit for the result set.

Execute the Query

After preparing the query object by setting all custom properties we use list(),scroll(),iterate() or uniqueResult().

Previous Home Next

Tolal:0 Click:

Show All Comments

Did not find what you were looking for leave your name and message. We will revert within 24 hours
Name:
eMail:
Comment / Feedback: