← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 3972: Added missing method in DataElementDeletionHandler

 

------------------------------------------------------------
revno: 3972
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2011-06-21 17:01:40 +0200
message:
  Added missing method in DataElementDeletionHandler
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DataElementDeletionHandler.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DataElementDeletionHandler.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DataElementDeletionHandler.java	2011-01-07 11:38:55 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataelement/DataElementDeletionHandler.java	2011-06-21 15:01:40 +0000
@@ -29,6 +29,7 @@
 
 import static org.hisp.dhis.dataelement.DataElementCategoryCombo.DEFAULT_CATEGORY_COMBO_NAME;
 
+import org.hisp.dhis.dataset.DataSet;
 import org.hisp.dhis.system.deletion.DeletionHandler;
 
 /**
@@ -83,4 +84,15 @@
         }
     }
 
+    @Override
+    public void deleteDataSet( DataSet dataSet )
+    {
+        for ( DataElement dataElement : dataElementService.getAllDataElements() )
+        {
+            if ( dataElement.getDataSets().remove( dataSet ) )
+            {
+                dataElementService.updateDataElement( dataElement );
+            }
+        }
+    }
 }