• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Point me to a COMPLETE HQL reference?

 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://www.stpe.se/2008/07/hibernate-hql-like-query-named-parameters/
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Philippe Desrosiers
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JACKPOT!

Thanks for both your responses. Very helpful!
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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

Regards,
zz_fluke
 
In the renaissance, how big were the dinosaurs? Did you have tiny ads?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic