← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1436: Now using key+sortorder as unique columns for List association batchhandlers. Previously using ke...

 

------------------------------------------------------------
revno: 1436
committer: Lars Helge Oeverland <larshelge@xxxxxxxxx>
branch nick: trunk
timestamp: Tue 2010-02-16 16:04:35 +0100
message:
  Now using key+sortorder as unique columns for List association batchhandlers. Previously using key+many columns which is incorrect after switching from Set.
modified:
  dhis-2/dhis-services/dhis-service-importexport/src/test/java/org/hisp/dhis/importexport/importobject/ImportObjectServiceImportAllTest.java
  dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/CategoryCategoryOptionAssociationBatchHandler.java
  dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/CategoryComboCategoryAssociationBatchHandler.java
  dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementGroupSetMemberBatchHandler.java
  dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/IndicatorGroupSetMemberBatchHandler.java
  dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ReportTableDataElementBatchHandler.java
  dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ReportTableDataSetBatchHandler.java
  dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ReportTableIndicatorBatchHandler.java
  dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ReportTableOrganisationUnitBatchHandler.java
  dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ReportTablePeriodBatchHandler.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-importexport/src/test/java/org/hisp/dhis/importexport/importobject/ImportObjectServiceImportAllTest.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/test/java/org/hisp/dhis/importexport/importobject/ImportObjectServiceImportAllTest.java	2009-10-18 22:44:41 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/test/java/org/hisp/dhis/importexport/importobject/ImportObjectServiceImportAllTest.java	2010-02-16 15:04:35 +0000
@@ -317,10 +317,10 @@
         // Category - CategoryOption Association
         // ---------------------------------------------------------------------
 
-        categoryCategoryOptionAssociationA = new GroupMemberAssociation( 'A', 'A' );
-        categoryCategoryOptionAssociationB = new GroupMemberAssociation( 'A', 'B' );
-        categoryCategoryOptionAssociationC = new GroupMemberAssociation( 'B', 'C' );
-        categoryCategoryOptionAssociationD = new GroupMemberAssociation( 'B', 'D' );
+        categoryCategoryOptionAssociationA = new GroupMemberAssociation( 'A', 'A', 1 );
+        categoryCategoryOptionAssociationB = new GroupMemberAssociation( 'A', 'B', 2 );
+        categoryCategoryOptionAssociationC = new GroupMemberAssociation( 'B', 'C', 1 );
+        categoryCategoryOptionAssociationD = new GroupMemberAssociation( 'B', 'D', 2 );
         
         importObjectService.addImportObject( ImportObjectStatus.NEW, GroupMemberType.CATEGORY_CATEGORYOPTION, categoryCategoryOptionAssociationA );
         importObjectService.addImportObject( ImportObjectStatus.NEW, GroupMemberType.CATEGORY_CATEGORYOPTION, categoryCategoryOptionAssociationB );
@@ -354,9 +354,9 @@
         // CategoryCombo - Category Association
         // ---------------------------------------------------------------------
 
-        categoryComboCategoryAssociationA = new GroupMemberAssociation( 'A', 'A' );
-        categoryComboCategoryAssociationB = new GroupMemberAssociation( 'A', 'B' );
-        categoryComboCategoryAssociationC = new GroupMemberAssociation( 'B', 'A' );
+        categoryComboCategoryAssociationA = new GroupMemberAssociation( 'A', 'A', 1 );
+        categoryComboCategoryAssociationB = new GroupMemberAssociation( 'A', 'B', 2 );
+        categoryComboCategoryAssociationC = new GroupMemberAssociation( 'B', 'A', 1 );
         
         importObjectService.addImportObject( ImportObjectStatus.NEW, GroupMemberType.CATEGORYCOMBO_CATEGORY, categoryComboCategoryAssociationA );
         importObjectService.addImportObject( ImportObjectStatus.NEW, GroupMemberType.CATEGORYCOMBO_CATEGORY, categoryComboCategoryAssociationB );

