posted 17 years ago
Lets take Movie and Director entities from HF book.
This has many-one relationship(from Movie to Director) and Movie bean has set cascade-delete in DD. If we take this picture on database, DirectorId will be the FK in Movie table.
My question is if i call remove method on Director entity bean, how the deletion actually works? The spec says(Page:132)
--------------------------------------------------------------------
After removing the entity object from all relationships and removing its persistent representation, the Container must then cascade the removal to all entity beans with which the entity had been previously in container-managed relationships for which the cascade-delete option was specified.
--------------------------------------------------------------------
Doest it mean, first Director entity will be deleted and then all its associated Movies will be deleted?But, how this is possible?Unless and until all referred Movies are deleted a particular Director bean cannot be deleted.
Need comments, pls.
Thanks,
Prashant
Thanks, <br />Prashant<br />SCJP, SCBCD