Greg Monroe wrote: > Old version of torque so I'm not sure about this. But my > best guess would be that the crit.add(...) / or(..) methods > are returning a copy of the original criteria object rather > than the original criteria.
The criteria methods always return the modified criteria, that is, a reference to the original criteria, not a copy. The problem here is that the crit.and() and crit.or() methods are meant to combine conditions related to the same column and not to different columns. These are always ANDed unless you use Criteria.Criterion objects as was discussed before. Examples: crit.add(SomePeer.SOMECOLUMN, 2); crit.or(SomePeer.SOMECOLUMN, 3); will get you WHERE (some.SOMECOLUMN = 2 or some.SOMECOLUMN = 3) crit.add(SomePeer.SOMECOLUMN, 2, Criteria.GREATER_THAN); crit.and(SomePeer.SOMECOLUMN, 4, Criteria.LESS_THAN); will get you WHERE some.SOMECOLUMN > 2 and some.SOMECOLUMN < 4) Bye, Thomas. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
