db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andras Balogh <and...@reea.net>
Subject Re: [Criteria] where colA=colB
Date Thu, 24 Feb 2005 16:48:46 GMT
Hello Elisabeth,

T E Schmitz wrote:

>
> In this particular case, I have actually put together a sub-select, 
> which I retrieve with BasePeer.createQueryString() and add as an 
> AS-column in the main SELECT:
>
> .....
>
> ------------------------
>
> I've put this all together with Criteria except:
> T.METHOD = TRANSAKTION.METHOD
> T.KIND = TRANSAKTION.KIND
> which links the inner to the outer SELECT.
>
>
> But that complex example apart: how could you compare one column to 
> another one in the same table?
>
>
    If you check here :
http://db.apache.org/torque/criteria-howto.html
"Using the CUSTOM Comparator to check for NULL and NOT NULL" i think 
your case is similar.
I think you can use it like this:
criteria.add(TransaktionPeer.METHOD, (Object) "T.METHOD = 
TRANSAKTION.METHOD",Criteria.CUSTOM);

Best regards,
Andras.
 

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


Mime
View raw message