dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #31272
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15920: Fixed: missing created field
------------------------------------------------------------
revno: 15920
committer: Halvdan Hoem Grelland <halvdanhg@xxxxxxxxx>
branch nick: dhis2
timestamp: Mon 2014-06-30 20:27:25 +0200
message:
Fixed: missing created field
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DeflatedDataValue.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataanalysis/jdbc/JdbcDataAnalysisStore.java
dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/datavalue/DataValueServiceTest.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/converter/DataValueConverter.java
dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/converter/DataValueDailyConverter.java
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/DeflatedDataValueNameMinMaxRowMapper.java
dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/DeflatedDataValueRowMapper.java
dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.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/DeflatedDataValue.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DeflatedDataValue.java 2014-06-27 16:27:09 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DeflatedDataValue.java 2014-06-30 18:27:25 +0000
@@ -59,6 +59,8 @@
private String storedBy;
+ private Date created;
+
private Date lastUpdated;
private String comment;
@@ -97,6 +99,7 @@
this.categoryOptionComboId = dataValue.getCategoryOptionCombo().getId();
this.value = dataValue.getValue();
this.storedBy = dataValue.getStoredBy();
+ this.created = dataValue.getCreated();
this.lastUpdated = dataValue.getLastUpdated();
this.comment = dataValue.getComment();
this.followup = dataValue.isFollowup();
@@ -166,6 +169,16 @@
this.storedBy = storedBy;
}
+ public Date getCreated()
+ {
+ return created;
+ }
+
+ public void setCreated( Date created )
+ {
+ this.created = created;
+ }
+
public Date getLastUpdated()
{
return lastUpdated;
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataanalysis/jdbc/JdbcDataAnalysisStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataanalysis/jdbc/JdbcDataAnalysisStore.java 2014-06-02 13:44:57 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/dataanalysis/jdbc/JdbcDataAnalysisStore.java 2014-06-30 18:27:25 +0000
@@ -171,7 +171,7 @@
String sql =
"select dv.dataelementid, dv.periodid, dv.sourceid, dv.categoryoptioncomboid, dv.value, dv.storedby, dv.lastupdated, " +
- "dv.comment, dv.followup, ou.name as sourcename, de.name as dataelementname, pt.name as periodtypename, pe.startdate, pe.enddate, mm.minimumvalue, mm.maximumvalue " +
+ "dv.created, dv.comment, dv.followup, ou.name as sourcename, de.name as dataelementname, pt.name as periodtypename, pe.startdate, pe.enddate, mm.minimumvalue, mm.maximumvalue " +
"from datavalue dv " +
"join minmaxdataelement mm on ( dv.dataelementid = mm.dataelementid and dv.categoryoptioncomboid = mm.categoryoptioncomboid and dv.sourceid = mm.sourceid ) " +
"join dataelement de on dv.dataelementid = de.dataelementid " +
@@ -220,7 +220,7 @@
String sql =
"select dv.dataelementid, dv.periodid, dv.sourceid, dv.categoryoptioncomboid, dv.value, dv.storedby, dv.lastupdated, " +
- "dv.comment, dv.followup, ou.name as sourcename, " +
+ "dv.created, dv.comment, dv.followup, ou.name as sourcename, " +
"'" + dataElement.getName() + "' as dataelementname, pt.name as periodtypename, pe.startdate, pe.enddate, " +
"'" + categoryOptionCombo.getName() + "' as categoryoptioncomboname " +
"from datavalue dv " +
@@ -247,7 +247,7 @@
{
final String sql =
"select dv.dataelementid, dv.periodid, dv.sourceid, dv.categoryoptioncomboid, dv.value, " +
- "dv.storedby, dv.lastupdated, dv.comment, dv.followup, mm.minimumvalue, mm.maximumvalue, de.name as dataelementname, " +
+ "dv.storedby, dv.lastupdated, dv.created, dv.comment, dv.followup, mm.minimumvalue, mm.maximumvalue, de.name as dataelementname, " +
"pe.startdate, pe.enddate, pt.name AS periodtypename, ou.name AS sourcename, cc.categoryoptioncomboname " +
"from datavalue dv " +
"left join minmaxdataelement mm on (dv.sourceid = mm.sourceid and dv.dataelementid = mm.dataelementid and dv.categoryoptioncomboid = mm.categoryoptioncomboid) " +
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/datavalue/DataValueServiceTest.java'
--- dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/datavalue/DataValueServiceTest.java 2014-04-27 21:28:37 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/test/java/org/hisp/dhis/datavalue/DataValueServiceTest.java 2014-06-30 18:27:25 +0000
@@ -161,6 +161,7 @@
dataValueA = dataValueService.getDataValue( dataElementA, periodA, sourceA, optionCombo );
assertNotNull( dataValueA );
+ assertNotNull( dataValueA.getCreated() );
assertEquals( sourceA.getId(), dataValueA.getSource().getId() );
assertEquals( dataElementA, dataValueA.getDataElement() );
assertEquals( periodA, dataValueA.getPeriod() );
@@ -168,6 +169,7 @@
dataValueB = dataValueService.getDataValue( dataElementB, periodA, sourceA, optionCombo );
assertNotNull( dataValueB );
+ assertNotNull( dataValueB.getCreated() );
assertEquals( sourceA.getId(), dataValueB.getSource().getId() );
assertEquals( dataElementB, dataValueB.getDataElement() );
assertEquals( periodA, dataValueB.getPeriod() );
@@ -175,6 +177,7 @@
dataValueC = dataValueService.getDataValue( dataElementC, periodC, sourceA, optionCombo );
assertNotNull( dataValueC );
+ assertNotNull( dataValueC.getCreated() );
assertEquals( sourceA.getId(), dataValueC.getSource().getId() );
assertEquals( dataElementC, dataValueC.getDataElement() );
assertEquals( periodC, dataValueC.getPeriod() );
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/converter/DataValueConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/converter/DataValueConverter.java 2014-06-30 17:11:33 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/converter/DataValueConverter.java 2014-06-30 18:27:25 +0000
@@ -37,6 +37,7 @@
import java.io.BufferedReader;
import java.io.IOException;
import java.util.Collection;
+import java.util.Date;
import java.util.Map;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
@@ -273,6 +274,7 @@
value.setComment( values[13] );
value.setLastUpdated( DateUtils.getDefaultDate( values[15] ) );
+ value.setCreated( value.getLastUpdated() );
value.setCategoryOptionCombo( proxyCategoryOptionCombo );
value.setStoredBy( owner );
=== modified file 'dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/converter/DataValueDailyConverter.java'
--- dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/converter/DataValueDailyConverter.java 2014-06-27 16:27:09 +0000
+++ dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/converter/DataValueDailyConverter.java 2014-06-30 18:27:25 +0000
@@ -625,6 +625,7 @@
value.setComment( values[13] );
value.setLastUpdated( DateUtils.getDefaultDate( values[15] ) );
+ value.setCreated( value.getLastUpdated() );
value.setCategoryOptionCombo( proxyCategoryOptionCombo );
value.setStoredBy( owner );
=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/DeflatedDataValueNameMinMaxRowMapper.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/DeflatedDataValueNameMinMaxRowMapper.java 2014-06-27 16:27:09 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/DeflatedDataValueNameMinMaxRowMapper.java 2014-06-30 18:27:25 +0000
@@ -89,6 +89,7 @@
value.setCategoryOptionComboId( resultSet.getInt( "categoryoptioncomboid" ) );
value.setValue( resultSet.getString( "value" ) );
value.setStoredBy( resultSet.getString( "storedby" ) );
+ value.setCreated( resultSet.getDate( "created" ) );
value.setLastUpdated( resultSet.getDate( "lastupdated" ) );
value.setComment( resultSet.getString( "comment" ) );
value.setFollowup( resultSet.getBoolean( "followup" ) );
=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/DeflatedDataValueRowMapper.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/DeflatedDataValueRowMapper.java 2014-06-27 16:27:09 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/DeflatedDataValueRowMapper.java 2014-06-30 18:27:25 +0000
@@ -46,14 +46,15 @@
{
final DeflatedDataValue value = new DeflatedDataValue();
- value.setDataElementId( resultSet.getInt( 1 ) );
- value.setPeriodId( resultSet.getInt( 2 ) );
- value.setSourceId( resultSet.getInt( 3 ) );
- value.setCategoryOptionComboId( resultSet.getInt( 4 ) );
- value.setValue( resultSet.getString( 5 ) );
- value.setStoredBy( resultSet.getString( 6 ) );
- value.setLastUpdated( resultSet.getTimestamp( 7 ) );
- value.setComment( resultSet.getString( 8 ) );
+ value.setDataElementId( resultSet.getInt( "dataelementid" ) );
+ value.setPeriodId( resultSet.getInt( "periodid" ) );
+ value.setSourceId( resultSet.getInt( "sourceid" ) );
+ value.setCategoryOptionComboId( resultSet.getInt( "categoryoptioncomboid" ) );
+ value.setValue( resultSet.getString( "value" ) );
+ value.setStoredBy( resultSet.getString( "storedby" ) );
+ value.setCreated( resultSet.getTimestamp( "created" ) );
+ value.setLastUpdated( resultSet.getTimestamp( "lastupdated" ) );
+ value.setComment( resultSet.getString( "comment" ) );
return value;
}
=== modified file 'dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java'
--- dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java 2014-06-27 16:27:09 +0000
+++ dhis-2/dhis-support/dhis-support-test/src/main/java/org/hisp/dhis/DhisConvenienceTest.java 2014-06-30 18:27:25 +0000
@@ -903,6 +903,7 @@
dataValue.setValue( value );
dataValue.setComment( "Comment" );
dataValue.setStoredBy( "StoredBy" );
+ dataValue.setCreated( date );
dataValue.setLastUpdated( date );
return dataValue;
@@ -929,6 +930,7 @@
dataValue.setValue( value );
dataValue.setComment( "Comment" );
dataValue.setStoredBy( "StoredBy" );
+ dataValue.setCreated( date );
dataValue.setLastUpdated( date );
return dataValue;
@@ -956,6 +958,7 @@
dataValue.setValue( value );
dataValue.setComment( "Comment" );
dataValue.setStoredBy( "StoredBy" );
+ dataValue.setCreated( lastupdated );
dataValue.setLastUpdated( lastupdated );
return dataValue;