I'm doing an relationship with two Entity (Parent - Child). So, in
Parent class I had a collection of Child. When I remove one item (child)
from the collection, its appears ok. But in database the operation doesn't
happen. I´d tried to remove by em.remove(child) , but this error occur: "
org.hibernate.ObjectDeletedException: deleted entity passed to persist: [
model.Child#]"
It happens because in the parent I have the CASCADE.PERSIST on the Children Set like this
@OneToMany (fetch = EAGER, cascade=CascadeType.ALL) public Set<Child> getChildren()so if I remove the CASCADE.PERSIST, leaving it like this:
@OneToMany(cascade={CascadeType.MERGE, CascadeType.REFRESH, CascadeType.REMOVE) public Set<Child> getChildren()
Hi,
maybe this helps
http://www.jboss.org/community/docs/DOC-13222
(your error message should be covered by the last part of the document).
Best regards
Wolfgang