-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Criteria Left Join with additional "ON" expression
PostPosted: Thu May 13, 2010 7:08 pm 
Beginner
Beginner

Joined: Sat Sep 12, 2009 10:20 am
Posts: 44
Does anybody know if this is possible using criteria

select * from Table1
left join Table2 on table2.id=table1.id and table2.foo=bar
where ...

There doesn't seem to be a way modify the ON expression.
Is there a work around for this?

From the following post this seems possible with the "with" clause in HQL, but not mention of criteria
http://opensource.atlassian.com/project ... wse/HHH-16


Last edited by thedug on Fri May 14, 2010 8:45 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Criteria Left Join with additional "ON" expression
PostPosted: Fri May 14, 2010 12:00 am 
Beginner
Beginner

Joined: Sat Sep 12, 2009 10:20 am
Posts: 44
Unless you have other ideas, I'm specifically interested in figuring out what class actually spits out the SQL.


Top
 Profile  
 
 Post subject: Re: Criteria Left Join with additional "ON" expression
PostPosted: Sat May 15, 2010 3:46 am 
Beginner
Beginner

Joined: Sat Sep 12, 2009 10:20 am
Posts: 44
This appears to be fixed in 5.1, as indicated in the bug below:

http://opensource.atlassian.com/project ... e/HHH-2308

I'll have to try upgrading again.. Here's the gist...

Code:
public Criteria createAlias(String associationPath, String alias, int joinType, Criterion withClause) throws HibernateException;

public Criteria createCriteria(String associationPath, String alias, int joinType, Criterion withClause) throws HibernateException;


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.