dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #18315
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 7673: Codestyle
------------------------------------------------------------
revno: 7673
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2012-07-23 14:56:20 +0200
message:
Codestyle
modified:
dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/dialect/StatementDialectFactoryBean.java
dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/H2StatementBuilder.java
dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/MySQLStatementBuilder.java
dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/PostgreSQLStatementBuilder.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-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/dialect/StatementDialectFactoryBean.java'
--- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/dialect/StatementDialectFactoryBean.java 2011-12-26 10:07:59 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/dialect/StatementDialectFactoryBean.java 2012-07-23 12:56:20 +0000
@@ -52,8 +52,6 @@
dialectMap.put( "org.hibernate.dialect.PostgreSQLDialect", StatementDialect.POSTGRESQL );
dialectMap.put( "org.hibernate.dialect.H2Dialect", StatementDialect.H2 );
dialectMap.put( "org.hisp.dhis.dialect.H2Dialect", StatementDialect.H2 );
- dialectMap.put( "org.hibernate.dialect.DerbyDialect", StatementDialect.DERBY );
- dialectMap.put( "org.hisp.dhis.dialect.IdentityDerbyDialect", StatementDialect.DERBY );
}
// -------------------------------------------------------------------------
=== modified file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/H2StatementBuilder.java'
--- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/H2StatementBuilder.java 2012-07-10 07:16:10 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/H2StatementBuilder.java 2012-07-23 12:56:20 +0000
@@ -32,9 +32,9 @@
import java.util.List;
import org.hisp.dhis.period.Period;
+
/**
* @author Lars Helge Overland
- * @version $Id: H2StatementBuilder.java 5715 2008-09-17 14:05:28Z larshelg $
*/
public class H2StatementBuilder
extends AbstractStatementBuilder
@@ -73,9 +73,9 @@
public String getMoveDataValueToDestination( int sourceId, int destinationId )
{
return "UPDATE datavalue AS d1 SET sourceid=" + destinationId + " " + "WHERE sourceid=" + sourceId + " "
- + "AND NOT EXISTS ( " + "SELECT * from datavalue AS d2 " + "WHERE d2.sourceid=" + destinationId + " "
- + "AND d1.dataelementid=d2.dataelementid " + "AND d1.periodid=d2.periodid "
- + "AND d1.categoryoptioncomboid=d2.categoryoptioncomboid );";
+ + "AND NOT EXISTS ( " + "SELECT * from datavalue AS d2 " + "WHERE d2.sourceid=" + destinationId + " "
+ + "AND d1.dataelementid=d2.dataelementid " + "AND d1.periodid=d2.periodid "
+ + "AND d1.categoryoptioncomboid=d2.categoryoptioncomboid );";
}
@Override
@@ -89,7 +89,6 @@
+ "AND d1.dataelementid=de.dataelementid " + "AND de.valuetype='int';";
}
-
@Override
public String getUpdateDestination( int destDataElementId, int destCategoryOptionComboId,
int sourceDataElementId, int sourceCategoryOptionComboId )
@@ -100,7 +99,6 @@
+ "SELECT * FROM datavalue AS d2 " + "WHERE d2.dataelementid=" + destDataElementId + " "
+ "AND d2.categoryoptioncomboid=" + destCategoryOptionComboId + " " + "AND d1.periodid=d2.periodid "
+ "AND d1.sourceid=d2.sourceid );";
-
}
@Override
@@ -115,8 +113,7 @@
+ "AND datavalue.dataelementid="
+ destDataElementId
+ " AND datavalue.categoryoptioncomboid="
- + destCategoryOptionComboId
- + " "
+ + destCategoryOptionComboId + " "
+ "AND d2.dataelementid="
+ sourceDataElementId + " AND d2.categoryoptioncomboid=" + sourceCategoryOptionComboId + ";";
}
@@ -124,17 +121,17 @@
public String getStandardDeviation( int dataElementId, int categoryOptionComboId, int organisationUnitId ){
return "SELECT STDDEV( CAST( value AS " + getDoubleColumnType() + " ) ) FROM datavalue " +
- "WHERE dataelementid='" + dataElementId + "' " +
- "AND categoryoptioncomboid='" + categoryOptionComboId + "' " +
- "AND sourceid='" + organisationUnitId + "'";
+ "WHERE dataelementid='" + dataElementId + "' " +
+ "AND categoryoptioncomboid='" + categoryOptionComboId + "' " +
+ "AND sourceid='" + organisationUnitId + "'";
}
public String getAverage( int dataElementId, int categoryOptionComboId, int organisationUnitId )
{
return "SELECT AVG( CAST( value AS " + getDoubleColumnType() + " ) ) FROM datavalue " +
- "WHERE dataelementid='" + dataElementId + "' " +
- "AND categoryoptioncomboid='" + categoryOptionComboId + "' " +
- "AND sourceid='" + organisationUnitId + "'";
+ "WHERE dataelementid='" + dataElementId + "' " +
+ "AND categoryoptioncomboid='" + categoryOptionComboId + "' " +
+ "AND sourceid='" + organisationUnitId + "'";
}
public String getDeflatedDataValues( int dataElementId, String dataElementName, int categoryOptionComboId,
@@ -226,56 +223,56 @@
public String archivePatientData ( String startDate, String endDate )
{
return "DELETE FROM patientdatavalue AS pdv "
- + "USING programstageinstance AS psi , programinstance AS pi "
- + "WHERE pdv.programstageinstanceid = psi.programstageinstanceid "
- + "AND pi.programinstanceid = psi.programinstanceid "
- + "WHERE pi.enddate >= '" + startDate + "' "
- + "AND pi.enddate <= '" + endDate + "';";
+ + "USING programstageinstance AS psi , programinstance AS pi "
+ + "WHERE pdv.programstageinstanceid = psi.programstageinstanceid "
+ + "AND pi.programinstanceid = psi.programinstanceid "
+ + "WHERE pi.enddate >= '" + startDate + "' "
+ + "AND pi.enddate <= '" + endDate + "';";
}
public String unArchivePatientData ( String startDate, String endDate )
{
return "DELETE FROM patientdatavaluearchive AS pdv "
- + "USING programstageinstance AS psi , programinstance AS pi "
- + "WHERE pdv.programstageinstanceid = psi.programstageinstanceid "
- + "AND pi.programinstanceid = psi.programinstanceid "
- + "WHERE pi.enddate >= '" + startDate + "' "
- + "AND pi.enddate <= '" + endDate + "';";
+ + "USING programstageinstance AS psi , programinstance AS pi "
+ + "WHERE pdv.programstageinstanceid = psi.programstageinstanceid "
+ + "AND pi.programinstanceid = psi.programinstanceid "
+ + "WHERE pi.enddate >= '" + startDate + "' "
+ + "AND pi.enddate <= '" + endDate + "';";
}
public String deleteRegularOverlappingPatientData()
{
return "DELETE FROM patientdatavalue AS d " +
- "USING patientdatavaluearchive AS a " +
- "WHERE d.programstageinstanceid=a.programstageinstanceid " +
- "AND d.dataelementid=a.dataelementid " +
- "AND d.timestamp<a.timestamp;";
+ "USING patientdatavaluearchive AS a " +
+ "WHERE d.programstageinstanceid=a.programstageinstanceid " +
+ "AND d.dataelementid=a.dataelementid " +
+ "AND d.timestamp<a.timestamp;";
}
public String deleteArchivedOverlappingPatientData()
{
return "DELETE FROM patientdatavaluearchive AS a " +
- "USING patientdatavalue AS d " +
- "WHERE d.programstageinstanceid=a.programstageinstanceid " +
- "AND d.dataelementid=a.dataelementid ";
+ "USING patientdatavalue AS d " +
+ "WHERE d.programstageinstanceid=a.programstageinstanceid " +
+ "AND d.dataelementid=a.dataelementid ";
}
public String deleteOldestOverlappingPatientDataValue()
{
return "DELETE FROM patientdatavalue AS d " +
- "USING patientdatavaluearchive AS a " +
- "WHERE d.programstageinstanceid=a.programstageinstanceid " +
- "AND d.dataelementid=a.dataelementid " +
- "AND d.timestamp<a.timestamp;";
+ "USING patientdatavaluearchive AS a " +
+ "WHERE d.programstageinstanceid=a.programstageinstanceid " +
+ "AND d.dataelementid=a.dataelementid " +
+ "AND d.timestamp<a.timestamp;";
}
public String deleteOldestOverlappingPatientArchiveData()
{
return "DELETE FROM patientdatavalue AS d " +
- "USING patientdatavaluearchive AS a " +
- "WHERE d.programstageinstanceid=a.programstageinstanceid " +
- "AND d.dataelementid=a.dataelementid " +
- "AND a.timestamp<=d.timestamp;";
+ "USING patientdatavaluearchive AS a " +
+ "WHERE d.programstageinstanceid=a.programstageinstanceid " +
+ "AND d.dataelementid=a.dataelementid " +
+ "AND a.timestamp<=d.timestamp;";
}
public String queryDataElementStructureForOrgUnit()
@@ -295,6 +292,7 @@
StringBuffer sqlsb = new StringBuffer();
int i = 0;
+
for ( Integer periodId : betweenPeriodIds )
{
i++;
@@ -310,6 +308,7 @@
sqlsb.append( i == betweenPeriodIds.size() ? "ORDER BY ColumnHeader,dataelement" : " UNION " );
}
+
return sqlsb.toString();
}
=== modified file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/MySQLStatementBuilder.java'
--- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/MySQLStatementBuilder.java 2012-07-10 07:16:10 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/MySQLStatementBuilder.java 2012-07-23 12:56:20 +0000
@@ -35,7 +35,6 @@
/**
* @author Lars Helge Overland
- * @version $Id: MySQLStatementBuilder.java 5715 2008-09-17 14:05:28Z larshelg $
*/
public class MySQLStatementBuilder
extends AbstractStatementBuilder
@@ -129,21 +128,20 @@
return "SELECT STDDEV( value ) FROM datavalue " +
"WHERE dataelementid='" + dataElementId + "' " +
"AND categoryoptioncomboid='" + categoryOptionComboId + "' " +
- "AND sourceid='" + organisationUnitId + "'";
-
+ "AND sourceid='" + organisationUnitId + "'";
}
public String getAverage( int dataElementId, int categoryOptionComboId, int organisationUnitId ){
- return "SELECT AVG( value ) FROM datavalue " +
+ return "SELECT AVG( value ) FROM datavalue " +
"WHERE dataelementid='" + dataElementId + "' " +
"AND categoryoptioncomboid='" + categoryOptionComboId + "' " +
"AND sourceid='" + organisationUnitId + "'";
}
public String getDeflatedDataValues( int dataElementId, String dataElementName, int categoryOptionComboId,
- String periodIds, int organisationUnitId, String organisationUnitName, int lowerBound, int upperBound ){
-
- return "SELECT dv.dataelementid, dv.periodid, dv.sourceid, dv.categoryoptioncomboid, dv.value, dv.storedby, dv.lastupdated, " +
+ String periodIds, int organisationUnitId, String organisationUnitName, int lowerBound, int upperBound )
+ {
+ return "SELECT dv.dataelementid, dv.periodid, dv.sourceid, dv.categoryoptioncomboid, dv.value, dv.storedby, dv.lastupdated, " +
"dv.comment, dv.followup, '" + lowerBound + "' AS minvalue, '" + upperBound + "' AS maxvalue, " +
encode( dataElementName ) + " AS dataelementname, pt.name AS periodtypename, pe.startdate, pe.enddate, " +
encode( organisationUnitName ) + " AS sourcename, cc.categoryoptioncomboname " +
@@ -162,10 +160,10 @@
public String archiveData( String startDate, String endDate )
{
return "DELETE d FROM datavalue AS d " +
- "INNER JOIN period as p " +
- "WHERE d.periodid=p.periodid " +
- "AND p.startdate>='" + startDate + "' " +
- "AND p.enddate<='" + endDate + "'";
+ "INNER JOIN period as p " +
+ "WHERE d.periodid=p.periodid " +
+ "AND p.startdate>='" + startDate + "' " +
+ "AND p.enddate<='" + endDate + "'";
}
public String unArchiveData( String startDate, String endDate )
@@ -185,7 +183,6 @@
"AND d.periodid=a.periodid " +
"AND d.sourceid=a.sourceid " +
"AND d.categoryoptioncomboid=a.categoryoptioncomboid";
-
}
public String deleteArchivedOverlappingData()
@@ -292,6 +289,7 @@
StringBuffer sqlsb = new StringBuffer();
int i = 0;
+
for ( Integer periodId : betweenPeriodIds )
{
i++;
@@ -307,6 +305,7 @@
sqlsb.append( i == betweenPeriodIds.size() ? "ORDER BY ColumnHeader,dataelement" : " UNION " );
}
+
return sqlsb.toString();
}
=== modified file 'dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/PostgreSQLStatementBuilder.java'
--- dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/PostgreSQLStatementBuilder.java 2012-07-10 07:16:10 +0000
+++ dhis-2/dhis-support/dhis-support-jdbc/src/main/java/org/hisp/dhis/jdbc/statementbuilder/PostgreSQLStatementBuilder.java 2012-07-23 12:56:20 +0000
@@ -35,7 +35,6 @@
/**
* @author Lars Helge Overland
- * @version $Id: PostgreSQLStatementBuilder.java 5715 2008-09-17 14:05:28Z larshelg $
*/
public class PostgreSQLStatementBuilder
extends AbstractStatementBuilder
@@ -117,8 +116,7 @@
+ "AND datavalue.dataelementid="
+ destDataElementId
+ " AND datavalue.categoryoptioncomboid="
- + destCategoryOptionComboId
- + " "
+ + destCategoryOptionComboId + " "
+ "AND d2.dataelementid="
+ sourceDataElementId + " AND d2.categoryoptioncomboid=" + sourceCategoryOptionComboId + ";";
}
@@ -126,36 +124,36 @@
public String getStandardDeviation( int dataElementId, int categoryOptionComboId, int organisationUnitId )
{
return "SELECT STDDEV( CAST( value AS " + getDoubleColumnType() + " ) ) FROM datavalue " +
- "WHERE dataelementid='" + dataElementId + "' " +
- "AND categoryoptioncomboid='" + categoryOptionComboId + "' " +
- "AND sourceid='" + organisationUnitId + "'";
+ "WHERE dataelementid='" + dataElementId + "' " +
+ "AND categoryoptioncomboid='" + categoryOptionComboId + "' " +
+ "AND sourceid='" + organisationUnitId + "'";
}
public String getAverage( int dataElementId, int categoryOptionComboId, int organisationUnitId )
{
return "SELECT AVG( CAST( value AS " + getDoubleColumnType() + " ) ) FROM datavalue " +
- "WHERE dataelementid='" + dataElementId + "' " +
- "AND categoryoptioncomboid='" + categoryOptionComboId + "' " +
- "AND sourceid='" + organisationUnitId + "'";
+ "WHERE dataelementid='" + dataElementId + "' " +
+ "AND categoryoptioncomboid='" + categoryOptionComboId + "' " +
+ "AND sourceid='" + organisationUnitId + "'";
}
public String getDeflatedDataValues( int dataElementId, String dataElementName, int categoryOptionComboId,
String periodIds, int organisationUnitId, String organisationUnitName, int lowerBound, int upperBound )
{
return "SELECT dv.dataelementid, dv.periodid, dv.sourceid, dv.categoryoptioncomboid, dv.value, dv.storedby, dv.lastupdated, " +
- "dv.comment, dv.followup, '" + lowerBound + "' AS minvalue, '" + upperBound + "' AS maxvalue, " +
- encode( dataElementName ) + " AS dataelementname, pt.name AS periodtypename, pe.startdate, pe.enddate, " +
- encode( organisationUnitName ) + " AS sourcename, cc.categoryoptioncomboname " +
- "FROM datavalue AS dv " +
- "JOIN period AS pe USING (periodid) " +
- "JOIN periodtype AS pt USING (periodtypeid) " +
- "LEFT JOIN _categoryoptioncomboname AS cc USING (categoryoptioncomboid) " +
- "WHERE dv.dataelementid='" + dataElementId + "' " +
- "AND dv.categoryoptioncomboid='" + categoryOptionComboId + "' " +
- "AND dv.periodid IN (" + periodIds + ") " +
- "AND dv.sourceid='" + organisationUnitId + "' " +
- "AND ( CAST( dv.value AS " + getDoubleColumnType() + " ) < '" + lowerBound + "' " +
- "OR CAST( dv.value AS " + getDoubleColumnType() + " ) > '" + upperBound + "' )";
+ "dv.comment, dv.followup, '" + lowerBound + "' AS minvalue, '" + upperBound + "' AS maxvalue, " +
+ encode( dataElementName ) + " AS dataelementname, pt.name AS periodtypename, pe.startdate, pe.enddate, " +
+ encode( organisationUnitName ) + " AS sourcename, cc.categoryoptioncomboname " +
+ "FROM datavalue AS dv " +
+ "JOIN period AS pe USING (periodid) " +
+ "JOIN periodtype AS pt USING (periodtypeid) " +
+ "LEFT JOIN _categoryoptioncomboname AS cc USING (categoryoptioncomboid) " +
+ "WHERE dv.dataelementid='" + dataElementId + "' " +
+ "AND dv.categoryoptioncomboid='" + categoryOptionComboId + "' " +
+ "AND dv.periodid IN (" + periodIds + ") " +
+ "AND dv.sourceid='" + organisationUnitId + "' " +
+ "AND ( CAST( dv.value AS " + getDoubleColumnType() + " ) < '" + lowerBound + "' " +
+ "OR CAST( dv.value AS " + getDoubleColumnType() + " ) > '" + upperBound + "' )";
}
public String archiveData( String startDate, String endDate )
@@ -222,67 +220,66 @@
public String archivePatientData ( String startDate, String endDate )
{
return "DELETE FROM patientdatavalue AS pdv "
- + "USING programstageinstance AS psi , programinstance AS pi "
- + "WHERE pdv.programstageinstanceid = psi.programstageinstanceid "
- + "AND pi.programinstanceid = psi.programinstanceid "
- + "AND pi.enddate >= '" + startDate + "' "
- + "AND pi.enddate <= '" + endDate + "';";
+ + "USING programstageinstance AS psi , programinstance AS pi "
+ + "WHERE pdv.programstageinstanceid = psi.programstageinstanceid "
+ + "AND pi.programinstanceid = psi.programinstanceid "
+ + "AND pi.enddate >= '" + startDate + "' "
+ + "AND pi.enddate <= '" + endDate + "';";
}
public String unArchivePatientData ( String startDate, String endDate )
{
return "DELETE FROM patientdatavaluearchive AS pdv "
- + "USING programstageinstance AS psi , programinstance AS pi "
- + "WHERE pdv.programstageinstanceid = psi.programstageinstanceid "
- + "AND pi.programinstanceid = psi.programinstanceid "
- + "AND pi.enddate >= '" + startDate + "' "
- + "AND pi.enddate <= '" + endDate + "';";
+ + "USING programstageinstance AS psi , programinstance AS pi "
+ + "WHERE pdv.programstageinstanceid = psi.programstageinstanceid "
+ + "AND pi.programinstanceid = psi.programinstanceid "
+ + "AND pi.enddate >= '" + startDate + "' "
+ + "AND pi.enddate <= '" + endDate + "';";
}
public String deleteRegularOverlappingPatientData()
{
return "DELETE FROM patientdatavalue AS d " +
- "USING patientdatavaluearchive AS a " +
- "WHERE d.programstageinstanceid=a.programstageinstanceid " +
- "AND d.dataelementid=a.dataelementid; ";
+ "USING patientdatavaluearchive AS a " +
+ "WHERE d.programstageinstanceid=a.programstageinstanceid " +
+ "AND d.dataelementid=a.dataelementid; ";
}
public String deleteArchivedOverlappingPatientData()
{
return "DELETE FROM patientdatavaluearchive AS a " +
- "USING patientdatavalue AS d " +
- "WHERE d.programstageinstanceid=a.programstageinstanceid " +
- "AND d.dataelementid=a.dataelementid ";
+ "USING patientdatavalue AS d " +
+ "WHERE d.programstageinstanceid=a.programstageinstanceid " +
+ "AND d.dataelementid=a.dataelementid ";
}
public String deleteOldestOverlappingPatientDataValue()
{
return "DELETE FROM patientdatavalue AS d " +
- "USING patientdatavaluearchive AS a " +
- "WHERE d.programstageinstanceid=a.programstageinstanceid " +
- "AND d.dataelementid=a.dataelementid " +
- "AND d.timestamp<a.timestamp;";
+ "USING patientdatavaluearchive AS a " +
+ "WHERE d.programstageinstanceid=a.programstageinstanceid " +
+ "AND d.dataelementid=a.dataelementid " +
+ "AND d.timestamp<a.timestamp;";
}
public String deleteOldestOverlappingPatientArchiveData()
{
return "DELETE FROM patientdatavalue AS d " +
- "USING patientdatavaluearchive AS a " +
- "WHERE d.programstageinstanceid=a.programstageinstanceid " +
- "AND d.dataelementid=a.dataelementid " +
- "AND a.timestamp<=d.timestamp;";
+ "USING patientdatavaluearchive AS a " +
+ "WHERE d.programstageinstanceid=a.programstageinstanceid " +
+ "AND d.dataelementid=a.dataelementid " +
+ "AND a.timestamp<=d.timestamp;";
}
public String queryDataElementStructureForOrgUnit()
{
- StringBuffer sqlsb = new StringBuffer();
- sqlsb.append( "(SELECT DISTINCT de.dataelementid, (de.name || ' ' || cc.categoryoptioncomboname) AS DataElement " );
- sqlsb.append( "FROM dataelement AS de " );
- sqlsb.append( "INNER JOIN categorycombos_optioncombos cat_opts on de.categorycomboid = cat_opts.categorycomboid ");
- sqlsb.append( "INNER JOIN _categoryoptioncomboname cc on cat_opts.categoryoptioncomboid = cc.categoryoptioncomboid ");
- sqlsb.append( "ORDER BY DataElement) " );
- return sqlsb.toString();
-
+ StringBuffer sqlsb = new StringBuffer();
+ sqlsb.append( "(SELECT DISTINCT de.dataelementid, (de.name || ' ' || cc.categoryoptioncomboname) AS DataElement " );
+ sqlsb.append( "FROM dataelement AS de " );
+ sqlsb.append( "INNER JOIN categorycombos_optioncombos cat_opts on de.categorycomboid = cat_opts.categorycomboid ");
+ sqlsb.append( "INNER JOIN _categoryoptioncomboname cc on cat_opts.categoryoptioncomboid = cc.categoryoptioncomboid ");
+ sqlsb.append( "ORDER BY DataElement) " );
+ return sqlsb.toString();
}
public String queryRawDataElementsForOrgUnitBetweenPeriods(Integer orgUnitId, List<Integer> betweenPeriodIds)
@@ -290,6 +287,7 @@
StringBuffer sqlsb = new StringBuffer();
int i = 0;
+
for ( Integer periodId : betweenPeriodIds )
{
i++;
@@ -305,6 +303,7 @@
sqlsb.append( i == betweenPeriodIds.size() ? "ORDER BY ColumnHeader,dataelement" : " UNION " );
}
+
return sqlsb.toString();
}