Hibernate: Criteria Queries in Depth
(Page 1 of 4 )
HQL forces programmers to drop into an SQL-like syntax for certain operations. So it would seem that Hibernate developers still need to know SQL. Fortunately, Hibernate offers a set of APIs that map the SQL functionality to objects. This allows programmers to use an entirely object-oriented approach without falling back on a relational methodology. Keep reading to find out more.
In a previous discussion, the focus was HQL. Though HQL works with the object-oriented approach, the developer still needs to know SQL. The only difference is the replacement of the relational methodology with the object-oriented one. In essence, a developer still has to drop into an SQL-like syntax for CRUD operations.
To overcome this obstacle and provide an extensible as well as completely object-oriented solution, Hibernate exposes a set of APIs that map the SQL functionality to objects, eliminating the need for an SQL-like syntax. These APIs constitute the Hibernate Criteria Query APIs. In this discussion the focus will be on Criteria Query APIs, or Criteria Queries in short.
The first section will cover the core classes of Criteria Queries. In the second section, the core classes will be mapped to the core functionalities of SQL. In the third and last section I will rewrite the application developed in the discussion about HQL and extend its functionalities. That’s the agenda for this discussion.
Next: The Core Classes of Criteria Queries >>
More Java Articles
More By A.P.Rajshekhar