← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1984: Minor fixed

 

------------------------------------------------------------
revno: 1984
committer: Lars <larshelg@larshelg-laptop>
branch nick: trunk
timestamp: Thu 2010-06-10 14:03:16 +0200
message:
  Minor fixed
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementOperand.java
  dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/crosstab/DefaultCrossTabService.java
  dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/crosstab/jdbc/CrossTabStore.java
  dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/crosstab/jdbc/JDBCCrossTabStore.java
  dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/jdbc/JdbcDataMartStore.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-api/src/main/java/org/hisp/dhis/dataelement/DataElementOperand.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementOperand.java	2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElementOperand.java	2010-06-10 12:03:16 +0000
@@ -41,10 +41,11 @@
 public class DataElementOperand
     implements Serializable, Comparable<DataElementOperand>
 {
-    public static final String SEPARATOR = ".";
-    
+    public static final String SEPARATOR = ".";    
     private static final String SPACE = "";
-
+    private static final String COLUMN_PREFIX = "de";
+    private static final String COLUMN_SEPARATOR = "_";
+    
     private int id;
     
     private DataElement dataElement;
@@ -181,6 +182,11 @@
     {
         return dataElement.getId() + SEPARATOR + categoryOptionCombo.getId();
     }
+    
+    public String getSimpleName()
+    {
+        return COLUMN_PREFIX + dataElementId + COLUMN_SEPARATOR + optionComboId;
+    }
 
     // -------------------------------------------------------------------------
     // Getters & setters

=== modified file 'dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/crosstab/DefaultCrossTabService.java'
--- dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/crosstab/DefaultCrossTabService.java	2010-05-18 19:22:26 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/crosstab/DefaultCrossTabService.java	2010-06-10 12:03:16 +0000
@@ -189,7 +189,7 @@
         
         for ( DataElementOperand operand : operands )
         {
-            final String key = CrossTabStore.COLUMN_PREFIX + operand.getDataElementId() + CrossTabStore.SEPARATOR + operand.getOptionComboId();
+            final String key = operand.getSimpleName();
             
             if ( columnNameIndexMap.containsKey( key ) )
             {

=== modified file 'dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/crosstab/jdbc/CrossTabStore.java'
--- dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/crosstab/jdbc/CrossTabStore.java	2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/crosstab/jdbc/CrossTabStore.java	2010-06-10 12:03:16 +0000
@@ -40,8 +40,6 @@
 public interface CrossTabStore
 {
     String ID = CrossTabStore.class.getName();
-    String COLUMN_PREFIX = "de";
-    String SEPARATOR = "_";
     
     void createCrossTabTable( List<DataElementOperand> operands );
 

=== modified file 'dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/crosstab/jdbc/JDBCCrossTabStore.java'
--- dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/crosstab/jdbc/JDBCCrossTabStore.java	2010-05-18 19:22:26 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/crosstab/jdbc/JDBCCrossTabStore.java	2010-06-10 12:03:16 +0000
@@ -74,8 +74,7 @@
             
             for ( DataElementOperand operand : operands )
             {
-                sql.append( COLUMN_PREFIX ).append( operand.getDataElementId() ).append(
-                    SEPARATOR ).append( operand.getOptionComboId() ).append( " VARCHAR(30), " );
+                sql.append( operand.getSimpleName() ).append( " VARCHAR(30), " );
             }
             
             sql.append( "PRIMARY KEY ( periodid, sourceid ) );" );
@@ -195,7 +194,7 @@
             
             for ( final DataElementOperand operand : operands )
             {
-                buffer.append( COLUMN_PREFIX ).append( operand.getDataElementId() ).append( SEPARATOR ).append( operand.getOptionComboId() ).append( ", " );
+                buffer.append( operand.getSimpleName() ).append( ", " );
             }
             
             if ( buffer.length() > 1 )

=== modified file 'dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/jdbc/JdbcDataMartStore.java'
--- dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/jdbc/JdbcDataMartStore.java	2010-05-27 15:24:59 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/jdbc/JdbcDataMartStore.java	2010-06-10 12:03:16 +0000
@@ -550,7 +550,7 @@
             holder.close();
         }
     }
-
+    
     // -------------------------------------------------------------------------
     // Period
     // -------------------------------------------------------------------------