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!