i think it's safe to assume that you have the "mappedBy" attribute set for
the User side of the relationship, right?
the mappedBy attribute basically says which side of the relationship is responsible for
maintaining the DB foreign key link. so, you could try this in your existing code:
| User[] users = portal.getUsers();
| for(User user : users)
| {
| user.setPortal(null); //or user.removePortal(), whatever your method is
| }
|
| em.remove(portal);
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4073070#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...