This content has been marked as final.
Show 4 replies
-
1. Re: Update for entities with oneToMany relatinship not worki
waynebaylor Aug 25, 2007 10:41 AM (in response to navjeetc)are you saving using EntityManager.merge ?
-
2. Re: Update for entities with oneToMany relatinship not worki
navjeetc Aug 27, 2007 11:01 AM (in response to navjeetc)I am not using merge as I am doing a find on the user first and then setting the new set of permissions on the user.
-
3. Re: Update for entities with oneToMany relatinship not worki
carstenrudat Aug 27, 2007 1:47 PM (in response to navjeetc)Hi mohali,
I'm not quite sure, but I think you have to set a relationship on both ends:for(PermissionEntityEJB permissionEntity : permissionsList) { permissionEntity.setUser(usrEntity); }
Am I wrong? -
4. Re: Update for entities with oneToMany relatinship not worki
navjeetc Aug 27, 2007 5:18 PM (in response to navjeetc)And I am setting the user for the new permissions and it does persist the new permissions. The only issue is with permissions that were in the old set but not there in the new set of permissions. Do I have delete those explicitly or the container can be smart enough to replace the old set of permissions with the new set permissions (and this may include deleting some permissions that are no more there now)?