graimon wrote:
How can I map the relation to, when I delete the CD, the image returns to its original state, with no cd assigned?
It's not the tipical relation that when deleting the parent, all the childs are deleted too, i need to keep the child orphan (with a null CD).
Have you tried setting an Image's parent to NULL before deleting the CD?
For example:
Code:
Session session = ...
CD cd = (CD) session.load(...);
Image im = (Image) session.load(...);
im.setCD(null);
session.saveOrUpdate(im);
session.delete(cd);