I have the same setup:
Note that this join table had no primary key (tho at one point I did denote
both of them as primaryKey="true" to try for a composite key but I still
got the same error). Trying something like you suggested, passing TABLEA_ID
to the doDelete() method in TABLEBPeer gave me an error saying the KeyDef
was improperly specified. I took this to mean one of two things, either all
tables, regardless, have to have primary keys or that one could only delete
an object by primary key. I changed my TABLEB definition to include a PK:
and my business object to retrieve the FK'd child objects and loop through
them one by one. It looks like, from what you're saying, that as long as I
have a primary key in the join table I can safely feed doDelete() an FK ...
yes? Will try that, but the inclusion of a primary key into every join
table is unexpected (and could use some documentation :P).
12/11/2002 01:07 Subject: Re: Deleting by pk
Please respond to
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();
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
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
> have to constantly look up primary keys using normal Criteria objects,
> Lists and iterate over them doDelete()'ing on each one. Or am I missing
> something obvious?
> Please say yes. :)
> To unsubscribe, e-mail: <
> For additional commands, e-mail: <
To unsubscribe, e-mail: <
For additional commands, e-mail: <