db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <fisc...@seitenbau.net>
Subject RE: Additional join criteria
Date Mon, 12 Feb 2007 13:14:35 GMT
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 <seade@backstagetech.com.au> 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: torque-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-dev-help@db.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message