← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10667: Using uids instead of ids in _categorystructure resource table to make it consistent with other r...

 

------------------------------------------------------------
revno: 10667
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2013-04-22 19:04:51 +0200
message:
  Using uids instead of ids in _categorystructure resource table to make it consistent with other resource tables
modified:
  dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/DefaultResourceTableService.java
  dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateCategoryTableStatement.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/resourcetable/DefaultResourceTableService.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/DefaultResourceTableService.java	2013-03-19 19:15:12 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/DefaultResourceTableService.java	2013-04-22 17:04:51 +0000
@@ -432,7 +432,7 @@
                 DataElementCategoryOption categoryOption = category.getCategoryOption( categoryOptionCombo );
                 
                 values.add( categoryOption != null ? categoryOption.getName() : null );
-                values.add( categoryOption != null ? categoryOption.getId() : null );
+                values.add( categoryOption != null ? categoryOption.getUid() : null );
             }
             
             batchArgs.add( values.toArray() );

=== modified file 'dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateCategoryTableStatement.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateCategoryTableStatement.java	2012-11-12 16:42:09 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/resourcetable/statement/CreateCategoryTableStatement.java	2013-04-22 17:04:51 +0000
@@ -63,7 +63,7 @@
         for ( DataElementCategory category : categories )
         {
             statement += CodecUtils.databaseEncode( category.getName() ) + SPACE + LONG_TEXT_COLUMN_TYPE + SEPARATOR;
-            statement += "cat_" + category.getId() + SPACE + "INTEGER" + SEPARATOR;
+            statement += category.getUid() + SPACE + "CHARACTER(11)" + SEPARATOR;
         }
 
         statement += "PRIMARY KEY ( categoryoptioncomboid ) )";