What is hibernate? What is main advantage of using hibernate
than using SQL?
- The Hibernate ORM framework provides its own query language called Hibernate Query Language .
- Hibernate Query Language (HQL) is same as SQL (Structured Query Language) but it doesn't depends on the table of the database. Instead of table name, we use class name in HQL.
- Therefore, it is database independent query language.
Characteristics of HQL
- Similar to SQL
- HQL’s syntax is very similar to standard SQL. If you are familiar with SQL then writing HQL would be pretty easy.
- Fully object-oriented: HQL doesn’t use real names of table and columns. It uses class and property names instead. HQL can understand inheritance, polymorphism and association.
- Reduces the size of queries