cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1576774 [1/2] - in /cayenne/main/trunk/cayenne-server/src: main/java/org/apache/cayenne/access/ main/java/org/apache/cayenne/access/jdbc/ main/java/org/apache/cayenne/configuration/server/ main/java/org/apache/cayenne/dba/ main/java/org/ap...
Date Wed, 12 Mar 2014 15:13:18 GMT
Author: aadamchik
Date: Wed Mar 12 15:13:16 2014
New Revision: 1576774

URL: http://svn.apache.org/r1576774
Log:
CAY-1907 RowReaderFactory

Added:
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/DefaultRowReaderFactory.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/RowReaderFactory.java
      - copied, changed from r1576629, cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteActionBuilder.java
Modified:
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/DataNode.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/BaseRowReader.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/BaseSQLAction.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/BatchAction.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/EJBQLAction.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/JDBCResultIterator.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/ProcedureAction.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SQLTemplateAction.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SelectAction.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/DataDomainProvider.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/ServerModule.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/JdbcActionBuilder.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/JdbcAdapter.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/db2/DB2ActionBuilder.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/db2/DB2Adapter.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/db2/DB2ProcedureAction.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseActionBuilder.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseAdapter.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLActionBuilder.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLDBAdapter.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLSelectAction.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/ingres/IngresActionBuilder.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/ingres/IngresAdapter.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/ingres/IngresSelectAction.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/mysql/MySQLActionBuilder.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/mysql/MySQLAdapter.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/mysql/MySQLProcedureAction.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/mysql/MySQLSelectAction.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseActionBuilder.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseAdapter.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/Oracle8ActionBuilder.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/Oracle8Adapter.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/Oracle8SQLTemplateAction.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/Oracle8SelectAction.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleActionBuilder.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleAdapter.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleBatchAction.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleProcedureAction.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleSQLTemplateAction.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleSelectAction.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/postgres/PostgresActionBuilder.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/postgres/PostgresAdapter.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/postgres/PostgresProcedureAction.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/postgres/PostgresSelectAction.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteActionBuilder.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteAdapter.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteSQLTemplateAction.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerActionBuilder.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerAdapter.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerBatchAction.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerProcedureAction.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/sqlserver/SQLServerSelectAction.java
    cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/dbsync/SchemaUpdateStrategyTest.java
    cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/BatchActionLockingTest.java
    cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/BatchActionTest.java
    cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/BindDirectiveTest.java
    cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/JDBCResultIteratorTest.java
    cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/ResultDirectiveTest.java
    cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/SQLTemplateActionTest.java
    cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/configuration/server/DataDomainProviderTest.java
    cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/SchemaBuilder.java
    cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/unit/di/server/ServerCaseDataDomainProvider.java

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/DataNode.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/DataNode.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/DataNode.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/DataNode.java Wed Mar 12 15:13:16 2014
@@ -34,6 +34,7 @@ import javax.sql.DataSource;
 import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.access.dbsync.SchemaUpdateStrategy;
 import org.apache.cayenne.access.dbsync.SkipSchemaUpdateStrategy;
+import org.apache.cayenne.access.jdbc.RowReaderFactory;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.log.JdbcEventLogger;
 import org.apache.cayenne.log.NoopJdbcEventLogger;
@@ -59,6 +60,7 @@ public class DataNode implements QueryEn
     protected Map<String, DataMap> dataMaps;
 
     private JdbcEventLogger jdbcEventLogger;
+    private RowReaderFactory rowReaderFactory;
 
     TransactionDataSource readThroughDataSource;
 
@@ -428,4 +430,18 @@ public class DataNode implements QueryEn
             throw new UnsupportedOperationException();
         }
     }
+
+    /**
+     * @since 3.2
+     */
+    public RowReaderFactory getRowReaderFactory() {
+        return rowReaderFactory;
+    }
+
+    /**
+     * @since 3.2
+     */
+    public void setRowReaderFactory(RowReaderFactory rowReaderFactory) {
+        this.rowReaderFactory = rowReaderFactory;
+    }
 }

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/BaseRowReader.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/BaseRowReader.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/BaseRowReader.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/BaseRowReader.java Wed Mar 12 15:13:16 2014
@@ -54,8 +54,10 @@ abstract class BaseRowReader<T> implemen
         }
     }
 
+    @Override
     public abstract T readRow(ResultSet resultSet);
 
+    @Override
     public void setPostProcessor(DataRowPostProcessor postProcessor) {
         this.postProcessor = postProcessor;
     }

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/BaseSQLAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/BaseSQLAction.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/BaseSQLAction.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/BaseSQLAction.java Wed Mar 12 15:13:16 2014
@@ -23,7 +23,6 @@ import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.util.List;
 
-import org.apache.cayenne.DataRow;
 import org.apache.cayenne.access.OperationObserver;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.map.EntityResolver;
