Hibernate Query Language

Hibernate Query Language is an object-oriented query language that works on persistence objects and their properties instead of operating on tables and columns. Hibernate will translate HQL queries into conventional SQL queries during the interaction with a database.

Even though you can use SQL queries using native SQL directly with Hibernate, it is recommended that you use HQL to get the benefits of Hibernate's SQL generation and caching strategies.

In HQL, keywords such as SELECT, FROM, WHERE, GROUP BY, and so on are not case sensitive but properties such as table and column names are case sensitive. So org.packt.spring.chapter6.hibernate.model.Employee is not same as org.packt.spring.chapter6.hibernate.model.EMPLOYEE ...

Get Learning Spring Application Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.