On Wednesday, January 23, 2002, at 01:48  PM, Pete Kazmier wrote:

> Quick question for any torque users out there (trying to finish up a
> Torque tutorial for the community), should BasePeer.doDelete(crit) with
> an empty Criteria object (crit = new Criteria()) delete everything or
> nothing in my table?

Delete nothing in the table.

It's a feature, not a bug.  ;^)  Even if it is inconsistent, I like
having to work a bit harder to intentionally delete everything in a
table.

Here's why it works the way it does.  Inside the doDelete method

    ...
    Enumeration e = criteria.keys();
    while(e.hasMoreElements())
    {
       //do stuff to assemble the SQL delete statement
       ...

A null criteria has no keys, so the sql statement doesn't get assembled.
The following criteria will probably do what you want:

Criteria crit = new Criteria();
crit.add(FooPeer.FOO_ID,0,Criteria.GREATER_THAN);


-Eric


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

Reply via email to