Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002048 [Resin] major always 10-09-07 08:16 11-07-07 15:49
Reporter westrupp View Status public  
Assigned To ferg
Priority normal Resolution no change required  
Status closed   Product Version 3.1.3
Summary 0002048: amber many-to-many cascade merge() does not delete children
Description         // begin transaction ...

        // child to be deleted
        int appId = 1;

        // parent
        int userId = 1;

        User user = em.find(User.class, userId);

        Collection apps = user.getApplications();



        Collection newApps = new ArrayList();

        for (Iterator iterator = apps.iterator(); iterator.hasNext();) {

            Application o = (Application) iterator.next();

            if (o.getAppId().intValue()!=appId){

                newApps.add(o);

            }

        }



        user.setApplications(newApps);

        em.merge(user);


        // ... commit transaction

        // child is not deleted
Additional Information
Attached Files

- Relationships

- Notes
(0002461)
ferg
11-07-07 15:49

The merge operation does not automatically delete children, according to the JPA specification.
 

- Issue History
Date Modified Username Field Change
10-09-07 08:16 westrupp New Issue
11-07-07 15:49 ferg Note Added: 0002461
11-07-07 15:49 ferg Assigned To  => ferg
11-07-07 15:49 ferg Status new => closed
11-07-07 15:49 ferg Resolution open => no change required
11-07-07 15:49 ferg Description Updated


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
30 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker