cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r1577832 - in /cayenne/main/trunk/cayenne-server/src: main/java/org/apache/cayenne/access/jdbc/ main/java/org/apache/cayenne/access/trans/ main/java/org/apache/cayenne/dba/oracle/ test/java/org/apache/cayenne/access/trans/
Date Sat, 15 Mar 2014 11:55:45 GMT
Author: aadamchik
Date: Sat Mar 15 11:55:45 2014
New Revision: 1577832

URL: http://svn.apache.org/r1577832
Log:
cleanup - adapter initialized in constructor, setter is misleading

Modified:
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SoftDeleteBatchQueryBuilder.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/BatchQueryBuilder.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/DeleteBatchQueryBuilder.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/InsertBatchQueryBuilder.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/UpdateBatchQueryBuilder.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBBatchQueryBuilder.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBInsertBatchQueryBuilder.java
    cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBUpdateBatchQueryBuilder.java
    cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/trans/BatchQueryBuilderTest.java
    cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/trans/DeleteBatchQueryBuilderTest.java
    cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/trans/InsertBatchQueryBuilderTest.java
    cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/trans/UpdateBatchQueryBuilderTest.java

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SoftDeleteBatchQueryBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SoftDeleteBatchQueryBuilder.java?rev=1577832&r1=1577831&r2=1577832&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SoftDeleteBatchQueryBuilder.java
(original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SoftDeleteBatchQueryBuilder.java
Sat Mar 15 11:55:45 2014
@@ -49,7 +49,7 @@ public class SoftDeleteBatchQueryBuilder
             return super.createSqlString();
         }
 
-        QuotingStrategy strategy = getAdapter().getQuotingStrategy();
+        QuotingStrategy strategy = adapter.getQuotingStrategy();
 
         StringBuilder buffer = new StringBuilder("UPDATE ");
         buffer.append(strategy.quotedFullyQualifiedName(query.getDbEntity()));

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/BatchQueryBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/BatchQueryBuilder.java?rev=1577832&r1=1577831&r2=1577832&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/BatchQueryBuilder.java
(original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/BatchQueryBuilder.java
Sat Mar 15 11:55:45 2014
@@ -68,7 +68,7 @@ public abstract class BatchQueryBuilder 
             buf.append(trimFunction).append('(');
         }
 
-        QuotingStrategy strategy = getAdapter().getQuotingStrategy();
+        QuotingStrategy strategy = adapter.getQuotingStrategy();
 
         buf.append(strategy.quotedName(dbAttribute));
 
@@ -77,14 +77,6 @@ public abstract class BatchQueryBuilder 
         }
     }
 
