18. What is Hibernate Query Language (HQL)

Hibernate offers a query language that embodies a very powerful and flexible mechanism to query, store, update, and retrieve objects from a database. This language, the Hibernate query Language (HQL), is an object-oriented extension to SQL.

The from clause
from Cat cat
from Formula as form, Parameter as param

The select clause
select cat.name from DomesticCat cat where cat.name like 'fri%'
select max(bodyWeight) as max, min(bodyWeight) as min, count(*) as n from Cat cat

Associations and joins
from Cat as cat inner join cat.mate as mate left outer join cat.kittens as kitten
from Cat as cat left join cat.mate.kittens as kittens
from Formula form full join form.parameter param

1 comment:

  1. Excellent pieces. Keep posting such kind of information on your blog. I really impressed by your blog.