commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r747724 - in /commons/proper/dbutils/trunk: ./ src/java/org/apache/commons/dbutils/ src/java/org/apache/commons/dbutils/handlers/ src/test/org/apache/commons/dbutils/
Date Wed, 25 Feb 2009 10:01:32 GMT
Author: bayard
Date: Wed Feb 25 10:01:31 2009
New Revision: 747724

URL: http://svn.apache.org/viewvc?rev=747724&view=rev
Log:
Merging in Dab Fabulich's work on https://svn.apache.org/repos/asf/commons/sandbox/dbutils/bugfixing
from -r741987:747723. Resolving DBUTILS-34 - DBUTILS-37 - DBUTILS-29 - DBUTILS-14 - DBUTILS-31
- DBUTILS-39 - DBUTILS-41 - DBUTILS-44 - DBUTILS-33 - DBUTILS-42 - DBUTILS-40

Added:
    commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/AbstractListHandler.java
      - copied unchanged from r747723, commons/sandbox/dbutils/bugfixing/src/java/org/apache/commons/dbutils/handlers/AbstractListHandler.java
    commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/QueryRunnerTest.java
      - copied unchanged from r747723, commons/sandbox/dbutils/bugfixing/src/test/org/apache/commons/dbutils/QueryRunnerTest.java
Removed:
    commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/GenericListHandler.java
Modified:
    commons/proper/dbutils/trunk/pom.xml
    commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/BasicRowProcessor.java
    commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/BeanProcessor.java
    commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryRunner.java
    commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/ArrayListHandler.java
    commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/BeanListHandler.java
    commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/ColumnListHandler.java
    commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/MapListHandler.java
    commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/BaseTestCase.java

Modified: commons/proper/dbutils/trunk/pom.xml
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/pom.xml?rev=747724&r1=747723&r2=747724&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/pom.xml (original)
+++ commons/proper/dbutils/trunk/pom.xml Wed Feb 25 10:01:31 2009
@@ -233,6 +233,25 @@
             <enableRulesSummary>false</enableRulesSummary>
           </configuration>
         </plugin>
+        <plugin>
+          <groupId>org.codehaus.mojo</groupId>
+          <artifactId>findbugs-maven-plugin</artifactId>
+          <version>1.2</version>
+          <configuration>
+            <threshold>Normal</threshold>
+            <effort>Default</effort>
+         </configuration>
+        </plugin>
+        <plugin>
+          <groupId>org.codehaus.mojo</groupId>
+          <artifactId>cobertura-maven-plugin</artifactId>
+          <version>2.2</version>
+        </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-pmd-plugin</artifactId>
+          <version>2.3</version>
+        </plugin>
       </plugins>
     </reporting>
 

Modified: commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/BasicRowProcessor.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/BasicRowProcessor.java?rev=747724&r1=747723&r2=747724&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/BasicRowProcessor.java
(original)
+++ commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/BasicRowProcessor.java
Wed Feb 25 10:01:31 2009
@@ -144,10 +144,36 @@
      * A Map that converts all keys to lowercase Strings for case insensitive
      * lookups.  This is needed for the toMap() implementation because 
      * databases don't consistenly handle the casing of column names. 