=== modified file 'dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/CategoryCategoryOptionAssociationBatchHandler.java'
--- dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/CategoryCategoryOptionAssociationBatchHandler.java	2009-10-16 12:26:29 +0000
+++ dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/CategoryCategoryOptionAssociationBatchHandler.java	2010-02-16 15:04:35 +0000
@@ -59,13 +59,13 @@
     protected void setUniqueColumns()
     {
         statementBuilder.setUniqueColumn( "categoryid" );
-        statementBuilder.setUniqueColumn( "categoryoptionid" );
+        statementBuilder.setUniqueColumn( "sort_order" );
     }
     
     protected void setUniqueValues( GroupMemberAssociation association )
     {
         statementBuilder.setUniqueValue( association.getGroupId() );
-        statementBuilder.setUniqueValue( association.getMemberId() );
+        statementBuilder.setUniqueValue( association.getSortOrder() );
     }
     
     protected void setColumns()

=== modified file 'dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/CategoryComboCategoryAssociationBatchHandler.java'
--- dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/CategoryComboCategoryAssociationBatchHandler.java	2009-10-16 12:26:29 +0000
+++ dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/CategoryComboCategoryAssociationBatchHandler.java	2010-02-16 15:04:35 +0000
@@ -59,13 +59,13 @@
     protected void setUniqueColumns()
     {
         statementBuilder.setUniqueColumn( "categorycomboid" );
-        statementBuilder.setUniqueColumn( "categoryid" );
+        statementBuilder.setUniqueColumn( "sort_order" );
     }
     
     protected void setUniqueValues( GroupMemberAssociation association )
     {        
         statementBuilder.setUniqueValue( association.getGroupId() );
-        statementBuilder.setUniqueValue( association.getMemberId() );
+        statementBuilder.setUniqueValue( association.getSortOrder() );
     }
     
     protected void setColumns()

=== modified file 'dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementGroupSetMemberBatchHandler.java'
--- dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementGroupSetMemberBatchHandler.java	2009-11-02 09:20:10 +0000
+++ dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/DataElementGroupSetMemberBatchHandler.java	2010-02-16 15:04:35 +0000
@@ -59,13 +59,13 @@
     protected void setUniqueColumns()
     {
         statementBuilder.setUniqueColumn( "dataelementgroupsetid" );
-        statementBuilder.setUniqueColumn( "dataelementgroupid" );
+        statementBuilder.setUniqueColumn( "sort_order" );
     }
     
     protected void setUniqueValues( GroupMemberAssociation association )
     {        
         statementBuilder.setUniqueValue( association.getGroupId() );
-        statementBuilder.setUniqueValue( association.getMemberId() );
+        statementBuilder.setUniqueValue( association.getSortOrder() );
     }
     
     protected void setColumns()

=== modified file 'dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/IndicatorGroupSetMemberBatchHandler.java'
--- dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/IndicatorGroupSetMemberBatchHandler.java	2009-11-02 09:20:10 +0000
+++ dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/IndicatorGroupSetMemberBatchHandler.java	2010-02-16 15:04:35 +0000
@@ -59,13 +59,13 @@
     protected void setUniqueColumns()
     {
         statementBuilder.setUniqueColumn( "indicatorgroupsetid" );
-        statementBuilder.setUniqueColumn( "indicatorgroupid" );
+        statementBuilder.setUniqueColumn( "sort_order" );
     }
     
     protected void setUniqueValues( GroupMemberAssociation association )
     {        
         statementBuilder.setUniqueValue( association.getGroupId() );
-        statementBuilder.setUniqueValue( association.getMemberId() );
+        statementBuilder.setUniqueValue( association.getSortOrder() );
     }
     
     protected void setColumns()

=== modified file 'dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ReportTableDataElementBatchHandler.java'
--- dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ReportTableDataElementBatchHandler.java	2009-08-12 21:06:37 +0000
+++ dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ReportTableDataElementBatchHandler.java	2010-02-16 15:04:35 +0000
@@ -59,13 +59,13 @@
     protected void setUniqueColumns()
     {
         statementBuilder.setUniqueColumn( "reporttableid" );
-        statementBuilder.setUniqueColumn( "dataelementid" );
+        statementBuilder.setUniqueColumn( "sort_order" );
     }
     
     protected void setUniqueValues( GroupMemberAssociation association )
     {        
         statementBuilder.setUniqueValue( association.getGroupId() );
-        statementBuilder.setUniqueValue( association.getMemberId() );
+        statementBuilder.setUniqueValue( association.getSortOrder() );
     }
     
     protected void setColumns()

