db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Malcolm Kendall" <mikend...@blueyonder.co.uk>
Subject RE: deleteAll / delete entire table content
Date Mon, 16 Jun 2003 21:15:39 GMT
Alternatively just use:
	TableNamePeer.executeStatement("delete from <TableName>");

-----Original Message-----
From: Campbell, Justin [mailto:jcampbell@profilesys.com]
Sent: 04 June 2003 19:39
To: 'Turbine Torque Users List'
Subject: RE: deleteAll / delete entire table content


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

---------------------------------------------------------------------
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