+     * 
+     * <p>The keys are stored as they are given [BUG #DBUTILS-34], so we maintain
+     * an internal mapping from lowercase keys to the real keys in order to 
+     * achieve the case insensitive lookup.
+     * 
+     * <p>Note: This implementation does not allow <tt>null</tt>
+     * for key, whereas {@link HashMap} does, because of the code:
+     * <pre>
+     * key.toString().toLowerCase()
+     * </pre>
      */
     private static class CaseInsensitiveHashMap extends HashMap {
 
         /**
+         * The internal mapping from lowercase keys to the real keys.
+         * 
+         * <p>
+         * Any query operation using the key 
+         * ({@link #get(Object)}, {@link #containsKey(Object)})
+         * is done in three steps:
+         * <ul>
+         * <li>convert the parameter key to lower case</li>
+         * <li>get the actual key that corresponds to the lower case key</li>
+         * <li>query the map with the actual key</li>
+         * </ul>
+         * </p>
+         */
+        private final Map lowerCaseMap = new HashMap();
+
+        /**
          * Required for serialization support.
          * 
          * @see java.io.Serializable
@@ -158,31 +184,48 @@
          * @see java.util.Map#containsKey(java.lang.Object)
          */
         public boolean containsKey(Object key) {
-            return super.containsKey(key.toString().toLowerCase());
+            Object realKey = lowerCaseMap.get(key.toString().toLowerCase());
+            return super.containsKey(realKey);
+            // Possible optimisation here:
+            // Since the lowerCaseMap contains a mapping for all the keys,
+            // we could just do this:
+            // return lowerCaseMap.containsKey(key.toString().toLowerCase());
         }
 
         /**
          * @see java.util.Map#get(java.lang.Object)
          */
         public Object get(Object key) {
-            return super.get(key.toString().toLowerCase());
+            Object realKey = lowerCaseMap.get(key.toString().toLowerCase());
+            return super.get(realKey);
         }
 
         /**
          * @see java.util.Map#put(java.lang.Object, java.lang.Object)
          */
         public Object put(Object key, Object value) {
-            return super.put(key.toString().toLowerCase(), value);
+            /*
+             * In order to keep the map and lowerCaseMap synchronized,
+             * we have to remove the old mapping before putting the 
+             * new one. Indeed, oldKey and key are not necessaliry equals.
+             * (That's why we call super.remove(oldKey) and not just
+             * super.put(key, value))
+             */
+            Object oldKey = lowerCaseMap.put(key.toString().toLowerCase(), key);
+            Object oldValue = super.remove(oldKey);
+            super.put(key, value);
+            return oldValue;
         }
 
         /**
          * @see java.util.Map#putAll(java.util.Map)
          */
         public void putAll(Map m) {
-            Iterator iter = m.keySet().iterator();
+            Iterator iter = m.entrySet().iterator();
             while (iter.hasNext()) {
-                Object key = iter.next();
-                Object value = m.get(key);
+                Map.Entry entry = (Map.Entry) iter.next();
+                Object key = entry.getKey();
+                Object value = entry.getValue();
                 this.put(key, value);
             }
         }
@@ -191,7 +234,8 @@
          * @see java.util.Map#remove(java.lang.Object)
          */
         public Object remove(Object key) {
-            return super.remove(key.toString().toLowerCase());
+            Object realKey = lowerCaseMap.remove(key.toString().toLowerCase());
+            return super.remove(realKey);
         }
     }
     

Modified: commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/BeanProcessor.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/BeanProcessor.java?rev=747724&r1=747723&r2=747724&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/BeanProcessor.java (original)
+++ commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/BeanProcessor.java Wed
Feb 25 10:01:31 2009
@@ -432,7 +432,11 @@
      */
     protected Object processColumn(ResultSet rs, int index, Class propType)
         throws SQLException {
-
+    	
+    	if ( !propType.isPrimitive() && rs.getObject(index) == null ) {
+    		return null;
+    	}
+    	
         if (propType.equals(String.class)) {
             return rs.getString(index);
             

Modified: commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryRunner.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryRunner.java?rev=747724&r1=747723&r2=747724&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryRunner.java (original)
+++ commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryRunner.java Wed
Feb 25 10:01:31 2009
@@ -16,7 +16,13 @@
  */
 package org.apache.commons.dbutils;
 
+import java.beans.IntrospectionException;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
 import java.sql.Connection;
+import java.sql.ParameterMetaData;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
@@ -35,6 +41,11 @@
 public class QueryRunner {
 
     /**
+     * Is {@link ParameterMetaData#getParameterType(int)} broken (have we tried it yet)?
+     */
+    private volatile boolean pmdKnownBroken = false;
+    
+    /**
      * The DataSource to retrieve connections from.
      */
     protected DataSource ds = null;
@@ -47,7 +58,18 @@
     }
 
     /**
-     * Constructor for QueryRunner.  Methods that do not take a 
+     * Constructor for QueryRunner, allows workaround for Oracle drivers
+     * @param pmdKnownBroken Oracle drivers don't support {@link ParameterMetaData#getParameterType(int)
};
+     * if <code>pmdKnownBroken</code> is set to true, we won't even try it; if
false, we'll try it,
+     * and if it breaks, we'll remember not to use it again.
+     */
+    public QueryRunner(boolean pmdKnownBroken) {
+        super();
+        this.pmdKnownBroken = pmdKnownBroken; 
+    }
+    
+    /**
+     * Constructor for QueryRunner, allows workaround for Oracle drivers.  Methods that do
not take a 
      * <code>Connection</code> parameter will retrieve connections from this
      * <code>DataSource</code>.
      * 
@@ -59,6 +81,22 @@
     }
     
     /**
+     * Constructor for QueryRunner, allows workaround for Oracle drivers.  Methods that do
not take a 
+     * <code>Connection</code> parameter will retrieve connections from this
+     * <code>DataSource</code>.
+     * 
+     * @param ds The <code>DataSource</code> to retrieve connections from.
+     * @param pmdKnownBroken Oracle drivers don't support {@link ParameterMetaData#getParameterType(int)
};
+     * if <code>pmdKnownBroken</code> is set to true, we won't even try it; if
false, we'll try it,
+     * and if it breaks, we'll remember not to use it again.
+     */
+    public QueryRunner(DataSource ds, boolean pmdKnownBroken) {
+        super();
+        this.pmdKnownBroken = pmdKnownBroken;
+        setDataSource(ds);
+    }
+    
+    /**
      * Execute a batch of SQL INSERT, UPDATE, or DELETE queries.
      * 
      * @param conn The Connection to use to run the query.  The caller is
@@ -124,13 +162,18 @@
      * value to pass in.
      * @throws SQLException if a database access error occurs
      */
-    protected void fillStatement(PreparedStatement stmt, Object[] params)
+    public void fillStatement(PreparedStatement stmt, Object[] params)
         throws SQLException {
 
         if (params == null) {
             return;
         }
-
+        
+        ParameterMetaData pmd = stmt.getParameterMetaData();
+        if (pmd.getParameterCount() < params.length) {
+            throw new SQLException("Too many parameters: expected "
+                    + pmd.getParameterCount() + ", was given " + params.length);
+        }
         for (int i = 0; i < params.length; i++) {
             if (params[i] != null) {
                 stmt.setObject(i + 1, params[i]);
@@ -138,12 +181,103 @@
                 // VARCHAR works with many drivers regardless
                 // of the actual column type.  Oddly, NULL and 
                 // OTHER don't work with Oracle's drivers.
-                stmt.setNull(i + 1, Types.VARCHAR);
+                int sqlType = Types.VARCHAR;
+                if (!pmdKnownBroken) {
+                    try {
+                        sqlType = pmd.getParameterType(i + 1);
+                    } catch (SQLException e) {
+                        pmdKnownBroken = true;
+                    }
+                }
+                stmt.setNull(i + 1, sqlType);
             }
         }
     }
 
     /**
+     * Fill the <code>PreparedStatement</code> replacement parameters with the
+     * given object's bean property values.
+     * 
+     * @param stmt
+     *            PreparedStatement to fill
+     * @param bean
+     *            a JavaBean object
+     * @param properties
+     *            an ordered array of properties; this gives the order to insert
+     *            values in the statement
+     * @throws SQLException
+     *             if a database access error occurs
+     */
+    public void fillStatementWithBean(PreparedStatement stmt, Object bean,
+            PropertyDescriptor[] properties) throws SQLException {
+        Object[] params = new Object[properties.length];
+        for (int i = 0; i < properties.length; i++) {
+            PropertyDescriptor property = properties[i];
+            Object value = null;
+            Method method = property.getReadMethod();
+            if (method == null)
+                throw new RuntimeException("No read method for bean property "
+                        + bean.getClass() + " " + property.getName());
+            try {
+                value = method.invoke(bean, new Object[0]);
+            } catch (InvocationTargetException e) {
+                throw new RuntimeException("Couldn't invoke method: " + method, e);
+            } catch (IllegalArgumentException e) {
+                throw new RuntimeException("Couldn't invoke method with 0 arguments: " +
method, e);
+            } catch (IllegalAccessException e) {
+                throw new RuntimeException("Couldn't invoke method: " + method, e);
+            } 
+            params[i] = value;
+        }
+        fillStatement(stmt, params);
+    }
+
+    /**
+     * Fill the <code>PreparedStatement</code> replacement parameters with the
+     * given object's bean property values.
+     * 
+     * @param stmt
+     *            PreparedStatement to fill
+     * @param bean
+     *            a JavaBean object
+     * @param propertyNames
+     *            an ordered array of property names (these should match the
+     *            getters/setters); this gives the order to insert values in the
+     *            statement
+     * @throws SQLException
+     *             if a database access error occurs
+     */
+    public void fillStatementWithBean(PreparedStatement stmt, Object bean,
+            String[] propertyNames) throws SQLException {
+        PropertyDescriptor[] descriptors;
+        try {
+            descriptors = Introspector.getBeanInfo(bean.getClass())
+                    .getPropertyDescriptors();
+        } catch (IntrospectionException e) {
+            throw new RuntimeException("Couldn't introspect bean " + bean.getClass().toString(),
e);
+        }
+        PropertyDescriptor[] sorted = new PropertyDescriptor[propertyNames.length];
+        for (int i = 0; i < propertyNames.length; i++) {
+            String propertyName = propertyNames[i];
+            if (propertyName == null)
+                throw new NullPointerException("propertyName can't be null: " + i);
+            boolean found = false;
+            for (int j = 0; j < descriptors.length; j++) {
+                PropertyDescriptor descriptor = descriptors[j];
+                if (propertyName.equals(descriptor.getName())) {
+                    sorted[i] = descriptor;
+                    found = true;
+                    break;
+                }
+            }
+            if (!found)
+                throw new RuntimeException("Couldn't find bean property: "
+                        + bean.getClass() + " " + propertyName);
+        }
+        fillStatementWithBean(stmt, bean, sorted);
+    }
+
+    /**
      * Returns the <code>DataSource</code> this runner is using.  
      * <code>QueryRunner</code> methods always call this method to get the
      * <code>DataSource</code> so subclasses can provide specialized
@@ -205,11 +339,12 @@
      * @param rsh The handler that converts the results into an object.
      * @return The object returned by the handler.
      * @throws SQLException if a database access error occurs
+     * @deprecated Use {@link #query(Connection,String,ResultSetHandler,Object[])} instead
      */
     public Object query(Connection conn, String sql, Object param,
             ResultSetHandler rsh) throws SQLException {
 
-        return this.query(conn, sql, new Object[] { param }, rsh);
+        return this.query(conn, sql, rsh, new Object[] { param });
     }
 
     /**
@@ -222,9 +357,26 @@
      * @param rsh The handler that converts the results into an object.
      * @return The object returned by the handler.
      * @throws SQLException if a database access error occurs
+     * @deprecated Use {@link #query(Connection,String,ResultSetHandler,Object[])} instead
      */
     public Object query(Connection conn, String sql, Object[] params,
             ResultSetHandler rsh) throws SQLException {
+                return query(conn, sql, rsh, params);
+            }
+
+    /**
+     * Execute an SQL SELECT query with replacement parameters.  The
+     * caller is responsible for closing the connection.
+     * 
+     * @param conn The connection to execute the query in.
+     * @param sql The query to execute.
+     * @param rsh The handler that converts the results into an object.
+     * @param params The replacement parameters.
+     * @return The object returned by the handler.
+     * @throws SQLException if a database access error occurs
+     */
+    public Object query(Connection conn, String sql, ResultSetHandler rsh,
+            Object[] params) throws SQLException {
 
         PreparedStatement stmt = null;
         ResultSet rs = null;
@@ -263,7 +415,7 @@
     public Object query(Connection conn, String sql, ResultSetHandler rsh)
         throws SQLException {
 
-        return this.query(conn, sql, (Object[]) null, rsh);
+        return this.query(conn, sql, rsh, (Object[]) null);
     }
 
     /**
@@ -278,11 +430,12 @@
      * 
      * @return An object generated by the handler.
      * @throws SQLException if a database access error occurs
+     * @deprecated Use {@link #query(String,ResultSetHandler,Object[])} instead
      */
     public Object query(String sql, Object param, ResultSetHandler rsh)
         throws SQLException {
 
-        return this.query(sql, new Object[] { param }, rsh);
+        return this.query(sql, rsh, new Object[] { param });
     }
 
     /**
@@ -299,14 +452,33 @@
      * 
      * @return An object generated by the handler.
      * @throws SQLException if a database access error occurs
+     * @deprecated Use {@link #query(String,ResultSetHandler,Object[])} instead
      */
     public Object query(String sql, Object[] params, ResultSetHandler rsh)
         throws SQLException {
+            return query(sql, rsh, params);
+        }
+
+    /**
+     * Executes the given SELECT SQL query and returns a result object.
+     * The <code>Connection</code> is retrieved from the 
+     * <code>DataSource</code> set in the constructor.
+     * 
+     * @param sql The SQL statement to execute.
+     * @param rsh The handler used to create the result object from 
+     * the <code>ResultSet</code>.
+     * @param params Initialize the PreparedStatement's IN parameters with 
+     * this array.
+     * @return An object generated by the handler.
+     * @throws SQLException if a database access error occurs
+     */
+    public Object query(String sql, ResultSetHandler rsh, Object[] params)
+        throws SQLException {
 
         Connection conn = this.prepareConnection();
 
         try {
-            return this.query(conn, sql, params, rsh);
+            return this.query(conn, sql, rsh, params);
         } finally {
             close(conn);
         }
@@ -325,7 +497,7 @@
      * @throws SQLException if a database access error occurs
      */
     public Object query(String sql, ResultSetHandler rsh) throws SQLException {
-        return this.query(sql, (Object[]) null, rsh);
+        return this.query(sql, rsh, (Object[]) null);
     }
 
     /**
@@ -344,7 +516,9 @@
     protected void rethrow(SQLException cause, String sql, Object[] params)
         throws SQLException {
 
-        StringBuffer msg = new StringBuffer(cause.getMessage());
+        String causeMessage = cause.getMessage();
+        if (causeMessage == null) causeMessage = "";
+        StringBuffer msg = new StringBuffer(causeMessage);
 
         msg.append(" Query: ");
         msg.append(sql);

Modified: commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/ArrayListHandler.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/ArrayListHandler.java?rev=747724&r1=747723&r2=747724&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/ArrayListHandler.java
(original)
+++ commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/ArrayListHandler.java
Wed Feb 25 10:01:31 2009
@@ -28,7 +28,7 @@
  * 
  * @see org.apache.commons.dbutils.ResultSetHandler
  */
-public class ArrayListHandler extends GenericListHandler {
+public class ArrayListHandler extends AbstractListHandler {
 
     /**
      * The RowProcessor implementation to use when converting rows 
@@ -62,7 +62,7 @@
      * @return <code>Object[]</code>, never <code>null</code>.
      * 
      * @throws SQLException if a database access error occurs
-     * @see org.apache.commons.dbutils.handlers.GenericListHandler#handle(ResultSet)
+     * @see org.apache.commons.dbutils.handlers.AbstractListHandler#handle(ResultSet)
      */
     protected Object handleRow(ResultSet rs) throws SQLException {
         return this.convert.toArray(rs);

Modified: commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/BeanListHandler.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/BeanListHandler.java?rev=747724&r1=747723&r2=747724&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/BeanListHandler.java
(original)
+++ commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/BeanListHandler.java
Wed Feb 25 10:01:31 2009
@@ -19,6 +19,7 @@
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
+import org.apache.commons.dbutils.ResultSetHandler;
 import org.apache.commons.dbutils.RowProcessor;
 
 /**
@@ -28,7 +29,7 @@
  * 
  * @see org.apache.commons.dbutils.ResultSetHandler
  */
-public class BeanListHandler extends GenericListHandler {
+public class BeanListHandler implements ResultSetHandler {
 
     /**
      * The Class of beans produced by this handler.
@@ -65,16 +66,17 @@
     }
 
     /**
-     * Convert the <code>ResultSet</code> row into a bean with
+     * Convert the whole <code>ResultSet</code> into a List of beans with
      * the <code>Class</code> given in the constructor.
      * 
-     * @return A bean, never <code>null</code>.
+     * @param rs The <code>ResultSet</code> to handle.
+     * 
+     * @return A List of beans, never <code>null</code>.
      * 
      * @throws SQLException if a database access error occurs
-     * @see org.apache.commons.dbutils.handlers.GenericListHandler#handle(ResultSet)
+     * @see org.apache.commons.dbutils.RowProcessor#toBeanList(ResultSet, Class)
      */
-    protected Object handleRow(ResultSet rs) throws SQLException {
-        return this.convert.toBean(rs, type);
+    public Object handle(ResultSet rs) throws SQLException {
+        return this.convert.toBeanList(rs, type);
     }
-
 }

Modified: commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/ColumnListHandler.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/ColumnListHandler.java?rev=747724&r1=747723&r2=747724&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/ColumnListHandler.java
(original)
+++ commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/ColumnListHandler.java
Wed Feb 25 10:01:31 2009
@@ -27,7 +27,7 @@
  * @see org.apache.commons.dbutils.ResultSetHandler
  * @since DbUtils 1.1
  */
-public class ColumnListHandler extends GenericListHandler {
+public class ColumnListHandler extends AbstractListHandler {
 
     /**
      * The column number to retrieve.
@@ -75,7 +75,7 @@
      * 
      * @throws SQLException if a database access error occurs
      * 
-     * @see org.apache.commons.dbutils.handlers.GenericListHandler#handle(ResultSet)
+     * @see org.apache.commons.dbutils.handlers.AbstractListHandler#handle(ResultSet)
      */
    protected Object handleRow(ResultSet rs) throws SQLException {
         if (this.columnName == null) {

Modified: commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/MapListHandler.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/MapListHandler.java?rev=747724&r1=747723&r2=747724&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/MapListHandler.java
(original)
+++ commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/handlers/MapListHandler.java
Wed Feb 25 10:01:31 2009
@@ -28,7 +28,7 @@
  * 
  * @see org.apache.commons.dbutils.ResultSetHandler
  */
-public class MapListHandler extends GenericListHandler {
+public class MapListHandler extends AbstractListHandler {
 
     /**
      * The RowProcessor implementation to use when converting rows 
@@ -62,7 +62,7 @@
      * 
      * @throws SQLException if a database access error occurs
      * 
-     * @see org.apache.commons.dbutils.handlers.GenericListHandler#handle(ResultSet)
+     * @see org.apache.commons.dbutils.handlers.AbstractListHandler#handle(ResultSet)
      */
     protected Object handleRow(ResultSet rs) throws SQLException {
         return this.convert.toMap(rs);

Modified: commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/BaseTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/BaseTestCase.java?rev=747724&r1=747723&r2=747724&view=diff
==============================================================================
--- commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/BaseTestCase.java (original)
+++ commons/proper/dbutils/trunk/src/test/org/apache/commons/dbutils/BaseTestCase.java Wed
Feb 25 10:01:31 2009
@@ -144,6 +144,7 @@
         suite.addTestSuite(ProxyFactoryTest.class);
         suite.addTestSuite(ResultSetIteratorTest.class);
         suite.addTestSuite(QueryLoaderTest.class);
+        suite.addTestSuite(QueryRunnerTest.class);
 
         // test handler implementations
         suite.addTestSuite(ArrayHandlerTest.class);



Mime
View raw message