← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1333: Minor fix

 

------------------------------------------------------------
revno: 1333
committer: Lars Helge Oeverland <larshelge@xxxxxxxxx>
branch nick: trunk
timestamp: Mon 2010-01-25 13:38:53 +0100
message:
  Minor fix
modified:
  dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/datamerge/DefaultDataMergeService.java
  dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/datamerge/jdbc/JdbcDataMergeStore.java
  dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/duplicatedataelimination/EliminateDuplicateDataAction.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-administration/src/main/java/org/hisp/dhis/datamerge/DefaultDataMergeService.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/datamerge/DefaultDataMergeService.java	2009-12-25 18:41:08 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/datamerge/DefaultDataMergeService.java	2010-01-25 12:38:53 +0000
@@ -35,6 +35,7 @@
 import org.hisp.dhis.hierarchy.HierarchyViolationException;
 import org.hisp.dhis.organisationunit.OrganisationUnit;
 import org.hisp.dhis.organisationunit.OrganisationUnitService;
+import org.springframework.transaction.annotation.Transactional;
 
 /**
  * @author Lars Helge Overland
@@ -71,6 +72,7 @@
     // DataMergeService implementation
     // -------------------------------------------------------------------------
 
+    @Transactional
     public void mergeDataElements( DataElement destDataElement, DataElementCategoryOptionCombo destCategoryOptionCombo,
         DataElement sourceDataElemenet, DataElementCategoryOptionCombo sourceCategoryOptionCombo )
     {
@@ -94,6 +96,7 @@
         }
     }
 
+    @Transactional
     public void mergeOrganisationUnits( OrganisationUnit dest, OrganisationUnit source )
     {
         // ---------------------------------------------------------------------

=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/datamerge/jdbc/JdbcDataMergeStore.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/datamerge/jdbc/JdbcDataMergeStore.java	2010-01-21 23:27:33 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/datamerge/jdbc/JdbcDataMergeStore.java	2010-01-25 12:38:53 +0000
@@ -88,6 +88,8 @@
             "AND datavalue.dataelementid=" + destDataElementId + " AND datavalue.categoryoptioncomboid=" + destCategoryOptionComboId + " " +
             "AND d2.dataelementid=" + sourceDataElementId + " AND d2.categoryoptioncomboid=" + sourceCategoryOptionComboId + "; " +
     
+            "DELETE FROM datavalueaudit WHERE dataelementid=" + sourceDataElementId + " AND categoryoptioncomboid=" + sourceCategoryOptionComboId + ";" +
+        
             "DELETE FROM datavalue WHERE dataelementid=" + sourceDataElementId + " AND categoryoptioncomboid=" + sourceCategoryOptionComboId + ";";
 
         log.info( sql );
@@ -113,6 +115,8 @@
                 
             // TODO summarize when matching values exist
             
+            "DELETE FROM datavalueaudit WHERE sourceid=" + sourceId + ";" +
+                
             "DELETE FROM datavalue WHERE sourceid=" + sourceId + ";";
         
         log.info( sql );

=== modified file 'dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/duplicatedataelimination/EliminateDuplicateDataAction.java'
--- dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/duplicatedataelimination/EliminateDuplicateDataAction.java	2010-01-25 11:54:22 +0000
+++ dhis-2/dhis-web/dhis-web-maintenance/dhis-web-maintenance-dataadmin/src/main/java/org/hisp/dhis/dataadmin/action/duplicatedataelimination/EliminateDuplicateDataAction.java	2010-01-25 12:38:53 +0000
@@ -121,7 +121,7 @@
         
         if ( !( dataElementToEliminate == dataElementToKeep && categoryOptionComboEliminate == categoryOptionComboKeep ) )
         {
-            //dataMergeService.mergeDataElements( dataElementKeep, categoryOptionComboKeep, dataElementEliminate, categoryOptionComboEliminate );
+            dataMergeService.mergeDataElements( dataElementKeep, categoryOptionComboKeep, dataElementEliminate, categoryOptionComboEliminate );
         }
         
         log.info( "Elimination done" );