db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Campbell, Justin" <jcampb...@profilesys.com>
Subject RE: deleteAll / delete entire table content
Date Wed, 04 Jun 2003 18:39:12 GMT
Very simple solution to this one. Call the following code:

crit.add(TableNamePeer.PK_COLUMN, null, Criteria.ISNOTNULL)

In this example, PK_COLUMN is whatever column you're using as a primary key.
Obviously, this is because we can ensure a PK will not be null. If you have
another column you'd like to use, feel free.

-----Original Message-----
From: Auinger, Thomas [mailto:Thomas.Auinger@wincor-nixdorf.com]
Sent: Wednesday, June 04, 2003 4:49 AM
To: 'Turbine Torque Users List'
Subject: deleteAll / delete entire table content


Probably a rather simple question, but I couldn't find an 
answer in the archive:

I thought I could implement a doDeleteAll method by simply 
writing:

    public class ItemPeer {

        public static void doDeleteAll() throws TorqueException
        {
          Criteria crit = new Criteria();
          doDelete(crit);
        }

        ...
    }

But doesn't work, since there is no 'tables' item in the 
resulting Criteria object (that's what I found out debugging).

Any ideas? Thanks!

Thomas

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

Mime
View raw message