Advanced Java (2160707)

BE | Semester-4   Summer-2018 | 01-05-2018

Q1) (a)

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

  1. Similar to SQL
  2. HQL’s syntax is very similar to standard SQL. If you are familiar with SQL then writing HQL would be pretty easy.
  3. 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.
  4. Reduces the size of queries