Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > EJB: How to delete child entries from a parent-child CMR one-to-many relationship?

Reply
Thread Tools

EJB: How to delete child entries from a parent-child CMR one-to-many relationship?

 
 
davout
Guest
Posts: n/a
 
      04-18-2004
In situation where a parent entity has a one-to-many CMP/CMR relationship to
a child entity, is there a quick way to delete all child entity data
instances without deleting the parent entity?

I thought I read somewhere that you could use the parent entity field
representing the child entity container method and call its 'clear' method
but this doesn't seem to work.

Also I've tried retrieving the child list collection and then using an
iterator to find the child entity instnces and call the child entity remove
method. But this seemed to cause problems for subsequent calls to the parent
entity child lost collection field.

Any ideas?





 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I: Main thread spawn child threads, which child processes...control those child processes? Jeff Rodriguez C Programming 23 12-09-2003 11:06 PM
cmr with jboss problem dcp Java 1 11-20-2003 01:40 PM
Eclipse, Lomboz, and CMR Steve Nakhla Java 0 11-03-2003 07:39 PM
EJB - Simple CMR one-to-one unidirectional relationship Patrick Maddox Java 0 08-01-2003 08:45 AM
CMR/CMP and Compound Primary Key Damir Mikoc Java 1 07-04-2003 03:27 AM



Advertisments