Hibernate Query Language
Hibernate offers its own query language, called HQL, which resembles SQL in many ways but also supports additional features. There are some differences, for example, instead of the table name, you simply use the entity name and Hibernate will figure out the table name. This is because both HQL and JPA Query Language (JPQL) use an object model, and both languages are considered to be object-oriented and support polymorphism and inheritance concepts.
In this section, we'll focus on HQL and also how Hibernate supports native SQL. However, this section is not meant to be a language reference for HQL; this is indeed a powerful language and most likely deserves its own book. For now, it is highly recommended that you read the online documentations for a complete reference.
When composing HQL statements, you should be aware of the following:
- HQL is case insensitive, except when you are referring to entity classes. It's a convention to use lowercase for all HQL keywords...