Hallo,
I want to use an entity which references a collection of other entities like
| @Entity
| public class Fencer implements Serializable {
|
| @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)
| @JoinColumn(name="fencer_id")
| public List<Tournament> getTournaments() {
| return tournaments;
| }
|
When I detach the fencer entity and change it in a remote client so that an
entry from the list is removed and then merge it back with
entityManager.merge(fencer), the entity has the correct state, the deleted
entry is gone. But on the DB level the deleted entry in the tournament table
still exits. Only the foreign key is set to null.
This behavior is quite unexpected to me. If I do not remove the orphaned
entries, the db will fill up with unneeded entries in the detail tables.
How do you implement this correctly to avoid this behavior?
Thanks,
Hans
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4091102#4091102
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4091102
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user