cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1577910 - in /cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne: access/jdbc/BatchAction.java dba/oracle/OracleBatchAction.java
Date Sat, 15 Mar 2014 17:41:26 GMT
Author: aadamchik
Date: Sat Mar 15 17:41:26 2014
New Revision: 1577910

URL: http://svn.apache.org/r1577910
Log:
CAY-1912 BatchQueryBuilder refactoring

Modified:
    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/dba/oracle/OracleBatchAction.java

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=1577910&r1=1577909&r2=1577910&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
Sat Mar 15 17:41:26 2014
@@ -86,17 +86,17 @@ public class BatchAction extends BaseSQL
     @Override
     public void performAction(Connection connection, OperationObserver observer) throws SQLException,
Exception {
 
-        BatchTranslator queryBuilder = createBuilder();
+        BatchTranslator translator = createTranslator();
         boolean generatesKeys = hasGeneratedKeys();
 
         if (runningAsBatch && !generatesKeys) {
-            runAsBatch(connection, queryBuilder, observer);
+            runAsBatch(connection, translator, observer);
         } else {
-            runAsIndividualQueries(connection, queryBuilder, observer, generatesKeys);
+            runAsIndividualQueries(connection, translator, observer, generatesKeys);
         }
     }
 
-    protected BatchTranslator createBuilder() throws CayenneException {
+    protected BatchTranslator createTranslator() throws CayenneException {
         BatchTranslatorFactory factory = dataNode.getBatchQueryBuilderFactory();
 
         if (factory == null) {
@@ -114,10 +114,10 @@ public class BatchAction extends BaseSQL
         }
     }
 
-    protected void runAsBatch(Connection con, BatchTranslator queryBuilder, OperationObserver
delegate)
+    protected void runAsBatch(Connection con, BatchTranslator translator, OperationObserver
delegate)
             throws SQLException, Exception {
 
-        String queryStr = queryBuilder.createSqlString();
+        String queryStr = translator.createSqlString();
         JdbcEventLogger logger = dataNode.getJdbcEventLogger();
         boolean isLoggable = logger.isLoggable();
 
@@ -131,7 +131,7 @@ public class BatchAction extends BaseSQL
         try {
             for (BatchQueryRow row : query.getRows()) {
 
-                List<BatchParameterBinding> bindings = queryBuilder.createBindings(row);
+                List<BatchParameterBinding> bindings = translator.createBindings(row);
                 logger.logQueryParameters("batch bind", bindings);
                 bind(adapter, statement, bindings);
 
@@ -169,13 +169,13 @@ public class BatchAction extends BaseSQL
     /**
      * Executes batch as individual queries over the same prepared statement.
      */
-    protected void runAsIndividualQueries(Connection connection, BatchTranslator queryBuilder,
+    protected void runAsIndividualQueries(Connection connection, BatchTranslator translator,
             OperationObserver delegate, boolean generatesKeys) throws SQLException, Exception
{
 
         JdbcEventLogger logger = dataNode.getJdbcEventLogger();
         boolean useOptimisticLock = query.isUsingOptimisticLocking();
 
-        String queryStr = queryBuilder.createSqlString();
+        String queryStr = translator.createSqlString();
 
         // log batch SQL execution
         logger.logQuery(queryStr, Collections.EMPTY_LIST);
@@ -188,7 +188,7 @@ public class BatchAction extends BaseSQL
         try {
             for (BatchQueryRow row : query.getRows()) {
 
-                List<BatchParameterBinding> bindings = queryBuilder.createBindings(row);
+                List<BatchParameterBinding> bindings = translator.createBindings(row);
                 logger.logQueryParameters("bind", bindings);
 
                 bind(adapter, statement, bindings);

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=1577910&r1=1577909&r2=1577910&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
Sat Mar 15 17:41:26 2014
@@ -38,9 +38,9 @@ class OracleBatchAction extends BatchAct
     }
 
     @Override
-    protected BatchTranslator createBuilder() throws CayenneException {
+    protected BatchTranslator createTranslator() throws CayenneException {
         // intercept super call to configure the builder...
-        BatchTranslator builder = super.createBuilder();
+        BatchTranslator builder = super.createTranslator();
         builder.setTrimFunction(OracleAdapter.TRIM_FUNCTION);
         return builder;
     }



Mime
View raw message