dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #31207
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15885: Code style
------------------------------------------------------------
revno: 15885
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-06-27 16:15:51 +0200
message:
Code style
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValue.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/hibernate/HibernateDataValueStore.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/datavalue/DataValue.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValue.java 2014-06-27 13:15:43 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DataValue.java 2014-06-27 14:15:51 +0000
@@ -69,7 +69,7 @@
private String storedBy;
- private Date timestamp; // TODO rename to created
+ private Date timestamp; // TODO rename to lastUpated
private String comment;
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/hibernate/HibernateDataValueStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/hibernate/HibernateDataValueStore.java 2014-05-27 02:41:16 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/datavalue/hibernate/HibernateDataValueStore.java 2014-06-27 14:15:51 +0000
@@ -477,36 +477,31 @@
}
String joinCo = coDimensionConstraints == null && cogDimensionConstraints == null ? "" :
- "join categoryoptioncombos_categoryoptions c_c on dv.attributeoptioncomboid = c_c.categoryoptioncomboid ";
+ "join categoryoptioncombos_categoryoptions c_c on dv.attributeoptioncomboid = c_c.categoryoptioncomboid ";
String joinCog = cogDimensionConstraints == null ? "" :
- "join categoryoptiongroupmembers cogm on c_c.categoryoptionid = cogm.categoryoptionid ";
+ "join categoryoptiongroupmembers cogm on c_c.categoryoptionid = cogm.categoryoptionid ";
String whereCo = coDimensionConstraints == null ? "" :
- "and c_c.categoryoptionid in (" + TextUtils.getCommaDelimitedString( ConversionUtils.getIdentifiers( DataElementCategoryOption.class, coDimensionConstraints ) ) + ") ";
+ "and c_c.categoryoptionid in (" + TextUtils.getCommaDelimitedString( ConversionUtils.getIdentifiers( DataElementCategoryOption.class, coDimensionConstraints ) ) + ") ";
String whereCog = cogDimensionConstraints == null ? "" :
- "and cogm.categoryoptiongroupid in (" + TextUtils.getCommaDelimitedString( ConversionUtils.getIdentifiers( CategoryOptionGroup.class, cogDimensionConstraints ) ) + ") ";
+ "and cogm.categoryoptiongroupid in (" + TextUtils.getCommaDelimitedString( ConversionUtils.getIdentifiers( CategoryOptionGroup.class, cogDimensionConstraints ) ) + ") ";
String whereCombo = attributeCombo == null ? "" :
- "and dv.attributeoptioncomboid = " + attributeCombo.getId() + " ";
+ "and dv.attributeoptioncomboid = " + attributeCombo.getId() + " ";
- String sql =
- "select de.uid, coc.uid, dv.attributeoptioncomboid, dv.value, dv.lastupdated, p.startdate, p.enddate " +
- "from datavalue dv " +
- "join dataelement de on dv.dataelementid = de.dataelementid " +
- "join categoryoptioncombo coc on dv.categoryoptioncomboid = coc.categoryoptioncomboid " +
- "join period p on p.periodid = dv.periodid " +
- joinCo +
- joinCog +
- "where dv.dataelementid in (" + TextUtils.getCommaDelimitedString( ConversionUtils.getIdentifiers( DataElement.class, dataElements ) ) + ") " +
- "and dv.sourceid = " + source.getId() + " " +
- "and p.startdate <= '" + DateUtils.getMediumDateString( date ) + "' " +
- "and p.enddate >= '" + DateUtils.getMediumDateString( date ) + "' " +
- "and p.periodtypeid in (" + TextUtils.getCommaDelimitedString( ConversionUtils.getIdentifiers( PeriodType.class, periodTypes ) ) + ") " +
- whereCo +
- whereCog +
- whereCombo;
+ String sql = "select de.uid, coc.uid, dv.attributeoptioncomboid, dv.value, dv.lastupdated, p.startdate, p.enddate " +
+ "from datavalue dv " +
+ "join dataelement de on dv.dataelementid = de.dataelementid " +
+ "join categoryoptioncombo coc on dv.categoryoptioncomboid = coc.categoryoptioncomboid " +
+ "join period p on p.periodid = dv.periodid " + joinCo + joinCog +
+ "where dv.dataelementid in (" + TextUtils.getCommaDelimitedString( ConversionUtils.getIdentifiers( DataElement.class, dataElements ) ) + ") " +
+ "and dv.sourceid = " + source.getId() + " " +
+ "and p.startdate <= '" + DateUtils.getMediumDateString( date ) + "' " +
+ "and p.enddate >= '" + DateUtils.getMediumDateString( date ) + "' " +
+ "and p.periodtypeid in (" + TextUtils.getCommaDelimitedString( ConversionUtils.getIdentifiers( PeriodType.class, periodTypes ) ) + ") " +
+ whereCo + whereCog + whereCombo;
SqlRowSet rowSet = jdbcTemplate.queryForRowSet( sql );