SQL is a language used in relational database.
OQL is a language used in object database.
Hibernate is an OR mapping. If you use OOP with relational database, Hibernate will help you.
You just pay attention to your object model, dont pay attention to how data is stored into database.
HQL is one implementation of OQL for Hibernate but object database.
SQL works on table, HQL work on object.
SQL works on relation between 2 tables.
HQL works on relation between 2 objects.
Main Topics
Browse All Topics





by: mrjoltcolaPosted on 2009-06-22 at 14:29:16ID: 24686722
SQL is a semi-standard for all relational database engines. It is Structured Query Language and the database engine understands it. http://en.wikipedia.org/wi ki/SQL
HQL is Hibernate Query Language - It is NOT a standard like SQL, but it is very ubiquitous in its own regard due to the popularity of Hibernate. Hibernate itself is an Object Relational Mapper, intended to map and glue Object Domains (Java, C++) to Relational Domains (SQL Server, Oracle). HQL is implemented inside Hibernate, and is translated to SQL for the target database. In the end, use of HQL will result in SQL to the database.
The key is, to use HQL you need the Hibernate engine.
HQL is "entity" and OOP aware, it is aware of inheritance, etc.
Rather than provide links I will just advise to google: HQL or SQL vs HQL