Is there a reason to insist on the additional conditions in the "on" clause instead of the where clause ? The following should be functionally equivalent :
Criteria criteria = new Criteria(); criteria.addJoin(APeer.A_ID, BPeer.A_ID,Criteria.LEFT_JOIN); criteria.add(BPeer.ACTIVE, "Y"); ..... which would produce something like select a.*, b.*, *.c from a left join b on a.a_id = b.a_id left join c on .... where b.active = 'Y'; But coming back to your question, it is currently not possible to add a custom Criteria as join conditions. (e.g. something like (criteria.addJoin(someOthercriteria, Criteria.LEFT_JOIN))). The internal data structure does not currently allow this (see the inner class Criteria.Join). However, such a feature would be useful in my eyes. Thomas Scott Eade <[EMAIL PROTECTED]> schrieb am 12.02.2007 05:29:37: > Hi, > > I see that we deal with the situation where we need to do a basic join > from a table more than once this: > > e.g. select a.*, b.*, c.* > from a left join b on ... left join c on ...; > > But it is not obvious whether or not we provide the ability to specify > additional criteria against the table we are joining to thus: > > e.g. select a.*, b.*, *.c > from a left join b on a.a_id = b.a_id and b.active = 'Y' > left join c on ...; > > Is this currently possible and if so, which criterion would I need to > grab in order to do it? > > Thanks, > > Scott > -- > Scott Eade > Backstage Technologies Pty. Ltd. > http://www.backstagetech.com.au > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