@@ -38,12 +37,17 @@ import org.apache.cayenne.query.SQLActio
  */
 public abstract class BaseSQLAction implements SQLAction {
 
+    protected RowReaderFactory rowReaderFactory;
     protected JdbcAdapter adapter;
     protected EntityResolver entityResolver;
 
-    public BaseSQLAction(JdbcAdapter adapter, EntityResolver entityResolver) {
+    /**
+     * @since 3.2
+     */
+    public BaseSQLAction(JdbcAdapter adapter, EntityResolver entityResolver, RowReaderFactory rowReaderFactory) {
         this.adapter = adapter;
         this.entityResolver = entityResolver;
+        this.rowReaderFactory = rowReaderFactory;
     }
 
     public JdbcAdapter getAdapter() {
@@ -57,6 +61,7 @@ public abstract class BaseSQLAction impl
     /**
      * Helper method to process a ResultSet.
      */
+    @SuppressWarnings({ "rawtypes", "unchecked" })
     protected void readResultSet(ResultSet resultSet, RowDescriptor descriptor, Query query, OperationObserver delegate)
             throws SQLException, Exception {
 
@@ -64,14 +69,15 @@ public abstract class BaseSQLAction impl
 
         QueryMetadata metadata = query.getMetaData(getEntityResolver());
 
-        JDBCResultIterator<DataRow> resultReader = new JDBCResultIterator<DataRow>(null, resultSet, descriptor,
-                metadata);
+        RowReader<?> rowReader = rowReaderFactory.createRowReader(descriptor, metadata);
+
+        JDBCResultIterator resultReader = new JDBCResultIterator(null, resultSet, rowReader);
 
-        LimitResultIterator<DataRow> it = new LimitResultIterator<DataRow>(resultReader,
-                getInMemoryOffset(metadata.getFetchOffset()), metadata.getFetchLimit());
+        LimitResultIterator it = new LimitResultIterator(resultReader, getInMemoryOffset(metadata.getFetchOffset()),
+                metadata.getFetchLimit());
 
         if (!delegate.isIteratedResult()) {
-            List<DataRow> resultRows = it.allRows();
+            List resultRows = it.allRows();
             adapter.getJdbcEventLogger().logSelectCount(resultRows.size(), System.currentTimeMillis() - t1);
 
             delegate.nextRows(query, resultRows);

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/BatchAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/BatchAction.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/BatchAction.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/BatchAction.java Wed Mar 12 15:13:16 2014
@@ -52,8 +52,12 @@ public class BatchAction extends BaseSQL
     protected BatchQuery query;
     protected RowDescriptor keyRowDescriptor;
 
-    public BatchAction(BatchQuery batchQuery, JdbcAdapter adapter, EntityResolver entityResolver) {
-        super(adapter, entityResolver);
+    /**
+     * @since 3.2
+     */
+    public BatchAction(BatchQuery batchQuery, JdbcAdapter adapter, EntityResolver entityResolver,
+            RowReaderFactory rowReaderFactory) {
+        super(adapter, entityResolver, rowReaderFactory);
         this.query = batchQuery;
     }
 
@@ -242,6 +246,7 @@ public class BatchAction extends BaseSQL
     /**
      * Implements generated keys extraction supported in JDBC 3.0 specification.
      */
+    @SuppressWarnings({ "rawtypes", "unchecked" })
     protected void processGeneratedKeys(Statement statement, OperationObserver observer) throws SQLException,
             CayenneException {
 
@@ -280,8 +285,9 @@ public class BatchAction extends BaseSQL
             this.keyRowDescriptor = builder.getDescriptor(getAdapter().getExtendedTypes());
         }
 
-        ResultIterator iterator = new JDBCResultIterator(null, keysRS, keyRowDescriptor,
+        RowReader<?> rowReader = rowReaderFactory.createRowReader(keyRowDescriptor,
                 query.getMetaData(getEntityResolver()));
+        ResultIterator iterator = new JDBCResultIterator(null, keysRS, rowReader);
 
         observer.nextGeneratedRows(query, iterator);
     }

Added: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/DefaultRowReaderFactory.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/DefaultRowReaderFactory.java?rev=1576774&view=auto
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/DefaultRowReaderFactory.java (added)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/DefaultRowReaderFactory.java Wed Mar 12 15:13:16 2014
@@ -0,0 +1,94 @@
+/*****************************************************************
+ *   Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ ****************************************************************/
+package org.apache.cayenne.access.jdbc;
+
+import java.util.List;
+
+import org.apache.cayenne.CayenneRuntimeException;
+import org.apache.cayenne.query.EntityResultSegment;
+import org.apache.cayenne.query.QueryMetadata;
+import org.apache.cayenne.query.ScalarResultSegment;
+
+/**
+ * @since 3.2
+ */
+public class DefaultRowReaderFactory implements RowReaderFactory {
+
+    @Override
+    public RowReader<?> createRowReader(RowDescriptor descriptor, QueryMetadata queryMetadata) {
+
+        List<Object> rsMapping = queryMetadata.getResultSetMapping();
+        if (rsMapping == null) {
+            return createFullRowReader(descriptor, queryMetadata);
+        }
+
+        int resultWidth = rsMapping.size();
+        if (resultWidth == 0) {
+            throw new CayenneRuntimeException("Empty result descriptor");
+        } else if (resultWidth == 1) {
+
+            Object segment = rsMapping.get(0);
+
+            if (segment instanceof EntityResultSegment) {
+                return createEntityRowReader(descriptor, queryMetadata, (EntityResultSegment) segment);
+            } else {
+                return new ScalarRowReader<Object>(descriptor, (ScalarResultSegment) segment);
+            }
+        } else {
+            CompoundRowReader reader = new CompoundRowReader(resultWidth);
+
+            for (int i = 0; i < resultWidth; i++) {
+                Object segment = rsMapping.get(i);
+
+                if (segment instanceof EntityResultSegment) {
+                    reader.addRowReader(i,
+                            createEntityRowReader(descriptor, queryMetadata, (EntityResultSegment) segment));
+                } else {
+                    reader.addRowReader(i, new ScalarRowReader<Object>(descriptor, (ScalarResultSegment) segment));
+                }
+            }
+
+            return reader;
+        }
+    }
+
+    private RowReader<?> createEntityRowReader(RowDescriptor descriptor, QueryMetadata queryMetadata,
+            EntityResultSegment resultMetadata) {
+
+        if (queryMetadata.getPageSize() > 0) {
+            return new IdRowReader<Object>(descriptor, queryMetadata);
+        } else if (resultMetadata.getClassDescriptor() != null && resultMetadata.getClassDescriptor().hasSubclasses()) {
+            return new InheritanceAwareEntityRowReader(descriptor, resultMetadata);
+        } else {
+            return new EntityRowReader(descriptor, resultMetadata);
+        }
+    }
+
+    private RowReader<?> createFullRowReader(RowDescriptor descriptor, QueryMetadata queryMetadata) {
+
+        if (queryMetadata.getPageSize() > 0) {
+            return new IdRowReader<Object>(descriptor, queryMetadata);
+        } else if (queryMetadata.getClassDescriptor() != null && queryMetadata.getClassDescriptor().hasSubclasses()) {
+            return new InheritanceAwareRowReader(descriptor, queryMetadata);
+        } else {
+            return new FullRowReader(descriptor, queryMetadata);
+        }
+    }
+
+}

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/EJBQLAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/EJBQLAction.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/EJBQLAction.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/EJBQLAction.java Wed Mar 12 15:13:16 2014
@@ -44,13 +44,14 @@ public class EJBQLAction extends BaseSQL
     protected EJBQLQuery query;
 
     public EJBQLAction(EJBQLQuery query, SQLActionVisitor actionFactory,
-            JdbcAdapter adapter, EntityResolver entityResolver) {
-        super(adapter, entityResolver);
+            JdbcAdapter adapter, EntityResolver entityResolver, RowReaderFactory rowReaderFactory) {
+        super(adapter, entityResolver, rowReaderFactory);
 
         this.query = query;
         this.actionFactory = actionFactory;
     }
 
+    @Override
     public void performAction(Connection connection, OperationObserver observer)
             throws SQLException, Exception {
         EJBQLCompiledExpression compiledExpression = query

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/JDBCResultIterator.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/JDBCResultIterator.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/JDBCResultIterator.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/JDBCResultIterator.java Wed Mar 12 15:13:16 2014
@@ -19,7 +19,6 @@
 
 package org.apache.cayenne.access.jdbc;
 
-import java.sql.Connection;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
@@ -28,12 +27,8 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.NoSuchElementException;
 
-import org.apache.cayenne.CayenneException;
 import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.ResultIterator;
-import org.apache.cayenne.query.EntityResultSegment;
-import org.apache.cayenne.query.QueryMetadata;
-import org.apache.cayenne.query.ScalarResultSegment;
 import org.apache.cayenne.util.ResultIteratorIterator;
 
 /**
@@ -46,9 +41,6 @@ public class JDBCResultIterator<T> imple
     protected Statement statement;
     protected ResultSet resultSet;
 
-    protected RowDescriptor rowDescriptor;
-    protected QueryMetadata queryMetadata;
-
     protected boolean closed;
     protected boolean nextRow;
 
@@ -57,34 +49,15 @@ public class JDBCResultIterator<T> imple
     /**
      * Creates new JDBCResultIterator that reads from provided ResultSet.
      * 
-     * @since 3.0
-     * @deprecated since 3.2 use
-     *             {@link #JDBCResultIterator(Statement, ResultSet, RowDescriptor, QueryMetadata)}
-     */
-    @Deprecated
-    public JDBCResultIterator(Connection connection, Statement statement, ResultSet resultSet,
-            RowDescriptor descriptor, QueryMetadata queryMetadata) throws CayenneException {
-        this(statement, resultSet, descriptor, queryMetadata);
-    }
-
-    /**
-     * Creates new JDBCResultIterator that reads from provided ResultSet.
-     * 
      * @since 3.2
      */
-    public JDBCResultIterator(Statement statement, ResultSet resultSet, RowDescriptor descriptor,
-            QueryMetadata queryMetadata) throws CayenneException {
+    public JDBCResultIterator(Statement statement, ResultSet resultSet, RowReader<T> rowReader) {
 
         this.statement = statement;
         this.resultSet = resultSet;
-        this.rowDescriptor = descriptor;
-        this.queryMetadata = queryMetadata;
+        this.rowReader = rowReader;
 
         checkNextRow();
-
-        if (nextRow) {
-            this.rowReader = createRowReader(descriptor, queryMetadata);
-        }
     }
 
     /**
@@ -96,71 +69,6 @@ public class JDBCResultIterator<T> imple
     }
 
     /**
-     * RowReader factory method.
-     */
-    @SuppressWarnings("unchecked")
-    private RowReader<T> createRowReader(RowDescriptor descriptor, QueryMetadata queryMetadata) {
-
-        List<Object> rsMapping = queryMetadata.getResultSetMapping();
-        if (rsMapping != null) {
-
-            int resultWidth = rsMapping.size();
-            if (resultWidth == 0) {
-                throw new CayenneRuntimeException("Empty result descriptor");
-            } else if (resultWidth == 1) {
-
-                Object segment = rsMapping.get(0);
-
-                if (segment instanceof EntityResultSegment) {
-                    return createEntityRowReader(descriptor, (EntityResultSegment) segment);
-                } else {
-                    return new ScalarRowReader<T>(descriptor, (ScalarResultSegment) segment);
-                }
-            } else {
-                CompoundRowReader reader = new CompoundRowReader(resultWidth);
-
-                for (int i = 0; i < resultWidth; i++) {
-                    Object segment = rsMapping.get(i);
-
-                    if (segment instanceof EntityResultSegment) {
-                        reader.addRowReader(i, createEntityRowReader(descriptor, (EntityResultSegment) segment));
-                    } else {
-                        reader.addRowReader(i, new ScalarRowReader<Object>(descriptor, (ScalarResultSegment) segment));
-                    }
-                }
-
-                return (RowReader<T>) reader;
-            }
-        } else {
-            return createFullRowReader(descriptor, queryMetadata);
-        }
-    }
-
-    @SuppressWarnings("unchecked")
-    private RowReader<T> createEntityRowReader(RowDescriptor descriptor, EntityResultSegment resultMetadata) {
-
-        if (queryMetadata.getPageSize() > 0) {
-            return new IdRowReader<T>(descriptor, queryMetadata);
-        } else if (resultMetadata.getClassDescriptor() != null && resultMetadata.getClassDescriptor().hasSubclasses()) {
-            return (RowReader<T>) new InheritanceAwareEntityRowReader(descriptor, resultMetadata);
-        } else {
-            return (RowReader<T>) new EntityRowReader(descriptor, resultMetadata);
-        }
-    }
-
-    @SuppressWarnings("unchecked")
-    private RowReader<T> createFullRowReader(RowDescriptor descriptor, QueryMetadata queryMetadata) {
-
-        if (queryMetadata.getPageSize() > 0) {
-            return new IdRowReader<T>(descriptor, queryMetadata);
-        } else if (queryMetadata.getClassDescriptor() != null && queryMetadata.getClassDescriptor().hasSubclasses()) {
-            return (RowReader<T>) new InheritanceAwareRowReader(descriptor, queryMetadata);
-        } else {
-            return (RowReader<T>) new FullRowReader(descriptor, queryMetadata);
-        }
-    }
-
-    /**
      * @since 3.0
      */
     @Override
@@ -278,11 +186,7 @@ public class JDBCResultIterator<T> imple
     public void setClosingConnection(boolean flag) {
         // noop
     }
-
-    public RowDescriptor getRowDescriptor() {
-        return rowDescriptor;
-    }
-
+    
     // TODO: andrus 11/27/2008 refactor the postprocessor hack into a special
     // row reader.
     void setPostProcessor(DataRowPostProcessor postProcessor) {

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/ProcedureAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/ProcedureAction.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/ProcedureAction.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/ProcedureAction.java Wed Mar 12 15:13:16 2014
@@ -53,12 +53,16 @@ public class ProcedureAction extends Bas
      */
     protected int processedResultSets;
 
-    public ProcedureAction(ProcedureQuery query, JdbcAdapter adapter,
-            EntityResolver entityResolver) {
-        super(adapter, entityResolver);
+    /**
+     * @since 3.2
+     */
+    public ProcedureAction(ProcedureQuery query, JdbcAdapter adapter, EntityResolver entityResolver,
+            RowReaderFactory rowReaderFactory) {
+        super(adapter, entityResolver, rowReaderFactory);
         this.query = query;
     }
 
+    @Override
     public void performAction(Connection connection, OperationObserver observer)
             throws SQLException, Exception {
 

Copied: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/RowReaderFactory.java (from r1576629, cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteActionBuilder.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/RowReaderFactory.java?p2=cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/RowReaderFactory.java&p1=cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteActionBuilder.java&r1=1576629&r2=1576774&rev=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/sqlite/SQLiteActionBuilder.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/RowReaderFactory.java Wed Mar 12 15:13:16 2014
@@ -16,25 +16,16 @@
  *  specific language governing permissions and limitations
  *  under the License.
  ****************************************************************/
-package org.apache.cayenne.dba.sqlite;
+package org.apache.cayenne.access.jdbc;
 
-import org.apache.cayenne.dba.JdbcActionBuilder;
-import org.apache.cayenne.dba.JdbcAdapter;
-import org.apache.cayenne.map.EntityResolver;
-import org.apache.cayenne.query.SQLAction;
-import org.apache.cayenne.query.SQLTemplate;
+import org.apache.cayenne.query.QueryMetadata;
 
 /**
- * @since 3.0
+ * Creates RowReader instances for executed queries.
+ * 
+ * @since 3.2
  */
-class SQLiteActionBuilder extends JdbcActionBuilder {
+public interface RowReaderFactory {
 
-    SQLiteActionBuilder(JdbcAdapter adapter, EntityResolver resolver) {
-        super(adapter, resolver);
-    }
-
-    @Override
-    public SQLAction sqlAction(SQLTemplate query) {
-        return new SQLiteSQLTemplateAction(query, adapter, getEntityResolver());
-    }
+    RowReader<?> createRowReader(RowDescriptor descriptor, QueryMetadata queryMetadata);
 }

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SQLTemplateAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SQLTemplateAction.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SQLTemplateAction.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SQLTemplateAction.java Wed Mar 12 15:13:16 2014
@@ -63,13 +63,16 @@ public class SQLTemplateAction implement
     protected QueryMetadata queryMetadata;
 
     protected DbEntity dbEntity;
+    private RowReaderFactory rowReaderFactory;
 
     /**
-     * @since 3.0
+     * @since 3.2
      */
-    public SQLTemplateAction(SQLTemplate query, JdbcAdapter adapter, EntityResolver entityResolver) {
+    public SQLTemplateAction(SQLTemplate query, JdbcAdapter adapter, EntityResolver entityResolver,
+            RowReaderFactory rowReaderFactory) {
         this.query = query;
         this.adapter = adapter;
+        this.rowReaderFactory = rowReaderFactory;
         this.queryMetadata = query.getMetaData(entityResolver);
         this.dbEntity = query.getMetaData(entityResolver).getDbEntity();
     }
@@ -188,6 +191,7 @@ public class SQLTemplateAction implement
         }
     }
 
+    @SuppressWarnings({ "unchecked", "rawtypes" })
     protected void processSelectResult(SQLStatement compiled, Connection connection, Statement statement,
             ResultSet resultSet, OperationObserver callback, final long startTime) throws Exception {
 
@@ -195,9 +199,9 @@ public class SQLTemplateAction implement
 
         ExtendedTypeMap types = getAdapter().getExtendedTypes();
         RowDescriptorBuilder builder = configureRowDescriptorBuilder(compiled, resultSet);
+        RowReader<?> rowReader = rowReaderFactory.createRowReader(builder.getDescriptor(types), queryMetadata);
 
-        JDBCResultIterator result = new JDBCResultIterator(statement, resultSet, builder.getDescriptor(types),
-                queryMetadata);
+        JDBCResultIterator result = new JDBCResultIterator(statement, resultSet, rowReader);
 
         ResultIterator it = result;
 

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SelectAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SelectAction.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SelectAction.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SelectAction.java Wed Mar 12 15:13:16 2014
@@ -45,8 +45,12 @@ public class SelectAction extends BaseSQ
 
     protected SelectQuery<?> query;
 
-    public SelectAction(SelectQuery<?> query, JdbcAdapter adapter, EntityResolver entityResolver) {
-        super(adapter, entityResolver);
+    /**
+     * @since 3.2
+     */
+    public SelectAction(SelectQuery<?> query, JdbcAdapter adapter, EntityResolver entityResolver,
+            RowReaderFactory rowReaderFactory) {
+        super(adapter, entityResolver, rowReaderFactory);
         this.query = query;
     }
 
@@ -60,6 +64,7 @@ public class SelectAction extends BaseSQ
         return translator;
     }
 
+    @SuppressWarnings({ "unchecked", "rawtypes" })
     @Override
     public void performAction(Connection connection, OperationObserver observer) throws SQLException, Exception {
 
@@ -86,8 +91,10 @@ public class SelectAction extends BaseSQ
         QueryMetadata md = query.getMetaData(getEntityResolver());
         RowDescriptor descriptor = new RowDescriptorBuilder().setColumns(translator.getResultColumns()).getDescriptor(
                 getAdapter().getExtendedTypes());
+        
+        RowReader<?> rowReader = rowReaderFactory.createRowReader(descriptor, md);
 
-        JDBCResultIterator workerIterator = new JDBCResultIterator(prepStmt, rs, descriptor, md);
+        JDBCResultIterator workerIterator = new JDBCResultIterator(prepStmt, rs, rowReader);
 
         workerIterator.setPostProcessor(DataRowPostProcessor.createPostProcessor(translator));
 

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/DataDomainProvider.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/DataDomainProvider.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/DataDomainProvider.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/DataDomainProvider.java Wed Mar 12 15:13:16 2014
@@ -29,6 +29,7 @@ import org.apache.cayenne.DataChannelFil
 import org.apache.cayenne.access.DataDomain;
 import org.apache.cayenne.access.DataNode;
 import org.apache.cayenne.access.dbsync.SchemaUpdateStrategy;
+import org.apache.cayenne.access.jdbc.RowReaderFactory;
 import org.apache.cayenne.cache.NestedQueryCache;
 import org.apache.cayenne.cache.QueryCache;
 import org.apache.cayenne.configuration.ConfigurationTree;
@@ -105,6 +106,9 @@ public class DataDomainProvider implemen
 
     @Inject
     protected RuntimeProperties runtimeProperties;
+    
+    @Inject
+    protected RowReaderFactory rowReaderFactory;
 
     @Override
     public DataDomain get() throws ConfigurationException {
@@ -189,6 +193,8 @@ public class DataDomainProvider implemen
         DataNode dataNode = new DataNode(nodeDescriptor.getName());
 
         dataNode.setJdbcEventLogger(jdbcEventLogger);
+        dataNode.setRowReaderFactory(rowReaderFactory);
+        
         dataNode.setDataSourceLocation(nodeDescriptor.getParameters());
 
         DataSource dataSource = dataSourceFactory.getDataSource(nodeDescriptor);

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/ServerModule.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/ServerModule.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/ServerModule.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/configuration/server/ServerModule.java Wed Mar 12 15:13:16 2014
@@ -29,6 +29,8 @@ import org.apache.cayenne.access.dbsync.
 import org.apache.cayenne.access.dbsync.SkipSchemaUpdateStrategy;
 import org.apache.cayenne.access.jdbc.BatchQueryBuilderFactory;
 import org.apache.cayenne.access.jdbc.DefaultBatchQueryBuilderFactory;
+import org.apache.cayenne.access.jdbc.DefaultRowReaderFactory;
+import org.apache.cayenne.access.jdbc.RowReaderFactory;
 import org.apache.cayenne.access.types.BigDecimalType;
 import org.apache.cayenne.access.types.BigIntegerType;
 import org.apache.cayenne.access.types.BooleanType;
@@ -213,7 +215,7 @@ public class ServerModule implements Mod
         binder.bind(DataChannel.class).toProvider(DomainDataChannelProvider.class);
 
         binder.bind(ObjectContextFactory.class).to(DataContextFactory.class);
-
+        
         // a service to load project XML descriptors
         binder.bind(DataChannelDescriptorLoader.class).to(
                 XMLDataChannelDescriptorLoader.class);
@@ -256,5 +258,6 @@ public class ServerModule implements Mod
         binder.bind(ObjectStoreFactory.class).to(DefaultObjectStoreFactory.class);
         
         binder.bind(TransactionManager.class).to(DefaultTransactionManager.class);
+        binder.bind(RowReaderFactory.class).to(DefaultRowReaderFactory.class);
     }
 }

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/JdbcActionBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/JdbcActionBuilder.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/JdbcActionBuilder.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/JdbcActionBuilder.java Wed Mar 12 15:13:16 2014
@@ -22,6 +22,7 @@ package org.apache.cayenne.dba;
 import org.apache.cayenne.access.jdbc.BatchAction;
 import org.apache.cayenne.access.jdbc.EJBQLAction;
 import org.apache.cayenne.access.jdbc.ProcedureAction;
+import org.apache.cayenne.access.jdbc.RowReaderFactory;
 import org.apache.cayenne.access.jdbc.SQLTemplateAction;
 import org.apache.cayenne.access.jdbc.SelectAction;
 import org.apache.cayenne.log.JdbcEventLogger;
@@ -45,13 +46,19 @@ public class JdbcActionBuilder implement
     protected JdbcAdapter adapter;
     protected EntityResolver entityResolver;
     protected JdbcEventLogger logger;
+    protected RowReaderFactory rowReaderFactory;
 
-    public JdbcActionBuilder(JdbcAdapter adapter, EntityResolver resolver) {
+    /**
+     * @since 3.2
+     */
+    public JdbcActionBuilder(JdbcAdapter adapter, EntityResolver resolver, RowReaderFactory rowReaderFactory) {
         this.adapter = adapter;
         this.entityResolver = resolver;
+        this.rowReaderFactory = rowReaderFactory;
         this.logger = adapter.getJdbcEventLogger();
     }
 
+    @Override
     public SQLAction batchAction(BatchQuery query) {
         // check run strategy...
 
@@ -59,28 +66,28 @@ public class JdbcActionBuilder implement
         boolean useOptimisticLock = query.isUsingOptimisticLocking();
 
         boolean runningAsBatch = !useOptimisticLock && adapter.supportsBatchUpdates();
-        BatchAction action = new BatchAction(query, adapter, entityResolver);
+        BatchAction action = new BatchAction(query, adapter, entityResolver, rowReaderFactory);
         action.setBatch(runningAsBatch);
         return action;
     }
 
     public SQLAction procedureAction(ProcedureQuery query) {
-        return new ProcedureAction(query, adapter, entityResolver);
+        return new ProcedureAction(query, adapter, entityResolver, rowReaderFactory);
     }
 
     public <T> SQLAction objectSelectAction(SelectQuery<T> query) {
-        return new SelectAction(query, adapter, entityResolver);
+        return new SelectAction(query, adapter, entityResolver, rowReaderFactory);
     }
 
     public SQLAction sqlAction(SQLTemplate query) {
-        return new SQLTemplateAction(query, adapter, entityResolver);
+        return new SQLTemplateAction(query, adapter, entityResolver, rowReaderFactory);
     }
 
     /**
      * @since 3.0
      */
     public SQLAction ejbqlAction(EJBQLQuery query) {
-        return new EJBQLAction(query, this, adapter, entityResolver);
+        return new EJBQLAction(query, this, adapter, entityResolver, rowReaderFactory);
     }
 
     /**

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/JdbcAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/JdbcAdapter.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/JdbcAdapter.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/JdbcAdapter.java Wed Mar 12 15:13:16 2014
@@ -110,6 +110,7 @@ public class JdbcAdapter implements DbAd
      * 
      * @since 1.0.4
      */
+    @Override
     public String getBatchTerminator() {
         return ";";
     }
@@ -206,6 +207,7 @@ public class JdbcAdapter implements DbAd
     /**
      * Returns primary key generator associated with this DbAdapter.
      */
+    @Override
     public PkGenerator getPkGenerator() {
         return pkGenerator;
     }
@@ -224,6 +226,7 @@ public class JdbcAdapter implements DbAd
      * 
      * @since 1.1
      */
+    @Override
     public boolean supportsUniqueConstraints() {
         return supportsUniqueConstraints;
     }
@@ -238,6 +241,7 @@ public class JdbcAdapter implements DbAd
     /**
      * @since 3.0
      */
+    @Override
     public Collection<String> dropTableStatements(DbEntity table) {
 
         StringBuilder buf = new StringBuilder("DROP TABLE ");
@@ -250,6 +254,7 @@ public class JdbcAdapter implements DbAd
      * Returns a SQL string that can be used to create database table
      * corresponding to <code>ent</code> parameter.
      */
+    @Override
     public String createTable(DbEntity entity) {
 
         StringBuffer sqlBuffer = new StringBuffer();
@@ -315,6 +320,7 @@ public class JdbcAdapter implements DbAd
      * 
      * @since 1.2
      */
+    @Override
     public void createTableAppendColumn(StringBuffer sqlBuffer, DbAttribute column) {
 
         String[] types = externalTypesForJdbcType(column.getType());
@@ -360,6 +366,7 @@ public class JdbcAdapter implements DbAd
      * 
      * @since 1.1
      */
+    @Override
     public String createUniqueConstraint(DbEntity source, Collection<DbAttribute> columns) {
 
         if (columns == null || columns.isEmpty()) {
@@ -391,6 +398,7 @@ public class JdbcAdapter implements DbAd
      * Returns a SQL string that can be used to create a foreign key constraint
      * for the relationship.
      */
+    @Override
     public String createFkConstraint(DbRelationship rel) {
 
         DbEntity source = (DbEntity) rel.getSourceEntity();
@@ -423,14 +431,17 @@ public class JdbcAdapter implements DbAd
         return buf.toString();
     }
 
+    @Override
     public String[] externalTypesForJdbcType(int type) {
         return typesHandler.externalTypesForJdbcType(type);
     }
 
+    @Override
     public ExtendedTypeMap getExtendedTypes() {
         return extendedTypes;
     }
 
+    @Override
     public DbAttribute buildAttribute(String name, String typeName, int type, int size, int scale, boolean allowNulls) {
 
         DbAttribute attr = new DbAttribute();
@@ -449,10 +460,12 @@ public class JdbcAdapter implements DbAd
         return attr;
     }
 
+    @Override
     public String tableTypeForTable() {
         return "TABLE";
     }
 
+    @Override
     public String tableTypeForView() {
         return "VIEW";
     }
@@ -460,6 +473,7 @@ public class JdbcAdapter implements DbAd
     /**
      * Creates and returns a default implementation of a qualifier translator.
      */
+    @Override
     public QualifierTranslator getQualifierTranslator(QueryAssembler queryAssembler) {
         QualifierTranslator translator = new QualifierTranslator(queryAssembler);
         translator.setCaseInsensitive(caseInsensitiveCollations);
@@ -471,10 +485,12 @@ public class JdbcAdapter implements DbAd
      * 
      * @since 1.2
      */
+    @Override
     public SQLAction getAction(Query query, DataNode node) {
-        return query.createSQLAction(new JdbcActionBuilder(this, node.getEntityResolver()));
+        return query.createSQLAction(new JdbcActionBuilder(this, node.getEntityResolver(), node.getRowReaderFactory()));
     }
 
+    @Override
     public void bindParameter(PreparedStatement statement, Object object, int pos, int sqlType, int scale)
             throws SQLException, Exception {
 
@@ -486,6 +502,7 @@ public class JdbcAdapter implements DbAd
         }
     }
 
+    @Override
     public boolean supportsBatchUpdates() {
         return this.supportsBatchUpdates;
     }
@@ -497,6 +514,7 @@ public class JdbcAdapter implements DbAd
     /**
      * @since 1.2
      */
+    @Override
     public boolean supportsGeneratedKeys() {
         return supportsGeneratedKeys;
     }

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/db2/DB2ActionBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/db2/DB2ActionBuilder.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/db2/DB2ActionBuilder.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/db2/DB2ActionBuilder.java Wed Mar 12 15:13:16 2014
@@ -18,6 +18,7 @@
  ****************************************************************/
 package org.apache.cayenne.dba.db2;
 
+import org.apache.cayenne.access.jdbc.RowReaderFactory;
 import org.apache.cayenne.dba.JdbcActionBuilder;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.map.EntityResolver;
@@ -29,12 +30,12 @@ import org.apache.cayenne.query.SQLActio
  */
 public class DB2ActionBuilder extends JdbcActionBuilder {
 
-    DB2ActionBuilder(JdbcAdapter adapter, EntityResolver resolver) {
-        super(adapter, resolver);
+    DB2ActionBuilder(JdbcAdapter adapter, EntityResolver resolver, RowReaderFactory rowReaderFactory) {
+        super(adapter, resolver, rowReaderFactory);
     }
 
     @Override
     public SQLAction procedureAction(ProcedureQuery query) {
-        return new DB2ProcedureAction(query, getAdapter(), getEntityResolver());
+        return new DB2ProcedureAction(query, getAdapter(), getEntityResolver(), rowReaderFactory);
     }
 }

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/db2/DB2Adapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/db2/DB2Adapter.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/db2/DB2Adapter.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/db2/DB2Adapter.java Wed Mar 12 15:13:16 2014
@@ -254,6 +254,6 @@ public class DB2Adapter extends JdbcAdap
      */
     @Override
     public SQLAction getAction(Query query, DataNode node) {
-        return query.createSQLAction(new DB2ActionBuilder(this, node.getEntityResolver()));
+        return query.createSQLAction(new DB2ActionBuilder(this, node.getEntityResolver(), node.getRowReaderFactory()));
     }
 }

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/db2/DB2ProcedureAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/db2/DB2ProcedureAction.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/db2/DB2ProcedureAction.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/db2/DB2ProcedureAction.java Wed Mar 12 15:13:16 2014
@@ -26,6 +26,7 @@ import java.sql.SQLException;
 import org.apache.cayenne.access.OperationObserver;
 import org.apache.cayenne.access.jdbc.ProcedureAction;
 import org.apache.cayenne.access.jdbc.RowDescriptor;
+import org.apache.cayenne.access.jdbc.RowReaderFactory;
 import org.apache.cayenne.access.trans.ProcedureTranslator;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.map.EntityResolver;
@@ -36,8 +37,9 @@ import org.apache.cayenne.query.Procedur
  */
 class DB2ProcedureAction extends ProcedureAction {
 
-    DB2ProcedureAction(ProcedureQuery query, JdbcAdapter adapter, EntityResolver entityResolver) {
-        super(query, adapter, entityResolver);
+    DB2ProcedureAction(ProcedureQuery query, JdbcAdapter adapter, EntityResolver entityResolver,
+            RowReaderFactory rowReaderFactory) {
+        super(query, adapter, entityResolver, rowReaderFactory);
     }
 
     @Override

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseActionBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseActionBuilder.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseActionBuilder.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseActionBuilder.java Wed Mar 12 15:13:16 2014
@@ -21,6 +21,7 @@ package org.apache.cayenne.dba.frontbase
 
 import java.sql.Connection;
 
+import org.apache.cayenne.access.jdbc.RowReaderFactory;
 import org.apache.cayenne.access.jdbc.SelectAction;
 import org.apache.cayenne.access.trans.SelectTranslator;
 import org.apache.cayenne.dba.JdbcActionBuilder;
@@ -31,13 +32,13 @@ import org.apache.cayenne.query.SelectQu
 
 class FrontBaseActionBuilder extends JdbcActionBuilder {
 
-    FrontBaseActionBuilder(JdbcAdapter adapter, EntityResolver resolver) {
-        super(adapter, resolver);
+    FrontBaseActionBuilder(JdbcAdapter adapter, EntityResolver resolver, RowReaderFactory rowReaderFactory) {
+        super(adapter, resolver, rowReaderFactory);
     }
 
     @Override
     public <T> SQLAction objectSelectAction(SelectQuery<T> query) {
-        return new SelectAction(query, adapter, entityResolver) {
+        return new SelectAction(query, adapter, entityResolver, rowReaderFactory) {
 
             @Override
             protected SelectTranslator createTranslator(Connection connection) {

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseAdapter.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseAdapter.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/frontbase/FrontBaseAdapter.java Wed Mar 12 15:13:16 2014
@@ -84,8 +84,8 @@ public class FrontBaseAdapter extends Jd
      */
     @Override
     public SQLAction getAction(Query query, DataNode node) {
-        return query.createSQLAction(new FrontBaseActionBuilder(this, node
-                .getEntityResolver()));
+        return query.createSQLAction(new FrontBaseActionBuilder(this, node.getEntityResolver(), node
+                .getRowReaderFactory()));
     }
 
     @Override

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLActionBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLActionBuilder.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLActionBuilder.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLActionBuilder.java Wed Mar 12 15:13:16 2014
@@ -22,6 +22,7 @@ package org.apache.cayenne.dba.hsqldb;
 import java.sql.Connection;
 
 import org.apache.cayenne.access.jdbc.ProcedureAction;
+import org.apache.cayenne.access.jdbc.RowReaderFactory;
 import org.apache.cayenne.access.trans.ProcedureTranslator;
 import org.apache.cayenne.dba.JdbcActionBuilder;
 import org.apache.cayenne.dba.JdbcAdapter;
@@ -32,18 +33,18 @@ import org.apache.cayenne.query.SelectQu
 
 class HSQLActionBuilder extends JdbcActionBuilder {
 
-    HSQLActionBuilder(JdbcAdapter adapter, EntityResolver resolver) {
-        super(adapter, resolver);
+    HSQLActionBuilder(JdbcAdapter adapter, EntityResolver resolver, RowReaderFactory rowReaderFactory) {
+        super(adapter, resolver, rowReaderFactory);
     }
 
     @Override
     public <T> SQLAction objectSelectAction(SelectQuery<T> query) {
-        return new HSQLSelectAction(query, adapter, entityResolver);
+        return new HSQLSelectAction(query, adapter, entityResolver, rowReaderFactory);
     }
 
     @Override
     public SQLAction procedureAction(ProcedureQuery query) {
-        return new ProcedureAction(query, adapter, entityResolver) {
+        return new ProcedureAction(query, adapter, entityResolver, rowReaderFactory) {
 
             @Override
             protected ProcedureTranslator createTranslator(Connection connection) {

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLDBAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLDBAdapter.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLDBAdapter.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLDBAdapter.java Wed Mar 12 15:13:16 2014
@@ -90,7 +90,7 @@ public class HSQLDBAdapter extends JdbcA
      */
     @Override
     public SQLAction getAction(Query query, DataNode node) {
-        return query.createSQLAction(new HSQLActionBuilder(this, node.getEntityResolver()));
+        return query.createSQLAction(new HSQLActionBuilder(this, node.getEntityResolver(), node.getRowReaderFactory()));
     }
 
     /**

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLSelectAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLSelectAction.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLSelectAction.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/hsqldb/HSQLSelectAction.java Wed Mar 12 15:13:16 2014
@@ -20,6 +20,7 @@ package org.apache.cayenne.dba.hsqldb;
 
 import java.sql.Connection;
 
+import org.apache.cayenne.access.jdbc.RowReaderFactory;
 import org.apache.cayenne.access.jdbc.SelectAction;
 import org.apache.cayenne.access.trans.SelectTranslator;
 import org.apache.cayenne.dba.JdbcAdapter;
@@ -31,8 +32,9 @@ import org.apache.cayenne.query.SelectQu
  */
 class HSQLSelectAction extends SelectAction {
 
-	<T> HSQLSelectAction(SelectQuery<T> query, JdbcAdapter adapter, EntityResolver entityResolver) {
-        super(query, adapter, entityResolver);
+    <T> HSQLSelectAction(SelectQuery<T> query, JdbcAdapter adapter, EntityResolver entityResolver,
+            RowReaderFactory rowReaderFactory) {
+        super(query, adapter, entityResolver, rowReaderFactory);
     }
 
     @Override

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/ingres/IngresActionBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/ingres/IngresActionBuilder.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/ingres/IngresActionBuilder.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/ingres/IngresActionBuilder.java Wed Mar 12 15:13:16 2014
@@ -18,21 +18,24 @@
  ****************************************************************/
 package org.apache.cayenne.dba.ingres;
 
+import org.apache.cayenne.access.jdbc.RowReaderFactory;
 import org.apache.cayenne.dba.JdbcActionBuilder;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.query.SQLAction;
 import org.apache.cayenne.query.SelectQuery;
 
-
 public class IngresActionBuilder extends JdbcActionBuilder {
 
-    public IngresActionBuilder(JdbcAdapter adapter, EntityResolver resolver) {
-        super(adapter, resolver);
+    /**
+     * @since 3.2
+     */
+    public IngresActionBuilder(JdbcAdapter adapter, EntityResolver resolver, RowReaderFactory rowReaderFactory) {
+        super(adapter, resolver, rowReaderFactory);
     }
 
     @Override
     public <T> SQLAction objectSelectAction(SelectQuery<T> query) {
-        return new IngresSelectAction(query, adapter, entityResolver);
-    }   
+        return new IngresSelectAction(query, adapter, entityResolver, rowReaderFactory);
+    }
 }

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/ingres/IngresAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/ingres/IngresAdapter.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/ingres/IngresAdapter.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/ingres/IngresAdapter.java Wed Mar 12 15:13:16 2014
@@ -78,7 +78,8 @@ public class IngresAdapter extends JdbcA
 
     @Override
     public SQLAction getAction(Query query, DataNode node) {
-        return query.createSQLAction(new IngresActionBuilder(this, node.getEntityResolver()));
+        return query
+                .createSQLAction(new IngresActionBuilder(this, node.getEntityResolver(), node.getRowReaderFactory()));
     }
 
     @Override

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/ingres/IngresSelectAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/ingres/IngresSelectAction.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/ingres/IngresSelectAction.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/ingres/IngresSelectAction.java Wed Mar 12 15:13:16 2014
@@ -20,6 +20,7 @@ package org.apache.cayenne.dba.ingres;
 
 import java.sql.Connection;
 
+import org.apache.cayenne.access.jdbc.RowReaderFactory;
 import org.apache.cayenne.access.jdbc.SelectAction;
 import org.apache.cayenne.access.trans.SelectTranslator;
 import org.apache.cayenne.dba.JdbcAdapter;
@@ -28,11 +29,11 @@ import org.apache.cayenne.query.SelectQu
 
 public class IngresSelectAction extends SelectAction {
 
-    public <T> IngresSelectAction(SelectQuery<T> query, JdbcAdapter adapter,
-            EntityResolver entityResolver) {
-        super(query, adapter, entityResolver);
+    public <T> IngresSelectAction(SelectQuery<T> query, JdbcAdapter adapter, EntityResolver entityResolver,
+            RowReaderFactory rowReaderFactory) {
+        super(query, adapter, entityResolver, rowReaderFactory);
     }
-    
+
     @Override
     protected int getInMemoryOffset(int queryOffset) {
         return 0;

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/mysql/MySQLActionBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/mysql/MySQLActionBuilder.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/mysql/MySQLActionBuilder.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/mysql/MySQLActionBuilder.java Wed Mar 12 15:13:16 2014
@@ -19,6 +19,7 @@
 
 package org.apache.cayenne.dba.mysql;
 
+import org.apache.cayenne.access.jdbc.RowReaderFactory;
 import org.apache.cayenne.dba.JdbcActionBuilder;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.map.EntityResolver;
@@ -31,17 +32,17 @@ import org.apache.cayenne.query.SelectQu
  */
 class MySQLActionBuilder extends JdbcActionBuilder {
 
-    MySQLActionBuilder(JdbcAdapter adapter, EntityResolver resolver) {
-        super(adapter, resolver);
+    MySQLActionBuilder(JdbcAdapter adapter, EntityResolver resolver, RowReaderFactory rowReaderFactory) {
+        super(adapter, resolver, rowReaderFactory);
     }
 
     @Override
     public <T> SQLAction objectSelectAction(SelectQuery<T> query) {
-        return new MySQLSelectAction(query, adapter, entityResolver);
+        return new MySQLSelectAction(query, adapter, entityResolver, rowReaderFactory);
     }
 
     @Override
     public SQLAction procedureAction(ProcedureQuery query) {
-        return new MySQLProcedureAction(query, getAdapter(), getEntityResolver());
+        return new MySQLProcedureAction(query, getAdapter(), getEntityResolver(), rowReaderFactory);
     }
 }

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/mysql/MySQLAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/mysql/MySQLAdapter.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/mysql/MySQLAdapter.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/mysql/MySQLAdapter.java Wed Mar 12 15:13:16 2014
@@ -124,7 +124,8 @@ public class MySQLAdapter extends JdbcAd
      */
     @Override
     public SQLAction getAction(Query query, DataNode node) {
-        return query.createSQLAction(new MySQLActionBuilder(this, node.getEntityResolver()));
+        return query
+                .createSQLAction(new MySQLActionBuilder(this, node.getEntityResolver(), node.getRowReaderFactory()));
     }
 
     /**

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/mysql/MySQLProcedureAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/mysql/MySQLProcedureAction.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/mysql/MySQLProcedureAction.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/mysql/MySQLProcedureAction.java Wed Mar 12 15:13:16 2014
@@ -26,6 +26,7 @@ import java.sql.SQLException;
 import org.apache.cayenne.access.OperationObserver;
 import org.apache.cayenne.access.jdbc.ProcedureAction;
 import org.apache.cayenne.access.jdbc.RowDescriptor;
+import org.apache.cayenne.access.jdbc.RowReaderFactory;
 import org.apache.cayenne.access.trans.ProcedureTranslator;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.map.EntityResolver;
@@ -36,9 +37,9 @@ import org.apache.cayenne.query.Procedur
  */
 class MySQLProcedureAction extends ProcedureAction {
 
-    public MySQLProcedureAction(ProcedureQuery query, JdbcAdapter adapter,
-            EntityResolver entityResolver) {
-        super(query, adapter, entityResolver);
+    public MySQLProcedureAction(ProcedureQuery query, JdbcAdapter adapter, EntityResolver entityResolver,
+            RowReaderFactory rowReaderFactory) {
+        super(query, adapter, entityResolver, rowReaderFactory);
     }
 
     @Override

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/mysql/MySQLSelectAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/mysql/MySQLSelectAction.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/mysql/MySQLSelectAction.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/mysql/MySQLSelectAction.java Wed Mar 12 15:13:16 2014
@@ -20,6 +20,7 @@ package org.apache.cayenne.dba.mysql;
 
 import java.sql.Connection;
 
+import org.apache.cayenne.access.jdbc.RowReaderFactory;
 import org.apache.cayenne.access.jdbc.SelectAction;
 import org.apache.cayenne.access.trans.SelectTranslator;
 import org.apache.cayenne.dba.JdbcAdapter;
@@ -31,9 +32,9 @@ import org.apache.cayenne.query.SelectQu
  */
 class MySQLSelectAction extends SelectAction {
 
-	<T> MySQLSelectAction(SelectQuery<T> query, JdbcAdapter adapter,
-            EntityResolver entityResolver) {
-        super(query, adapter, entityResolver);
+    <T> MySQLSelectAction(SelectQuery<T> query, JdbcAdapter adapter, EntityResolver entityResolver,
+            RowReaderFactory rowReaderFactory) {
+        super(query, adapter, entityResolver, rowReaderFactory);
     }
 
     @Override

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseActionBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseActionBuilder.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseActionBuilder.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseActionBuilder.java Wed Mar 12 15:13:16 2014
@@ -21,6 +21,7 @@ package org.apache.cayenne.dba.openbase;
 
 import java.sql.Connection;
 
+import org.apache.cayenne.access.jdbc.RowReaderFactory;
 import org.apache.cayenne.access.jdbc.SelectAction;
 import org.apache.cayenne.access.trans.SelectTranslator;
 import org.apache.cayenne.dba.JdbcActionBuilder;
@@ -34,13 +35,13 @@ import org.apache.cayenne.query.SelectQu
  */
 class OpenBaseActionBuilder extends JdbcActionBuilder {
 
-    OpenBaseActionBuilder(JdbcAdapter adapter, EntityResolver resolver) {
-        super(adapter, resolver);
+    OpenBaseActionBuilder(JdbcAdapter adapter, EntityResolver resolver, RowReaderFactory rowReaderFactory) {
+        super(adapter, resolver, rowReaderFactory);
     }
 
     @Override
     public <T> SQLAction objectSelectAction(SelectQuery<T> query) {
-       return new SelectAction(query, adapter, entityResolver) {
+        return new SelectAction(query, adapter, entityResolver, rowReaderFactory) {
 
             @Override
             protected SelectTranslator createTranslator(Connection connection) {

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseAdapter.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseAdapter.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/openbase/OpenBaseAdapter.java Wed Mar 12 15:13:16 2014
@@ -90,7 +90,7 @@ public class OpenBaseAdapter extends Jdb
     @Override
     public SQLAction getAction(Query query, DataNode node) {
         return query.createSQLAction(new OpenBaseActionBuilder(this, node
-                .getEntityResolver()));
+                .getEntityResolver(), node.getRowReaderFactory()));
     }
 
     @Override

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/Oracle8ActionBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/Oracle8ActionBuilder.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/Oracle8ActionBuilder.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/Oracle8ActionBuilder.java Wed Mar 12 15:13:16 2014
@@ -19,6 +19,7 @@
 
 package org.apache.cayenne.dba.oracle;
 
+import org.apache.cayenne.access.jdbc.RowReaderFactory;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.map.EntityResolver;
 import org.apache.cayenne.query.BatchQuery;
@@ -33,18 +34,18 @@ import org.apache.cayenne.query.SelectQu
  */
 class Oracle8ActionBuilder extends OracleActionBuilder {
 
-    Oracle8ActionBuilder(JdbcAdapter adapter, EntityResolver resolver) {
-        super(adapter, resolver);
+    Oracle8ActionBuilder(JdbcAdapter adapter, EntityResolver resolver, RowReaderFactory rowReaderFactory) {
+        super(adapter, resolver, rowReaderFactory);
     }
 
     @Override
     public SQLAction sqlAction(SQLTemplate query) {
-        return new Oracle8SQLTemplateAction(query, adapter, getEntityResolver());
+        return new Oracle8SQLTemplateAction(query, adapter, getEntityResolver(), rowReaderFactory);
     }
 
     @Override
     public <T> SQLAction objectSelectAction(SelectQuery<T> query) {
-        return new Oracle8SelectAction(query, getAdapter(), getEntityResolver());
+        return new Oracle8SelectAction(query, getAdapter(), getEntityResolver(), rowReaderFactory);
     }
 
     @Override
@@ -63,7 +64,7 @@ class Oracle8ActionBuilder extends Oracl
             OracleBatchAction action = new OracleBatchAction(
                     query,
                     adapter,
-                    getEntityResolver());
+                    getEntityResolver(), rowReaderFactory);
             action.setBatch(runningAsBatch);
             return action;
         }

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/Oracle8Adapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/Oracle8Adapter.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/Oracle8Adapter.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/Oracle8Adapter.java Wed Mar 12 15:13:16 2014
@@ -85,8 +85,8 @@ public class Oracle8Adapter extends Orac
      */
     @Override
     public SQLAction getAction(Query query, DataNode node) {
-        return query.createSQLAction(new Oracle8ActionBuilder(this, node
-                .getEntityResolver()));
+        return query.createSQLAction(new Oracle8ActionBuilder(this, node.getEntityResolver(), node
+                .getRowReaderFactory()));
     }
 
     @Override

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/Oracle8SQLTemplateAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/Oracle8SQLTemplateAction.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/Oracle8SQLTemplateAction.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/Oracle8SQLTemplateAction.java Wed Mar 12 15:13:16 2014
@@ -26,6 +26,7 @@ import java.sql.SQLException;
 import java.util.Collection;
 
 import org.apache.cayenne.access.OperationObserver;
+import org.apache.cayenne.access.jdbc.RowReaderFactory;
 import org.apache.cayenne.access.jdbc.SQLStatement;
 import org.apache.cayenne.access.jdbc.SQLTemplateAction;
 import org.apache.cayenne.dba.JdbcAdapter;
@@ -39,9 +40,9 @@ import org.apache.cayenne.query.SQLTempl
  */
 class Oracle8SQLTemplateAction extends SQLTemplateAction {
 
-    Oracle8SQLTemplateAction(SQLTemplate query, JdbcAdapter adapter,
-            EntityResolver resolver) {
-        super(query, adapter, resolver);
+    Oracle8SQLTemplateAction(SQLTemplate query, JdbcAdapter adapter, EntityResolver resolver,
+            RowReaderFactory rowReaderFactory) {
+        super(query, adapter, resolver, rowReaderFactory);
     }
 
     /**

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/Oracle8SelectAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/Oracle8SelectAction.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/Oracle8SelectAction.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/Oracle8SelectAction.java Wed Mar 12 15:13:16 2014
@@ -20,6 +20,7 @@ package org.apache.cayenne.dba.oracle;
 
 import java.sql.Connection;
 
+import org.apache.cayenne.access.jdbc.RowReaderFactory;
 import org.apache.cayenne.access.trans.SelectTranslator;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.map.EntityResolver;
@@ -30,9 +31,9 @@ import org.apache.cayenne.query.SelectQu
  */
 class Oracle8SelectAction extends OracleSelectAction {
 
-	<T> Oracle8SelectAction(SelectQuery<T> query, JdbcAdapter adapter,
-            EntityResolver entityResolver) {
-        super(query, adapter, entityResolver);
+    <T> Oracle8SelectAction(SelectQuery<T> query, JdbcAdapter adapter, EntityResolver entityResolver,
+            RowReaderFactory rowReaderFactory) {
+        super(query, adapter, entityResolver, rowReaderFactory);
     }
 
     @Override

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleActionBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleActionBuilder.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleActionBuilder.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleActionBuilder.java Wed Mar 12 15:13:16 2014
@@ -19,6 +19,7 @@
 
 package org.apache.cayenne.dba.oracle;
 
+import org.apache.cayenne.access.jdbc.RowReaderFactory;
 import org.apache.cayenne.dba.JdbcActionBuilder;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.map.EntityResolver;
@@ -33,13 +34,13 @@ import org.apache.cayenne.query.SelectQu
  */
 class OracleActionBuilder extends JdbcActionBuilder {
 
-    OracleActionBuilder(JdbcAdapter adapter, EntityResolver resolver) {
-        super(adapter, resolver);
+    OracleActionBuilder(JdbcAdapter adapter, EntityResolver resolver, RowReaderFactory rowReaderFactory) {
+        super(adapter, resolver, rowReaderFactory);
     }
 
     @Override
     public SQLAction sqlAction(SQLTemplate query) {
-        return new OracleSQLTemplateAction(query, adapter, getEntityResolver());
+        return new OracleSQLTemplateAction(query, adapter, getEntityResolver(), rowReaderFactory);
     }
 
     @Override
@@ -48,18 +49,14 @@ class OracleActionBuilder extends JdbcAc
         // special handling for LOB updates
         if (OracleAdapter.isSupportsOracleLOB() && OracleAdapter.updatesLOBColumns(query)) {
             return new OracleLOBBatchAction(query, getAdapter());
-        }
-        else {
+        } else {
 
             // optimistic locking is not supported in batches due to JDBC driver
             // limitations
             boolean useOptimisticLock = query.isUsingOptimisticLocking();
             boolean runningAsBatch = !useOptimisticLock && adapter.supportsBatchUpdates();
 
-            OracleBatchAction action = new OracleBatchAction(
-                    query,
-                    adapter,
-                    getEntityResolver());
+            OracleBatchAction action = new OracleBatchAction(query, adapter, getEntityResolver(), rowReaderFactory);
             action.setBatch(runningAsBatch);
             return action;
         }
@@ -68,11 +65,11 @@ class OracleActionBuilder extends JdbcAc
 
     @Override
     public SQLAction procedureAction(ProcedureQuery query) {
-        return new OracleProcedureAction(query, getAdapter(), getEntityResolver());
+        return new OracleProcedureAction(query, getAdapter(), getEntityResolver(), rowReaderFactory);
     }
 
     @Override
     public <T> SQLAction objectSelectAction(SelectQuery<T> query) {
-        return new OracleSelectAction(query, getAdapter(), getEntityResolver());
+        return new OracleSelectAction(query, getAdapter(), getEntityResolver(), rowReaderFactory);
     }
 }

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleAdapter.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleAdapter.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleAdapter.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleAdapter.java Wed Mar 12 15:13:16 2014
@@ -313,8 +313,8 @@ public class OracleAdapter extends JdbcA
      */
     @Override
     public SQLAction getAction(Query query, DataNode node) {
-        return query.createSQLAction(new OracleActionBuilder(this, node
-                .getEntityResolver()));
+        return query
+                .createSQLAction(new OracleActionBuilder(this, node.getEntityResolver(), node.getRowReaderFactory()));
     }
 
     /**

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleBatchAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleBatchAction.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleBatchAction.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleBatchAction.java Wed Mar 12 15:13:16 2014
@@ -21,6 +21,7 @@ package org.apache.cayenne.dba.oracle;
 
 import org.apache.cayenne.CayenneException;
 import org.apache.cayenne.access.jdbc.BatchAction;
+import org.apache.cayenne.access.jdbc.RowReaderFactory;
 import org.apache.cayenne.access.trans.BatchQueryBuilder;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.map.EntityResolver;
@@ -31,9 +32,12 @@ import org.apache.cayenne.query.BatchQue
  */
 class OracleBatchAction extends BatchAction {
 
-    OracleBatchAction(BatchQuery batchQuery, JdbcAdapter adapter,
-            EntityResolver entityResolver) {
-        super(batchQuery, adapter, entityResolver);
+    /**
+     * @since 3.2
+     */
+    OracleBatchAction(BatchQuery batchQuery, JdbcAdapter adapter, EntityResolver entityResolver,
+            RowReaderFactory rowReaderFactory) {
+        super(batchQuery, adapter, entityResolver, rowReaderFactory);
     }
 
     @Override

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleProcedureAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleProcedureAction.java?rev=1576774&r1=1576773&r2=1576774&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleProcedureAction.java (original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleProcedureAction.java Wed Mar 12 15:13:16 2014
@@ -30,6 +30,7 @@ import org.apache.cayenne.access.Operati
 import org.apache.cayenne.access.jdbc.ColumnDescriptor;
 import org.apache.cayenne.access.jdbc.ProcedureAction;
 import org.apache.cayenne.access.jdbc.RowDescriptor;
+import org.apache.cayenne.access.jdbc.RowReaderFactory;
 import org.apache.cayenne.access.types.ExtendedType;
 import org.apache.cayenne.dba.JdbcAdapter;
 import org.apache.cayenne.map.EntityResolver;
@@ -43,9 +44,9 @@ import org.apache.cayenne.query.Procedur
  */
 class OracleProcedureAction extends ProcedureAction {
 
-    OracleProcedureAction(ProcedureQuery query, JdbcAdapter adapter,
-            EntityResolver entityResolver) {
-        super(query, adapter, entityResolver);
+    OracleProcedureAction(ProcedureQuery query, JdbcAdapter adapter, EntityResolver entityResolver,
+            RowReaderFactory rowReaderFactory) {
+        super(query, adapter, entityResolver, rowReaderFactory);
     }
 
     /**



Mime
View raw message