wood burning stoves 2.0*
The moose likes Object Relational Mapping and the fly likes Point me to a COMPLETE HQL reference? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Point me to a COMPLETE HQL reference?" Watch "Point me to a COMPLETE HQL reference?" New topic

Point me to a COMPLETE HQL reference?

Philippe Desrosiers
Ranch Hand

Joined: Mar 29, 2006
Posts: 138
Can anyone point me to a COMPLETE HQL reference guide? The Hibernate docs are a little anemic on the specification side of things. They give one or two kindergarten examples, but, for instance, leave out the LIKE operator entirely.

Failing this, can anyone tell me how to use the LIKE operator in HQL queries? Is "from MyObject where MyField like :param" equivalent to the SQL "SELECT * FROM MyTable where MyColumn LIKE '%param%'"

or LIKE '%param' ?

or LIKE 'param%' ?

The hql documentation (such as it is) is silent on the subject. Help!
Santosh Ramachandrula
Ranch Hand

Joined: Apr 04, 2004
Posts: 252

Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

Like and wildcards behave exactly the same in SQL and HQL. So:

in HQL is synonymous with:

in SQL.

Can't help you with a free HQL reference. The Hibernate books offer more complete examples. Its worth getting the Hibernate tools plugin for eclipse since this includes a perspective from which you can run arbitrary HQL.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Philippe Desrosiers
Ranch Hand

Joined: Mar 29, 2006
Posts: 138

Thanks for both your responses. Very helpful!
Pavlo Lozovskiy

Joined: Jul 28, 2012
Posts: 1

maybe you already got the answer, but this could help the others who is looking for HQL reference, here you are --> HQL: The Hibernate Query Language

I agree. Here's the link: http://aspose.com/file-tools
subject: Point me to a COMPLETE HQL reference?
Similar Threads
find an index of a specific string starting at a given index in reverse order
PDF download Using Struts
SQL to HQL (Having issue in Left Outer Join)
HQL Query
Cewolf and database?