cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1577579 - in /cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne: access/trans/ dba/oracle/
Date Fri, 14 Mar 2014 15:43:16 GMT
Author: aadamchik
Date: Fri Mar 14 15:43:15 2014
New Revision: 1577579

URL: http://svn.apache.org/r1577579
Log:
CAY-1911 BatchQuery refactoring - make Iterable

preliminary refactoring - localizing Oracle LOB hacks, making them private to OracleAdapter

Added:
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBBatchQueryBuilder.java
      - copied, changed from r1577571, cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/LOBBatchQueryBuilder.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBInsertBatchQueryBuilder.java
      - copied, changed from r1577571, cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/LOBInsertBatchQueryBuilder.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBUpdateBatchQueryBuilder.java
      - copied, changed from r1577571, cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/LOBUpdateBatchQueryBuilder.java
Removed:
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/LOBBatchQueryBuilder.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/LOBInsertBatchQueryBuilder.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/LOBUpdateBatchQueryBuilder.java
Modified:
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBBatchAction.java

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBBatchAction.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBBatchAction.java?rev=1577579&r1=1577578&r2=1577579&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBBatchAction.java
(original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBBatchAction.java
Fri Mar 14 15:43:15 2014
@@ -34,9 +34,6 @@ import java.util.List;
 import org.apache.cayenne.CayenneException;
 import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.access.OperationObserver;
-import org.apache.cayenne.access.trans.LOBBatchQueryBuilder;
-import org.apache.cayenne.access.trans.LOBInsertBatchQueryBuilder;
-import org.apache.cayenne.access.trans.LOBUpdateBatchQueryBuilder;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.log.JdbcEventLogger;
 import org.apache.cayenne.map.DbAttribute;
@@ -68,11 +65,11 @@ class OracleLOBBatchAction implements SQ
 
     public void performAction(Connection connection, OperationObserver observer) throws SQLException,
Exception {
 
-        LOBBatchQueryBuilder queryBuilder;
+        OracleLOBBatchQueryBuilder queryBuilder;
         if (query instanceof InsertBatchQuery) {
-            queryBuilder = new LOBInsertBatchQueryBuilder((InsertBatchQuery) query, getAdapter());
+            queryBuilder = new OracleLOBInsertBatchQueryBuilder((InsertBatchQuery) query,
getAdapter());
         } else if (query instanceof UpdateBatchQuery) {
-            queryBuilder = new LOBUpdateBatchQueryBuilder((UpdateBatchQuery) query, getAdapter());
+            queryBuilder = new OracleLOBUpdateBatchQueryBuilder((UpdateBatchQuery) query,
getAdapter());
         } else {
             throw new CayenneException("Unsupported batch type for special LOB processing:
" + query);
         }
@@ -126,7 +123,7 @@ class OracleLOBBatchAction implements SQ
         }
     }
 
-    void processLOBRow(Connection con, LOBBatchQueryBuilder queryBuilder, OracleLOBBatchQueryWrapper
selectQuery,
+    void processLOBRow(Connection con, OracleLOBBatchQueryBuilder queryBuilder, OracleLOBBatchQueryWrapper
selectQuery,
             List<DbAttribute> qualifierAttributes) throws SQLException, Exception {
 
         List<DbAttribute> lobAttributes = selectQuery.getDbAttributesForUpdatedLOBColumns();

Copied: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBBatchQueryBuilder.java
(from r1577571, cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/LOBBatchQueryBuilder.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBBatchQueryBuilder.java?p2=cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBBatchQueryBuilder.java&p1=cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/LOBBatchQueryBuilder.java&r1=1577571&r2=1577579&rev=1577579&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/LOBBatchQueryBuilder.java
(original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBBatchQueryBuilder.java
Fri Mar 14 15:43:15 2014
@@ -17,7 +17,7 @@
  *  under the License.
  ****************************************************************/
 
-package org.apache.cayenne.access.trans;
+package org.apache.cayenne.dba.oracle;
 
 import java.sql.PreparedStatement;
 import java.sql.SQLException;
@@ -26,6 +26,7 @@ import java.util.Iterator;
 import java.util.List;
 
 import org.apache.cayenne.CayenneRuntimeException;
+import org.apache.cayenne.access.trans.BatchQueryBuilder;
 import org.apache.cayenne.dba.DbAdapter;
 import org.apache.cayenne.dba.QuotingStrategy;
 import org.apache.cayenne.dba.TypesMapping;
@@ -36,18 +37,18 @@ import org.apache.cayenne.query.BatchQue
  * Superclass of query builders for the DML operations involving LOBs.
  * 
  */
-public abstract class LOBBatchQueryBuilder extends BatchQueryBuilder {
+abstract class OracleLOBBatchQueryBuilder extends BatchQueryBuilder {
 
     protected String newClobFunction;
     protected String newBlobFunction;
 
-    public LOBBatchQueryBuilder(BatchQuery query, DbAdapter adapter) {
+    OracleLOBBatchQueryBuilder(BatchQuery query, DbAdapter adapter) {
         super(query, adapter);
     }
 
-    public abstract List getValuesForLOBUpdateParameters();
+    abstract List getValuesForLOBUpdateParameters();
 
-    public String createLOBSelectString(List selectedLOBAttributes, List qualifierAttributes)
{
+    String createLOBSelectString(List selectedLOBAttributes, List qualifierAttributes) {
 
         QuotingStrategy strategy = getAdapter().getQuotingStrategy();
 
@@ -131,19 +132,11 @@ public abstract class LOBBatchQueryBuild
         return value == null || (type != Types.BLOB && type != Types.CLOB);
     }
 
-    public String getNewBlobFunction() {
-        return newBlobFunction;
-    }
-
-    public String getNewClobFunction() {
-        return newClobFunction;
-    }
-
-    public void setNewBlobFunction(String string) {
+    void setNewBlobFunction(String string) {
         newBlobFunction = string;
     }
 
-    public void setNewClobFunction(String string) {
+    void setNewClobFunction(String string) {
         newClobFunction = string;
     }
 }

Copied: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBInsertBatchQueryBuilder.java
(from r1577571, cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/LOBInsertBatchQueryBuilder.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBInsertBatchQueryBuilder.java?p2=cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBInsertBatchQueryBuilder.java&p1=cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/LOBInsertBatchQueryBuilder.java&r1=1577571&r2=1577579&rev=1577579&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/LOBInsertBatchQueryBuilder.java
(original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBInsertBatchQueryBuilder.java
Fri Mar 14 15:43:15 2014
@@ -17,7 +17,7 @@
  *  under the License.
  ****************************************************************/
 
-package org.apache.cayenne.access.trans;
+package org.apache.cayenne.dba.oracle;
 
 import java.util.ArrayList;
 import java.util.Iterator;
@@ -28,14 +28,14 @@ import org.apache.cayenne.dba.QuotingStr
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.query.InsertBatchQuery;
 
-public class LOBInsertBatchQueryBuilder extends LOBBatchQueryBuilder {
+class OracleLOBInsertBatchQueryBuilder extends OracleLOBBatchQueryBuilder {
 
-    public LOBInsertBatchQueryBuilder(InsertBatchQuery query, DbAdapter adapter) {
+    OracleLOBInsertBatchQueryBuilder(InsertBatchQuery query, DbAdapter adapter) {
         super(query, adapter);
     }
 
     @Override
-    public List getValuesForLOBUpdateParameters() {
+    List getValuesForLOBUpdateParameters() {
         List<DbAttribute> dbAttributes = query.getDbAttributes();
         int len = dbAttributes.size();
 

Copied: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBUpdateBatchQueryBuilder.java
(from r1577571, cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/LOBUpdateBatchQueryBuilder.java)
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBUpdateBatchQueryBuilder.java?p2=cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBUpdateBatchQueryBuilder.java&p1=cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/LOBUpdateBatchQueryBuilder.java&r1=1577571&r2=1577579&rev=1577579&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/LOBUpdateBatchQueryBuilder.java
(original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBUpdateBatchQueryBuilder.java
Fri Mar 14 15:43:15 2014
@@ -17,7 +17,7 @@
  *  under the License.
  ****************************************************************/
 
-package org.apache.cayenne.access.trans;
+package org.apache.cayenne.dba.oracle;
 
 import java.util.ArrayList;
 import java.util.Iterator;
@@ -28,14 +28,14 @@ import org.apache.cayenne.dba.QuotingStr
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.query.UpdateBatchQuery;
 
-public class LOBUpdateBatchQueryBuilder extends LOBBatchQueryBuilder {
+class OracleLOBUpdateBatchQueryBuilder extends OracleLOBBatchQueryBuilder {
 
-    public LOBUpdateBatchQueryBuilder(UpdateBatchQuery query, DbAdapter adapter) {
+    OracleLOBUpdateBatchQueryBuilder(UpdateBatchQuery query, DbAdapter adapter) {
         super(query, adapter);
     }
 
     @Override
-    public List getValuesForLOBUpdateParameters() {
+    List getValuesForLOBUpdateParameters() {
         int len = query.getDbAttributes().size();
         UpdateBatchQuery updateBatch = (UpdateBatchQuery) query;
 



Mime
View raw message