Do you also remove the entity from the datamodel and/or list that is backing
the table?
Regards
Felix
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4071888#4071888
Reply to the post :
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4071888
yes, that's what I wanted to remove. I changed my code like this and it worked
smoothly now:
From the controller bean, removed the code:
| public void removeAnItem(Item anItem){
| entityManager.remove(anItem);
| }
|
In the entity bean ShoppingPlan, added this method:
| public
What happens if you have:
| public void removeAnItem(Item anItem){
| entityManager.remove(entityManager.merge(anItem));
| }
|
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4071955#4071955
Reply to the post :
I am assuming you have a @ManyToOne realationship in the Entity you are trying
to delete. On the @OneToMany side you most likely have
| @OneToMany(cascade = CascadeType.ALL, .)
|
If you change to
@OneToMany(cascade = {CascadeType.MERGE,CascadeType.REMOVE}, )
It may solve
or em.merge( yourUpdatedEntity ) explicitly
View the original post :
http://www.jboss.com/index.html?module=bbop=viewtopicp=4072302#4072302
Reply to the post :
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4072302
___
jboss-user