commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wspe...@apache.org
Subject svn commit: r1481176 - in /commons/proper/dbutils/branches/2_0/src/main/java/org/apache/commons/dbutils2: QueryExecutor.java handlers/ArrayHandler.java
Date Fri, 10 May 2013 20:17:24 GMT
Author: wspeirs
Date: Fri May 10 20:17:24 2013
New Revision: 1481176

URL: http://svn.apache.org/r1481176
Log:
Changed QueryExecutor to be public and ArrayHandler to be generic

Modified:
    commons/proper/dbutils/branches/2_0/src/main/java/org/apache/commons/dbutils2/QueryExecutor.java
    commons/proper/dbutils/branches/2_0/src/main/java/org/apache/commons/dbutils2/handlers/ArrayHandler.java

Modified: commons/proper/dbutils/branches/2_0/src/main/java/org/apache/commons/dbutils2/QueryExecutor.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/branches/2_0/src/main/java/org/apache/commons/dbutils2/QueryExecutor.java?rev=1481176&r1=1481175&r2=1481176&view=diff
==============================================================================
--- commons/proper/dbutils/branches/2_0/src/main/java/org/apache/commons/dbutils2/QueryExecutor.java
(original)
+++ commons/proper/dbutils/branches/2_0/src/main/java/org/apache/commons/dbutils2/QueryExecutor.java
Fri May 10 20:17:24 2013
@@ -25,7 +25,7 @@ import java.sql.SQLException;
  *
  * @since 2.0
  */
-class QueryExecutor extends AbstractExecutor<QueryExecutor> {
+public class QueryExecutor extends AbstractExecutor<QueryExecutor> {
 
     private final boolean closeConn;
 

Modified: commons/proper/dbutils/branches/2_0/src/main/java/org/apache/commons/dbutils2/handlers/ArrayHandler.java
URL: http://svn.apache.org/viewvc/commons/proper/dbutils/branches/2_0/src/main/java/org/apache/commons/dbutils2/handlers/ArrayHandler.java?rev=1481176&r1=1481175&r2=1481176&view=diff
==============================================================================
--- commons/proper/dbutils/branches/2_0/src/main/java/org/apache/commons/dbutils2/handlers/ArrayHandler.java
(original)
+++ commons/proper/dbutils/branches/2_0/src/main/java/org/apache/commons/dbutils2/handlers/ArrayHandler.java
Fri May 10 20:17:24 2013
@@ -25,12 +25,12 @@ import org.apache.commons.dbutils2.RowPr
 
 /**
  * <code>ResultSetHandler</code> implementation that converts a
- * <code>ResultSet</code> into an <code>Object[]</code>. This class
is
+ * <code>ResultSet</code> into an <code>T[]</code>. This class is
  * thread safe.
  *
  * @see org.apache.commons.dbutils2.ResultSetHandler
  */
-public class ArrayHandler implements ResultSetHandler<Object[]> {
+public class ArrayHandler<T> implements ResultSetHandler<T[]> {
 
     /**
      * Singleton processor instance that handlers share to save memory.  Notice
@@ -65,17 +65,17 @@ public class ArrayHandler implements Res
     }
 
     /**
-     * Places the column values from the first row in an <code>Object[]</code>.
+     * Places the column values from the first row in an <code>T[]</code>.
      * @param rs <code>ResultSet</code> to process.
-     * @return An Object[] or <code>null</code> if there are no rows in the
+     * @return An T[] or <code>null</code> if there are no rows in the
      * <code>ResultSet</code>.
      *
      * @throws SQLException if a database access error occurs
      * @see org.apache.commons.dbutils2.ResultSetHandler#handle(java.sql.ResultSet)
      */
     @Override
-    public Object[] handle(ResultSet rs) throws SQLException {
-        return rs.next() ? this.convert.toArray(rs) : null;
+    public T[] handle(ResultSet rs) throws SQLException {
+        return (T[]) (rs.next() ? this.convert.toArray(rs) : null);
     }
 
 }



Mime
View raw message