← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 1130: Moved classes ObjectMapper and RowMapper to amplecode. They are generic and have been stable for ...

 

------------------------------------------------------------
revno: 1130
committer: Lars Helge Oeverland larshelge@xxxxxxxxx
branch nick: trunk
timestamp: Thu 2009-11-26 09:48:34 +0100
message:
  Moved classes ObjectMapper and RowMapper to amplecode. They are generic and have been stable for a year.
removed:
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/ObjectMapper.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/RowMapper.java
modified:
  dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/outlieranalysis/jdbc/JdbcOutlierAnalysisStore.java
  dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/jdbc/JdbcDataMartStore.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/AggregatedIndicatorValueRowMapper.java
  dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedMapValueRowMapper.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/DeflatedDataValueRowMapper.java
  dhis-2/pom.xml


--
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-services/dhis-service-administration/src/main/java/org/hisp/dhis/outlieranalysis/jdbc/JdbcOutlierAnalysisStore.java'
--- dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/outlieranalysis/jdbc/JdbcOutlierAnalysisStore.java	2009-11-25 16:28:44 +0000
+++ dhis-2/dhis-services/dhis-service-administration/src/main/java/org/hisp/dhis/outlieranalysis/jdbc/JdbcOutlierAnalysisStore.java	2009-11-26 08:48:34 +0000
@@ -41,7 +41,7 @@
 import org.hisp.dhis.outlieranalysis.OutlierAnalysisStore;
 import org.hisp.dhis.period.Period;
 import org.hisp.dhis.system.objectmapper.DeflatedDataValueRowMapper;
-import org.hisp.dhis.system.objectmapper.ObjectMapper;
+import org.amplecode.quick.mapper.ObjectMapper;
 import org.hisp.dhis.system.util.ConversionUtils;
 import org.hisp.dhis.system.util.TextUtils;
 

=== modified file 'dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/jdbc/JdbcDataMartStore.java'
--- dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/jdbc/JdbcDataMartStore.java	2009-11-24 11:01:39 +0000
+++ dhis-2/dhis-services/dhis-service-datamart-default/src/main/java/org/hisp/dhis/datamart/jdbc/JdbcDataMartStore.java	2009-11-26 08:48:34 +0000
@@ -60,7 +60,7 @@
 import org.hisp.dhis.system.objectmapper.AggregatedMapValueRowMapper;
 import org.hisp.dhis.system.objectmapper.DataValueRowMapper;
 import org.hisp.dhis.system.objectmapper.DeflatedDataValueRowMapper;
-import org.hisp.dhis.system.objectmapper.ObjectMapper;
+import org.amplecode.quick.mapper.ObjectMapper;
 
 /**
  * @author Lars Helge Overland

=== 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	2009-03-09 14:11:42 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedDataValueRowMapper.java	2009-11-26 08:48:34 +0000
@@ -30,6 +30,7 @@
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
+import org.amplecode.quick.mapper.RowMapper;
 import org.hisp.dhis.aggregation.AggregatedDataValue;
 
 /**

=== 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	2009-03-09 14:11:42 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedIndicatorValueRowMapper.java	2009-11-26 08:48:34 +0000
@@ -30,6 +30,7 @@
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
+import org.amplecode.quick.mapper.RowMapper;
 import org.hisp.dhis.aggregation.AggregatedIndicatorValue;
 
 /**

=== modified file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedMapValueRowMapper.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedMapValueRowMapper.java	2009-09-14 19:02:15 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/AggregatedMapValueRowMapper.java	2009-11-26 08:48:34 +0000
@@ -30,6 +30,7 @@
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
+import org.amplecode.quick.mapper.RowMapper;
 import org.hisp.dhis.aggregation.AggregatedMapValue;
 
 /**

=== 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	2009-08-12 21:08:19 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/DataValueRowMapper.java	2009-11-26 08:48:34 +0000
@@ -30,6 +30,7 @@
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
+import org.amplecode.quick.mapper.RowMapper;
 import org.hisp.dhis.dataelement.DataElement;
 import org.hisp.dhis.dataelement.DataElementCategoryOptionCombo;
 import org.hisp.dhis.datavalue.DataValue;

=== 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	2009-03-09 14:20:29 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/DeflatedDataValueRowMapper.java	2009-11-26 08:48:34 +0000
@@ -30,6 +30,7 @@
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
+import org.amplecode.quick.mapper.RowMapper;
 import org.hisp.dhis.datavalue.DeflatedDataValue;
 
 /**

=== removed file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/ObjectMapper.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/ObjectMapper.java	2009-08-09 12:33:08 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/ObjectMapper.java	1970-01-01 00:00:00 +0000
@@ -1,71 +0,0 @@
-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 java.util.Collection;
-import java.util.HashSet;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public class ObjectMapper<T>
-{
-    public T getObject( ResultSet resultSet, RowMapper<T> rowMapper )
-    {
-        try
-        {
-            return resultSet.next() ? rowMapper.mapRow( resultSet ) : null;
-        }
-        catch ( SQLException ex )
-        {
-            throw new RuntimeException( "Failed to get object from resultset", ex );
-        }
-    }
-    
-    public Collection<T> getCollection( ResultSet resultSet, RowMapper<T> rowMapper )
-    {
-        try
-        {
-            Collection<T> objects = new HashSet<T>();
-        
-            while ( resultSet.next() )
-            {
-                objects.add( rowMapper.mapRow( resultSet ) );
-            }
-            
-            return objects;
-        }
-        catch ( SQLException ex )
-        {
-            throw new RuntimeException( "Failed to get collection from resultset", ex );
-        }
-    }
-}

=== removed file 'dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/RowMapper.java'
--- dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/RowMapper.java	2009-03-03 16:46:36 +0000
+++ dhis-2/dhis-support/dhis-support-system/src/main/java/org/hisp/dhis/system/objectmapper/RowMapper.java	1970-01-01 00:00:00 +0000
@@ -1,41 +0,0 @@
-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;
-
-/**
- * @author Lars Helge Overland
- * @version $Id$
- */
-public interface RowMapper<T>
-{
-    T mapRow( ResultSet resultSet )
-        throws SQLException;
-}

=== modified file 'dhis-2/pom.xml'
--- dhis-2/pom.xml	2009-11-23 16:57:36 +0000
+++ dhis-2/pom.xml	2009-11-26 08:48:34 +0000
@@ -263,7 +263,7 @@
       <dependency>
         <groupId>org.amplecode</groupId>
         <artifactId>quick</artifactId>
-        <version>1.1.2</version>
+        <version>1.1.3</version>
       </dependency>
       <dependency>
         <groupId>com.lowagie</groupId>