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.  [ 1 post ] 
Author Message
 Post subject: Challenging question - AND condition in ON clause
PostPosted: Thu Feb 03, 2011 2:54 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  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.