[hibernate-dev] JPQL versus HQL

Gunnar Morling gunnar at hibernate.org
Sun Aug 17 06:19:07 EDT 2014


Hi Etienne,

2014-08-17 9:07 GMT+02:00 Etienne Miret <etienne.miret at ens-lyon.org>:

> Hello all,
>
> Is HQL a superset of JPQL or a completely different language?
>

Yes, HQL is a superset.

>
> I’m asking because I’m currently adding JPAQL constructions to HQL (see
> HHH-9342 and HHH-9345), and I want to be sure it is the right thing to do.
>
> Since the reference documentation doesn’t say anything about JPQL, I
> suspect the former (HQL superset of JPQL), but I’d like to be sure.
>

The Developer Guide [1] has this to say:

"The Hibernate Query Language (HQL) and Java Persistence Query Language
(JPQL) are both object model focused query languages similar in nature to
SQL. JPQL is a heavily-inspired-by subset of HQL. A JPQL query is always a
valid HQL query, the reverse is not true however."

Hth,

--Gunnar

[1] https://docs.jboss.org/hibernate/orm/4.3/devguide/en-US/html/ch11.html



>
> Regards,
>
> --
> Etienne Miret
>
>
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev
>


More information about the hibernate-dev mailing list