← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 5257: Made quick RowMappers also implement spring jdbc RowMapper interface so they can now also be used...

 

------------------------------------------------------------
revno: 5257
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2011-12-01 14:36:23 +0100
message:
  Made quick RowMappers also implement spring jdbc RowMapper interface so they can now also be used for spring jdbc
modified:
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedDataMapValueRowMapper.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedDataValueRowMapper.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedIndicatorMapValueRowMapper.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedIndicatorValueRowMapper.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/DataElementOperandMapper.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/DataValueRowMapper.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-system/src/main/java/org/hisp/dhis/system/objectmapper/OrganisationUnitRelationshipRowMapper.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-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedDataMapValueRowMapper.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedDataMapValueRowMapper.java	2010-05-27 15:24:59 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedDataMapValueRowMapper.java	2011-12-01 13:36:23 +0000
@@ -38,7 +38,7 @@
  * @version $Id$
  */
 public class AggregatedDataMapValueRowMapper
-    implements RowMapper<AggregatedMapValue>
+    implements RowMapper<AggregatedMapValue>, org.springframework.jdbc.core.RowMapper<AggregatedMapValue>
 {
     public AggregatedMapValue mapRow( ResultSet resultSet )
         throws SQLException
@@ -52,4 +52,11 @@
 
         return value;
     }
+
+    @Override
+    public AggregatedMapValue mapRow( ResultSet resultSet, int rowNum )
+        throws SQLException
+    {
+        return mapRow( resultSet );
+    }
 }

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedDataValueRowMapper.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedDataValueRowMapper.java	2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedDataValueRowMapper.java	2011-12-01 13:36:23 +0000
@@ -38,8 +38,9 @@
  * @version $Id$
  */
 public class AggregatedDataValueRowMapper
-    implements RowMapper<AggregatedDataValue>
+    implements RowMapper<AggregatedDataValue>, org.springframework.jdbc.core.RowMapper<AggregatedDataValue>
 {
+    @Override
     public AggregatedDataValue mapRow( ResultSet resultSet )
         throws SQLException
     {
@@ -55,4 +56,11 @@
         
         return value;
     }
+
+    @Override
+    public AggregatedDataValue mapRow( ResultSet resultSet, int rowNum )
+        throws SQLException
+    {
+        return mapRow( resultSet );
+    }
 }

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedIndicatorMapValueRowMapper.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedIndicatorMapValueRowMapper.java	2010-05-27 15:24:59 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedIndicatorMapValueRowMapper.java	2011-12-01 13:36:23 +0000
@@ -38,7 +38,7 @@
  * @version $Id$
  */
 public class AggregatedIndicatorMapValueRowMapper
-    implements RowMapper<AggregatedMapValue>
+    implements RowMapper<AggregatedMapValue>, org.springframework.jdbc.core.RowMapper<AggregatedMapValue>
 {
     public AggregatedMapValue mapRow( ResultSet resultSet )
         throws SQLException
@@ -55,4 +55,11 @@
 
         return value;
     }
+
+    @Override
+    public AggregatedMapValue mapRow( ResultSet resultSet, int rowNum )
+        throws SQLException
+    {
+        return mapRow( resultSet );
+    }
 }

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedIndicatorValueRowMapper.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedIndicatorValueRowMapper.java	2010-11-08 13:02:47 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedIndicatorValueRowMapper.java	2011-12-01 13:36:23 +0000
@@ -38,7 +38,7 @@
  * @version $Id$
  */
 public class AggregatedIndicatorValueRowMapper
-    implements RowMapper<AggregatedIndicatorValue>
+    implements RowMapper<AggregatedIndicatorValue>, org.springframework.jdbc.core.RowMapper<AggregatedIndicatorValue>
 {
     public AggregatedIndicatorValue mapRow( ResultSet resultSet )
         throws SQLException
@@ -58,4 +58,11 @@
         
         return value;
     }
+
+    @Override
+    public AggregatedIndicatorValue mapRow( ResultSet resultSet, int rowNum )
+        throws SQLException
+    {
+        return mapRow( resultSet );
+    }
 }

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/DataElementOperandMapper.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/DataElementOperandMapper.java	2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/DataElementOperandMapper.java	2011-12-01 13:36:23 +0000
@@ -39,7 +39,7 @@
  * @author Lars Helge Overland
  */
 public class DataElementOperandMapper
