-->
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: Doing a left join with a condition in that join
PostPosted: Thu Aug 13, 2009 12:59 pm 
Newbie

Joined: Thu Aug 13, 2009 9:06 am
Posts: 1
Hi y'all
First post here..
I'd like to know how can i insert a condition expression in a 'left
outer join' clause using Criteria or DetachedCriteria
e.g.
Code:
LEFT OUTER JOIN
         TAB_PLAYER PLAY
                ON TEAM.ID_PLAYER = PLAY.ID_PLAYER
                         AND PLAY.SITUATION <> 'D'


I've tried to use CriteriaSpecification.LEFT_JOIN when i create an
alias but didn't work, it aways sends the 'AND' condition to the
clause 'WHERE'

this is how Im trying
Code:
DetachedCriteria criteria = DetachedCriteria.forClass(Team.class,"TEAM"); 
criteria.createAlias("Team.player", "PL",CriteriaSpecification.LEFT_JOIN); 
criteria.add(Restrictions.ne("PL.situation", Situation.D)); 
criteria.getExecutableCriteria(hibernateSession).uniqueResult();

any idea ??
Thanks in advance!


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.