What is HQL?

HQL stand for Hibernate Query Language. Hibernate Query Language (HQL) is an object-oriented query language, similar to SQL, but instead of operating on tables and columns, HQL works with persistent objects and their properties. HQL queries are translated by Hibernate into conventional SQL queries.

The HQL query is created with syntax:


The main advantage of HQL over SQL is:

  1. You don’t need to learn SQL
  2. Database independent
  3. Simple to write a query