Java Mailing List Archive

Home » JBoss User »

[jboss-user] [JBoss Seam] - Re: Oddness -


Author LoginPost Reply
I've just run into this problem again and am posting back here so I don't forget again.

When trying to delete an entity that has existing relationships (eg. OneToMany) you have to ensure that you clear the collection before removing the object. eg:public void deleteGroup(Group group) {
|  //where the relationship btw a 'User' and a 'Group' is maintained in a 'UserGroupList'
|  group.getUserGroupLists().clear();
|  entityManager.remove(group);
| }


View the original post :

Reply to the post :
jboss-user mailing list
©2008 - Jax Systems, LLC, U.S.A.