For Turbine 2.x (don't know about 3.x):

It appears Criteria.toString() has a side-effect: the limit and offset
fields are cleared after the method call.

Examples:

// this works as expected
Criteria crit = new Criteria();
crit.setLimit(5);
Vector objs = SomePeer.doSelect(crit); // returns max 5 rows

// this example clears the limit field
Criteria crit = new Criteria();
crit.setLimit(5);
String debug = crit.toString(); // say, for example, you want
                                          // to log the criteria created
Vector objs = SomePeer.doSelect(crit); // returns full rowcount


This is due to the fact that Criteria.toString() calls
BasePeer.createQueryString() and BasePeer.createQueryString() at times calls
Criteria.setLimit() and Criteria.setOffset(). Sorry, I'm not that familiar
with the code yet to suggest a patch, but it seems logical that
BasePeer.createQueryString() shouldn't mutate the Criteria parameter.

James


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

Reply via email to