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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top