db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Hansen <steve.han...@sinex.com>
Subject Re: Deleting by pk
Date Wed, 11 Dec 2002 18:07:50 GMT
I'm not sure what trouble you're having with delete...
I have code that seems to work fine doing the following.
Table A, 1 -------- Many  Table B

Criteria crit = new Criteria();
crit.add(BPeer.A_FOREIGN_KEY, aFKey);
B.doDelete(crit);

This will delete all related rows in Table B given a aFKey value.

If your having other issues post your error messages and relevant
section of myproject-schema.xml

Steve 


On Tue, 2002-12-10 at 20:10, JDiggans@genelogic.com wrote:
> 
> So ... I've read the threads in the archives but to make sure ... is the
> only way to delete an object by using it's Peer.doDelete() method and
> passing a Criteria object that specifies the primary key? This means that
> even join tables now have to have primary keys of their own ... and that I
> have to constantly look up primary keys using normal Criteria objects, form
> Lists and iterate over them doDelete()'ing on each one. Or am I missing
> something obvious?
> 
> Please say yes. :)
> -j
> 
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:turbine-torque-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:turbine-torque-user-help@jakarta.apache.org>
> 
> 



Mime
View raw message