dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #24018
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 11721: Analytics table generation, removed unnecessary method
------------------------------------------------------------
revno: 11721
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2013-08-21 01:17:09 +0200
message:
Analytics table generation, removed unnecessary method
modified:
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/AnalyticsTableManager.java
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/AbstractJdbcTableManager.java
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/DefaultAnalyticsTableService.java
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcAnalyticsTableManager.java
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcCompletenessTableManager.java
dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcCompletenessTargetTableManager.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-analytics/src/main/java/org/hisp/dhis/analytics/AnalyticsTableManager.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/AnalyticsTableManager.java 2013-08-20 22:48:23 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/AnalyticsTableManager.java 2013-08-20 23:17:09 +0000
@@ -115,14 +115,9 @@
* 1 = database column data type
* 2 = column alias and name
*/
- List<String[]> getDimensionColumns();
+ List<String[]> getDimensionColumns( AnalyticsTable table );
/**
- * Returns a list of database column names.
- */
- List<String> getDimensionColumnNames();
-
- /**
* Retrieves the start date of the period of the earliest data value row.
*/
Date getEarliestData();
=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/AbstractJdbcTableManager.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/AbstractJdbcTableManager.java 2013-08-20 22:48:23 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/AbstractJdbcTableManager.java 2013-08-20 23:17:09 +0000
@@ -154,20 +154,6 @@
executeSilently( sqlAlter );
}
- public List<String> getDimensionColumnNames()
- {
- List<String[]> columns = getDimensionColumns();
-
- List<String> columnNames = new ArrayList<String>();
-
- for ( String[] column : columns )
- {
- columnNames.add( column[0] );
- }
-
- return columnNames;
- }
-
public boolean pruneTable( AnalyticsTable table )
{
String tableName = table.getTempTableName();
=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/DefaultAnalyticsTableService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/DefaultAnalyticsTableService.java 2013-08-20 22:48:23 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/DefaultAnalyticsTableService.java 2013-08-20 23:17:09 +0000
@@ -216,13 +216,13 @@
{
ConcurrentLinkedQueue<AnalyticsIndex> indexes = new ConcurrentLinkedQueue<AnalyticsIndex>();
- List<String> columns = tableManager.getDimensionColumnNames();
-
for ( AnalyticsTable table : tables )
{
- for ( String column : columns )
+ List<String[]> columns = tableManager.getDimensionColumns( table );
+
+ for ( String[] column : columns )
{
- indexes.add( new AnalyticsIndex( table.getTempTableName(), column ) );
+ indexes.add( new AnalyticsIndex( table.getTempTableName(), column[0] ) );
}
}
=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcAnalyticsTableManager.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcAnalyticsTableManager.java 2013-08-20 22:48:23 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcAnalyticsTableManager.java 2013-08-20 23:17:09 +0000
@@ -93,7 +93,7 @@
String sqlCreate = "create table " + tableName + " (";
- for ( String[] col : getDimensionColumns() )
+ for ( String[] col : getDimensionColumns( table ) )
{
sqlCreate += col[0] + " " + col[1] + ",";
}
@@ -140,14 +140,14 @@
String sql = "insert into " + table.getTempTableName() + " (";
- for ( String[] col : getDimensionColumns() )
+ for ( String[] col : getDimensionColumns( table ) )
{
sql += col[0] + ",";
}
sql += "daysxvalue, daysno, value) select ";
- for ( String[] col : getDimensionColumns() )
+ for ( String[] col : getDimensionColumns( table ) )
{
sql += col[2] + ",";
}
@@ -177,7 +177,7 @@
jdbcTemplate.execute( sql );
}
- public List<String[]> getDimensionColumns()
+ public List<String[]> getDimensionColumns( AnalyticsTable table )
{
List<String[]> columns = new ArrayList<String[]>();
=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcCompletenessTableManager.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcCompletenessTableManager.java 2013-08-20 22:48:23 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcCompletenessTableManager.java 2013-08-20 23:17:09 +0000
@@ -67,7 +67,7 @@
String sqlCreate = "create table " + tableName + " (";
- for ( String[] col : getDimensionColumns() )
+ for ( String[] col : getDimensionColumns( table ) )
{
sqlCreate += col[0] + " " + col[1] + ",";
}
@@ -96,7 +96,7 @@
String insert = "insert into " + table.getTempTableName() + " (";
- for ( String[] col : getDimensionColumns() )
+ for ( String[] col : getDimensionColumns( table ) )
{
insert += col[0] + ",";
}
@@ -105,7 +105,7 @@
String select = "select ";
- for ( String[] col : getDimensionColumns() )
+ for ( String[] col : getDimensionColumns( table ) )
{
select += col[2] + ",";
}
@@ -134,7 +134,7 @@
return null;
}
- public List<String[]> getDimensionColumns()
+ public List<String[]> getDimensionColumns( AnalyticsTable table )
{
List<String[]> columns = new ArrayList<String[]>();
=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcCompletenessTargetTableManager.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcCompletenessTargetTableManager.java 2013-08-20 22:48:23 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/table/JdbcCompletenessTargetTableManager.java 2013-08-20 23:17:09 +0000
@@ -73,7 +73,7 @@
String sqlCreate = "create table " + tableName + " (";
- for ( String[] col : getDimensionColumns() )
+ for ( String[] col : getDimensionColumns( table ) )
{
sqlCreate += col[0] + " " + col[1] + ",";
}
@@ -99,14 +99,14 @@
String sql = "insert into " + table.getTempTableName() + " (";
- for ( String[] col : getDimensionColumns() )
+ for ( String[] col : getDimensionColumns( table ) )
{
sql += col[0] + ",";
}
sql += "value) select ";
- for ( String[] col : getDimensionColumns() )
+ for ( String[] col : getDimensionColumns( table ) )
{
sql += col[2] + ",";
}
@@ -126,7 +126,7 @@
return null;
}
- public List<String[]> getDimensionColumns()
+ public List<String[]> getDimensionColumns( AnalyticsTable table )
{
List<String[]> columns = new ArrayList<String[]>();