Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Any innate limitations to HQL vs. SQL?

 
Brian Manahan
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody. I'm just starting to take a look at Hibernate and it's query language, and wondered if there are any innate limitations to the object-oriented queries versus standard SQL. I've seen some simpler ORMs lacking various capabilities such as left joins (I think it was a python one), but I haven't come across anything that HQL can't do.

Performance isn't an issue, just the functions performed by the query.

Thanks,
Brian Manahan
 
Scott Johnson
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've not yet run into anything that I couldn't resolve.

In the worst case you can get a reference to Hibernate's JDBC Connection object and run SQL the old fashioned way.

I did that once when I had a very complex and long running query. By creating my own Statement and using Hibernate's Connection I was able to hand tune the query to eliminate several joins which dramatically improved performance.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic