You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Andrew Belonogov <ab...@mail.ru> on 2003/10/23 21:38:44 UTC

where (a.id=b.id or a.id is null)

Hello
I need a criteria something like
  where (a.id=b.id or a.id is null)

-- 
Best regards,
 Andrew


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


Re: where (a.id=b.id or a.id is null)

Posted by Scott Eade <se...@backstagetech.com.au>.
Andrew Belonogov wrote:

>I need a criteria something like
>  where (a.id=b.id or a.id is null)
>  
>
You need to use Criterion - see:
http://db.apache.org/torque/criteria-howto.html

Scott

-- 
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au





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


Turn off Log4j

Posted by Ja...@uv.es.
Hi all,

  I am trying to turn off the log4j in torque because I am comparing 
execution times of Torque and simple JDBC calls. The times of Torque 
are bigger but I need to turn off the log4j to get a more real 
conclusion.

  I have tried to turn off Log4j in differents ways but I did not 
succed to remove these types of messages:

[DEBUG] BasePeer
[DEBUG] TorqueInstance

  BR.

Javi

  


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


Re: where (a.id=b.id or a.id is null)

Posted by Felipe Ramos <fr...@tissat.es>.
I'll give you a complete example:
SELECT  FROM prop_property WHERE prop_property.ZON_ID=1 AND 
((prop_property.AGE_ID>='1' AND prop_property.AGE_ID<=6) OR 
(prop_property.CIT_ID>=1 AND prop_property.CIT_ID<=9))

     Criteria crit = new Criteria();

         crit.add(PropPropertyPeer.ZON_ID,1);

         Criteria.Criterion a1 = crit.getNewCriterion( 
PropPropertyPeer.AGE_ID,
            (Object) (new Integer(1).toString()), Criteria.GREATER_EQUAL);
         Criteria.Criterion a2 = crit.getNewCriterion( 
PropPropertyPeer.AGE_ID,
            (Object)( new Integer(6)), Criteria.LESS_EQUAL);
      
        Criteria.Criterion b1 = crit.getNewCriterion(
            PropPropertyPeer.CIT_ID, (Object)(new Integer(1)), 
Criteria.GREATER_EQUAL);
        Criteria.Criterion b2 = crit.getNewCriterion(
            PropPropertyPeer.CIT_ID, (Object)(new Integer(9)), 
Criteria.LESS_EQUAL);

        crit.add( a1.and(a2 ).or(b1.and(b2)));


With null, I use de Criteria.CUSTOM


Andrew Belonogov wrote:

>Hello
>I need a criteria something like
>  where (a.id=b.id or a.id is null)
>
>  
>

-- 
------------------------
Felipe Ramos
Tissat SA
C/ Orense 34-9ยช
28020 Madrid
Tel: (+34) 91 4175913 
Fax: (+34) 91 4172914
Mail: framos@tissat.es
------------------------




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