-->
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: Challenging question - AND condition in ON clause
PostPosted: Tue Feb 08, 2011 1:04 pm 
Newbie

Joined: Fri Sep 28, 2007 7:40 pm
Posts: 9
Hi,
Code:
select * from table_a a
             left outer join  table_b b on b.pk_column_id=a.pk_column_id
where a.column_x='criteria'

to do this I know we can add a code like this in Criteria Queries

Code:
Criteria criteria = daoService.getCriteria(TableA.class);
criteria.createAlias("TableB", "TableB", CriteriaSpecification.LEFT_JOIN);


I would like to

Code:
select * from table_a a
             left outer join  table_b b on b.pk_column_id=a.pk_column_id  and b.column_y='val1' and b.column_z='val2'
where a.column_x='val'


Notice the ON clause with and b.column_y='val1' and b.column_z='val2'

I don't want to add those criteria in where clause. I would like to do it only in the ON clause. How would I achieve this in Hibernate criteria queries.

Thanks in advance for your help.


Top
 Profile  
 
 Post subject: Re: Challenging question - AND condition in ON clause
PostPosted: Wed Feb 09, 2011 9:24 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Wrong forum. This is a question for the Hibernate User forum.


Top
 Profile  
 
 Post subject: Re: Challenging question - AND condition in ON clause
PostPosted: Tue Jan 10, 2012 2:36 pm 
Newbie

Joined: Wed Dec 29, 2010 6:36 pm
Posts: 5
Was there ever a solution provided to this in any forum? I have the same requirement.


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.