This content has been marked as final.
Show 3 replies
-
1. Re: Oddness - javax.persistence.EntityNotFoundException
mhissen Dec 11, 2007 4:38 AM (in response to damianharvey)I have the same problem,
Please help... -
2. Re: Oddness - javax.persistence.EntityNotFoundException
damianharvey Dec 11, 2007 5:57 AM (in response to damianharvey)That was a while ago and that code is now working. If you post your page and Bean I will see if I can help.
Cheers,
Damian. -
3. Re: Oddness - javax.persistence.EntityNotFoundException
damianharvey Dec 30, 2007 10:36 AM (in response to damianharvey)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); }
Cheers,
Damian.