Customizing Hibernate Criteria - Adding conditions to a left join

Posted by Douglas Ferguson on Stack Overflow See other posts from Stack Overflow or by Douglas Ferguson
Published on 2010-05-14T03:59:05Z Indexed on 2010/05/14 4:04 UTC
Read the original article Hit count: 273

Filed under:
|
|
|

I need to be able to do the following:

Select * from Table1 left join Table2 on id1 = id2 AND i1 = ?

Hibernate criteria doesn't allow be to specify the i1 = ? part.

The existing code is using hibernate criteria and it would be a huge refactor to swap out for HQL

Does anybody have any tips how I could implement this differently or any way to override the Hibernate Criteria? I'm not opposed to cracking open hibernate and modifying, but when I began to dig it, there seems to be layers upon layers of abstractions. I never found the the point where SQL is actually generated...

© Stack Overflow or respective owner

Related posts about hibernate

Related posts about criteria