I have a method which fetches several records based on record Id's. Using
the peers howto, I see the .or() method used when I know all the criterion
in advance; but what if I am dynamically or'ing the criterion?

Perhaps the excerpt below explains better what I am trying to do:

Criteria criteria = new Criteria();
// hard coded for testing. In my method, Vector v is a passed parameter
Vector v = new vector
v.put("32");
v.put("68");
v.put("98");

if ( v.size() > 0 )
    critieria.add( v.get(0) );
for ( int x = 1; x < v.size(); x++ )
{
    Criteria.Criterion c = criteria.getNewCriterion(myDataPeer.X1,
                                            v.get(x), Criteria.EQUALS);
    criteria = criteria.or(c); // <-- does this work???
}

My code above should create the SQL
    SELECT FROM ? WHERE X1='32' OR X1='68' OR X1='98';

I am just not sure of what my "append" statement (as indicated in my
example)
should be. Could someone help?

TIA,

Steve B.





--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to