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

D

davout

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top