This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes differences between HQL and JPQL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "differences between HQL and JPQL" Watch "differences between HQL and JPQL" New topic

differences between HQL and JPQL

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Hi ,

Please let me know if what is the difference in JPQL vs. HQL syntax .

Save India From Corruption - Anna Hazare.
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17249

Main difference is that you must put a "SELECT" in JPA whereas in HQL it is not required.

For any other difference, it is best to look at the Hibernate documentation.

They pretty much are the same. Very small differences at all.

Good Luck


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Thank you very much Mark .
nisu pathak

Joined: Nov 03, 2013
Posts: 29
hey Differance exist for only select execute other dml statements syntax remains the same both for Jpql and HQL.
I agree. Here's the link:
subject: differences between HQL and JPQL
Similar Threads
Hibernate suppourt with JPA
outer join in HQL
Basic understanding of JPQL and HQL
java.lang.ClassCastException: java.lang.Integer cannot be cast to com.user
Hibernate JPQL/HQL: aggregate functions show results of wrong table/entity joined twice