-    implements RowMapper<DataElementOperand>
+    implements RowMapper<DataElementOperand>, org.springframework.jdbc.core.RowMapper<DataElementOperand>
 {
     private static final String SEPARATOR = " ";
     
@@ -63,4 +63,11 @@
         
         return operand;
     }
+
+    @Override
+    public DataElementOperand mapRow( ResultSet resultSet, int rowNum )
+        throws SQLException
+    {
+        return mapRow( resultSet );
+    }
 }

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/DataValueRowMapper.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/DataValueRowMapper.java	2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/DataValueRowMapper.java	2011-12-01 13:36:23 +0000
@@ -42,7 +42,7 @@
  * @version $Id$
  */
 public class DataValueRowMapper
-    implements RowMapper<DataValue>
+    implements RowMapper<DataValue>, org.springframework.jdbc.core.RowMapper<DataValue>
 {
     public DataValue mapRow( ResultSet resultSet )
         throws SQLException
@@ -65,4 +65,11 @@
         
         return dataValue;
     }
+
+    @Override
+    public DataValue mapRow( ResultSet resultSet, int rowNum )
+        throws SQLException
+    {
+        return mapRow( resultSet );
+    }
 }

=== 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	2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/DeflatedDataValueNameMinMaxRowMapper.java	2011-12-01 13:36:23 +0000
@@ -59,7 +59,7 @@
  * @author Lars Helge Overland
  */
 public class DeflatedDataValueNameMinMaxRowMapper
-    implements RowMapper<DeflatedDataValue>
+    implements RowMapper<DeflatedDataValue>, org.springframework.jdbc.core.RowMapper<DeflatedDataValue>
 {
     public DeflatedDataValue mapRow( ResultSet resultSet )
         throws SQLException
@@ -87,4 +87,11 @@
         
         return value;
     }
+
+    @Override
+    public DeflatedDataValue mapRow( ResultSet resultSet, int rowNum )
+        throws SQLException
+    {
+        return mapRow( resultSet );
+    }
 }

=== 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	2010-04-12 21:23:33 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/DeflatedDataValueRowMapper.java	2011-12-01 13:36:23 +0000
@@ -38,7 +38,7 @@
  * @version $Id$
  */
 public class DeflatedDataValueRowMapper
-    implements RowMapper<DeflatedDataValue>
+    implements RowMapper<DeflatedDataValue>, org.springframework.jdbc.core.RowMapper<DeflatedDataValue>
 {
     public DeflatedDataValue mapRow( ResultSet resultSet )
         throws SQLException
@@ -56,4 +56,11 @@
         
         return value;
     }
+
+    @Override
+    public DeflatedDataValue mapRow( ResultSet resultSet, int rowNum )
+        throws SQLException
+    {
+        return mapRow( resultSet );
+    }
 }

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/OrganisationUnitRelationshipRowMapper.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/OrganisationUnitRelationshipRowMapper.java	2010-06-08 19:47:40 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/OrganisationUnitRelationshipRowMapper.java	2011-12-01 13:36:23 +0000
@@ -1,18 +1,55 @@
 package org.hisp.dhis.system.objectmapper;
 
+/*
+ * Copyright (c) 2004-2010, 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.amplecode.quick.mapper.RowMapper;
 import org.hisp.dhis.organisationunit.OrganisationUnitRelationship;
-import org.springframework.jdbc.core.RowMapper;
 
+/**
+ * @author Lars Helge Overland
+ */
 public class OrganisationUnitRelationshipRowMapper
-    implements RowMapper<OrganisationUnitRelationship>
+    implements RowMapper<OrganisationUnitRelationship>, org.springframework.jdbc.core.RowMapper<OrganisationUnitRelationship>
 {    
     @Override
-    public OrganisationUnitRelationship mapRow( ResultSet resultSet, int row )
+    public OrganisationUnitRelationship mapRow( ResultSet resultSet )
         throws SQLException
     {
         return new OrganisationUnitRelationship( resultSet.getInt( "parentid" ), resultSet.getInt( "organisationunitid" ) );
     }
+    
+    @Override
+    public OrganisationUnitRelationship mapRow( ResultSet resultSet, int rowNum )
+        throws SQLException
+    {
+        return mapRow( resultSet );
+    }
 }