-    public void setAdapter(DbAdapter adapter) {
-        this.adapter = adapter;
-    }
-
-    public DbAdapter getAdapter() {
-        return adapter;
-    }
-
     public String getTrimFunction() {
         return trimFunction;
     }

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/DeleteBatchQueryBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/DeleteBatchQueryBuilder.java?rev=1577832&r1=1577831&r2=1577832&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/DeleteBatchQueryBuilder.java
(original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/DeleteBatchQueryBuilder.java
Sat Mar 15 11:55:45 2014
@@ -43,7 +43,7 @@ public class DeleteBatchQueryBuilder ext
     @Override
     public String createSqlString() throws IOException {
 
-        QuotingStrategy strategy = getAdapter().getQuotingStrategy();
+        QuotingStrategy strategy = adapter.getQuotingStrategy();
 
         StringBuilder buffer = new StringBuilder("DELETE FROM ");
         buffer.append(strategy.quotedFullyQualifiedName(query.getDbEntity()));

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/InsertBatchQueryBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/InsertBatchQueryBuilder.java?rev=1577832&r1=1577831&r2=1577832&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/InsertBatchQueryBuilder.java
(original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/InsertBatchQueryBuilder.java
Sat Mar 15 11:55:45 2014
@@ -89,7 +89,7 @@ public class InsertBatchQueryBuilder ext
     public String createSqlString() throws IOException {
 
         List<DbAttribute> dbAttributes = query.getDbAttributes();
-        QuotingStrategy strategy = getAdapter().getQuotingStrategy();
+        QuotingStrategy strategy = adapter.getQuotingStrategy();
 
         StringBuilder buffer = new StringBuilder("INSERT INTO ");
         buffer.append(strategy.quotedFullyQualifiedName(query.getDbEntity()));

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/UpdateBatchQueryBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/UpdateBatchQueryBuilder.java?rev=1577832&r1=1577831&r2=1577832&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/UpdateBatchQueryBuilder.java
(original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/access/trans/UpdateBatchQueryBuilder.java
Sat Mar 15 11:55:45 2014
@@ -45,7 +45,7 @@ public class UpdateBatchQueryBuilder ext
     public String createSqlString() throws IOException {
         UpdateBatchQuery updateBatch = (UpdateBatchQuery) query;
 
-        QuotingStrategy strategy = getAdapter().getQuotingStrategy();
+        QuotingStrategy strategy = adapter.getQuotingStrategy();
 
         List<DbAttribute> qualifierAttributes = updateBatch.getQualifierAttributes();
         List<DbAttribute> updatedDbAttributes = updateBatch.getUpdatedAttributes();

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBBatchQueryBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBBatchQueryBuilder.java?rev=1577832&r1=1577831&r2=1577832&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBBatchQueryBuilder.java
(original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBBatchQueryBuilder.java
Sat Mar 15 11:55:45 2014
@@ -59,7 +59,7 @@ abstract class OracleLOBBatchQueryBuilde
 
     String createLOBSelectString(List selectedLOBAttributes, List qualifierAttributes) {
 
-        QuotingStrategy strategy = getAdapter().getQuotingStrategy();
+        QuotingStrategy strategy = adapter.getQuotingStrategy();
 
         StringBuilder buf = new StringBuilder();
         buf.append("SELECT ");

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBInsertBatchQueryBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBInsertBatchQueryBuilder.java?rev=1577832&r1=1577831&r2=1577832&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBInsertBatchQueryBuilder.java
(original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBInsertBatchQueryBuilder.java
Sat Mar 15 11:55:45 2014
@@ -56,7 +56,7 @@ class OracleLOBInsertBatchQueryBuilder e
     public String createSqlString(BatchQueryRow row) {
         List<DbAttribute> dbAttributes = query.getDbAttributes();
 
-        QuotingStrategy strategy = getAdapter().getQuotingStrategy();
+        QuotingStrategy strategy = adapter.getQuotingStrategy();
 
         StringBuilder buffer = new StringBuilder("INSERT INTO ");
         buffer.append(strategy.quotedFullyQualifiedName(query.getDbEntity()));

Modified: cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBUpdateBatchQueryBuilder.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBUpdateBatchQueryBuilder.java?rev=1577832&r1=1577831&r2=1577832&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBUpdateBatchQueryBuilder.java
(original)
+++ cayenne/main/trunk/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleLOBUpdateBatchQueryBuilder.java
Sat Mar 15 11:55:45 2014
@@ -67,7 +67,7 @@ class OracleLOBUpdateBatchQueryBuilder e
         List<DbAttribute> idDbAttributes = updateBatch.getQualifierAttributes();
         List<DbAttribute> updatedDbAttributes = updateBatch.getUpdatedAttributes();
 
-        QuotingStrategy strategy = getAdapter().getQuotingStrategy();
+        QuotingStrategy strategy = adapter.getQuotingStrategy();
 
         StringBuilder buffer = new StringBuilder("UPDATE ");
         buffer.append(strategy.quotedFullyQualifiedName(query.getDbEntity()));

Modified: cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/trans/BatchQueryBuilderTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/trans/BatchQueryBuilderTest.java?rev=1577832&r1=1577831&r2=1577832&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/trans/BatchQueryBuilderTest.java
(original)
+++ cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/trans/BatchQueryBuilderTest.java
Sat Mar 15 11:55:45 2014
@@ -56,7 +56,7 @@ public class BatchQueryBuilderTest exten
             }
         };
 
-        assertSame(adapter, builder.getAdapter());
+        assertSame(adapter, builder.adapter);
     }
 
     public void testAppendDbAttribute1() throws Exception {

Modified: cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/trans/DeleteBatchQueryBuilderTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/trans/DeleteBatchQueryBuilderTest.java?rev=1577832&r1=1577831&r2=1577832&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/trans/DeleteBatchQueryBuilderTest.java
(original)
+++ cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/trans/DeleteBatchQueryBuilderTest.java
Sat Mar 15 11:55:45 2014
@@ -59,7 +59,7 @@ public class DeleteBatchQueryBuilderTest
 
         DeleteBatchQueryBuilder builder = new DeleteBatchQueryBuilder(mock(DeleteBatchQuery.class),
adapter);
 
-        assertSame(adapter, builder.getAdapter());
+        assertSame(adapter, builder.adapter);
     }
 
     public void testCreateSqlString() throws Exception {

Modified: cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/trans/InsertBatchQueryBuilderTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/trans/InsertBatchQueryBuilderTest.java?rev=1577832&r1=1577831&r2=1577832&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/trans/InsertBatchQueryBuilderTest.java
(original)
+++ cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/trans/InsertBatchQueryBuilderTest.java
Sat Mar 15 11:55:45 2014
@@ -52,7 +52,7 @@ public class InsertBatchQueryBuilderTest
 
         InsertBatchQueryBuilder builder = new InsertBatchQueryBuilder(mock(InsertBatchQuery.class),
adapter);
 
-        assertSame(adapter, builder.getAdapter());
+        assertSame(adapter, builder.adapter);
     }
 
     public void testCreateSqlString() throws Exception {

Modified: cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/trans/UpdateBatchQueryBuilderTest.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/trans/UpdateBatchQueryBuilderTest.java?rev=1577832&r1=1577831&r2=1577832&view=diff
==============================================================================
--- cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/trans/UpdateBatchQueryBuilderTest.java
(original)
+++ cayenne/main/trunk/cayenne-server/src/test/java/org/apache/cayenne/access/trans/UpdateBatchQueryBuilderTest.java
Sat Mar 15 11:55:45 2014
@@ -56,7 +56,7 @@ public class UpdateBatchQueryBuilderTest
     public void testConstructor() throws Exception {
         DbAdapter adapter = objectFactory.newInstance(DbAdapter.class, JdbcAdapter.class.getName());
         UpdateBatchQueryBuilder builder = new UpdateBatchQueryBuilder(mock(UpdateBatchQuery.class),
adapter);
-        assertSame(adapter, builder.getAdapter());
+        assertSame(adapter, builder.adapter);
     }
 
     public void testCreateSqlString() throws Exception {



Mime
View raw message