CHAPTER 8

image

HQL and JPA Query Language

When you use JDBC to access databases, you write SQL statements for the query and update tasks. In such cases, you’re dealing with tables, columns, and joins. When you use Hibernate, most update tasks can be accomplished through the provided APIs. However, you still need to use a query language for the query tasks, and Hibernate provides a powerful query language called Hibernate Query Language (HQL).

HQL is database independent and translated into SQL by Hibernate at runtime. When you write HQL, you can concentrate on the objects and properties without knowing much detail about the underlying database. You ...

Get Hibernate Recipes: A Problem-Solution Approach, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.