← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16: Forgot to add two classes.

 

------------------------------------------------------------
revno: 16
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Mon 2009-03-09 15:20:29 +0100
message:
  Forgot to add two classes.
added:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DeflatedDataValue.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/DeflatedDataValueRowMapper.java

=== added 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	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/datavalue/DeflatedDataValue.java	2009-03-09 14:20:29 +0000
@@ -0,0 +1,148 @@
+package org.hisp.dhis.datavalue;
+
+/*
+ * Copyright (c) 2004-2007, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ *   list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ *   be used to endorse or promote products derived from this software without
+ *   specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import java.util.Date;
+
+/**
+ * The purpose of this class is to avoid the overhead of creating objects
+ * for associated objects, in order to reduce heap space usage during export.
+ * 
+ * @author Lars Helge Overland
+ * @version $Id$
+ */
+public class DeflatedDataValue
+{
+    private int dataElementId;
+    
+    private int periodId;
+    
+    private int sourceId;
+    
+    private String value;
+    
+    private String storedBy;
+
+    private Date timestamp;
+
+    private String comment;
+    
+    private int categoryOptionComboId;
+
+    // -------------------------------------------------------------------------
+    // Constructors
+    // -------------------------------------------------------------------------
+
+    public DeflatedDataValue()
+    {   
+    }
+
+    // -------------------------------------------------------------------------
+    // Getters and setters
+    // -------------------------------------------------------------------------
+
+    public int getDataElementId()
+    {
+        return dataElementId;
+    }
+
+    public void setDataElementId( int dataElementId )
+    {
+        this.dataElementId = dataElementId;
+    }
+
+    public int getPeriodId()
+    {
+        return periodId;
+    }
+
+    public void setPeriodId( int periodId )
+    {
+        this.periodId = periodId;
+    }
+
+    public int getSourceId()
+    {
+        return sourceId;
+    }
+
+    public void setSourceId( int sourceId )
+    {
+        this.sourceId = sourceId;
+    }
+
+    public String getValue()
+    {
+        return value;
+    }
+
+    public void setValue( String value )
+    {
+        this.value = value;
+    }
+
+    public String getStoredBy()
+    {
+        return storedBy;
+    }
+
+    public void setStoredBy( String storedBy )
+    {
+        this.storedBy = storedBy;
+    }
+
+    public Date getTimestamp()
+    {
+        return timestamp;
+    }
+
+    public void setTimestamp( Date timestamp )
+    {
+        this.timestamp = timestamp;
+    }
+
+    public String getComment()
+    {
+        return comment;
+    }
+
+    public void setComment( String comment )
+    {
+        this.comment = comment;
+    }
+
+    public int getCategoryOptionComboId()
+    {
+        return categoryOptionComboId;
+    }
+
+    public void setCategoryOptionComboId( int categoryOptionComboId )
+    {
+        this.categoryOptionComboId = categoryOptionComboId;
+    }
+}

=== added 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	1970-01-01 00:00:00 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/DeflatedDataValueRowMapper.java	2009-03-09 14:20:29 +0000
@@ -0,0 +1,58 @@
+package org.hisp.dhis.system.objectmapper;
+
+/*
+ * Copyright (c) 2004-2007, University of Oslo
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright notice, this
+ *   list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright notice,
+ *   this list of conditions and the following disclaimer in the documentation
+ *   and/or other materials provided with the distribution.
+ * * Neither the name of the HISP project nor the names of its contributors may
+ *   be used to endorse or promote products derived from this software without
+ *   specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+import java.sql.ResultSet;
+import java.sql.SQLException;
+
+import org.hisp.dhis.datavalue.DeflatedDataValue;
+
+/**
+ * @author Lars Helge Overland
+ * @version $Id$
+ */
+public class DeflatedDataValueRowMapper
+    implements RowMapper<DeflatedDataValue>
+{
+    public DeflatedDataValue mapRow( ResultSet resultSet )
+        throws SQLException
+    {
+        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.setTimestamp( resultSet.getDate( 7 ) );
+        value.setComment( resultSet.getString( 8 ) );
+        
+        return value;
+    }
+}



--

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.