=== modified file 'dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ReportTableDataSetBatchHandler.java'
--- dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ReportTableDataSetBatchHandler.java	2009-08-13 11:13:39 +0000
+++ dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ReportTableDataSetBatchHandler.java	2010-02-16 15:04:35 +0000
@@ -59,13 +59,13 @@
     protected void setUniqueColumns()
     {
         statementBuilder.setUniqueColumn( "reporttableid" );
-        statementBuilder.setUniqueColumn( "datasetid" );
+        statementBuilder.setUniqueColumn( "sort_order" );
     }
     
     protected void setUniqueValues( GroupMemberAssociation association )
     {        
         statementBuilder.setUniqueValue( association.getGroupId() );
-        statementBuilder.setUniqueValue( association.getMemberId() );
+        statementBuilder.setUniqueValue( association.getSortOrder() );
     }
     
     protected void setColumns()

=== modified file 'dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ReportTableIndicatorBatchHandler.java'
--- dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ReportTableIndicatorBatchHandler.java	2009-08-12 21:06:37 +0000
+++ dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ReportTableIndicatorBatchHandler.java	2010-02-16 15:04:35 +0000
@@ -59,13 +59,13 @@
     protected void setUniqueColumns()
     {
         statementBuilder.setUniqueColumn( "reporttableid" );
-        statementBuilder.setUniqueColumn( "indicatorid" );
+        statementBuilder.setUniqueColumn( "sort_order" );
     }
     
     protected void setUniqueValues( GroupMemberAssociation association )
     {        
         statementBuilder.setUniqueValue( association.getGroupId() );
-        statementBuilder.setUniqueValue( association.getMemberId() );
+        statementBuilder.setUniqueValue( association.getSortOrder() );
     } 
     
     protected void setColumns()

=== modified file 'dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ReportTableOrganisationUnitBatchHandler.java'
--- dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ReportTableOrganisationUnitBatchHandler.java	2009-08-12 21:06:37 +0000
+++ dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ReportTableOrganisationUnitBatchHandler.java	2010-02-16 15:04:35 +0000
@@ -59,13 +59,13 @@
     protected void setUniqueColumns()
     {
         statementBuilder.setUniqueColumn( "reporttableid" );
-        statementBuilder.setUniqueColumn( "organisationunitid" );
+        statementBuilder.setUniqueColumn( "sort_order" );
     }
     
     protected void setUniqueValues( GroupMemberAssociation association )
     {        
         statementBuilder.setUniqueValue( association.getGroupId() );
-        statementBuilder.setUniqueValue( association.getMemberId() );
+        statementBuilder.setUniqueValue( association.getSortOrder() );
     }
     
     protected void setColumns()

=== modified file 'dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ReportTablePeriodBatchHandler.java'
--- dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ReportTablePeriodBatchHandler.java	2009-08-12 21:06:37 +0000
+++ dhis-2/dhis-services/dhis-service-jdbc/src/main/java/org/hisp/dhis/jdbc/batchhandler/ReportTablePeriodBatchHandler.java	2010-02-16 15:04:35 +0000
@@ -59,13 +59,13 @@
     protected void setUniqueColumns()
     {
         statementBuilder.setUniqueColumn( "reporttableid" );
-        statementBuilder.setUniqueColumn( "periodid" );
+        statementBuilder.setUniqueColumn( "sort_order" );
     }
     
     protected void setUniqueValues( GroupMemberAssociation association )
     {        
         statementBuilder.setUniqueValue( association.getGroupId() );
-        statementBuilder.setUniqueValue( association.getMemberId() );
+        statementBuilder.setUniqueValue( association.getSortOrder() );
     }  
     
     protected void setColumns()