cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject cayenne git commit: CAY-2264 Remove usage of all deprecated JdbcEventLogger methods + Replace SQLParameterBinding with ParameterBinding
Date Thu, 27 Apr 2017 13:52:27 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master 38a368f70 -> 3b22b4757


CAY-2264 Remove usage of all deprecated JdbcEventLogger methods
  + Replace SQLParameterBinding with ParameterBinding


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/3b22b475
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/3b22b475
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/3b22b475

Branch: refs/heads/master
Commit: 3b22b4757f68bd94a36c312723a794194da2850c
Parents: 38a368f
Author: Nikita Timofeev <stariy95@gmail.com>
Authored: Thu Apr 27 16:51:31 2017 +0300
Committer: Nikita Timofeev <stariy95@gmail.com>
Committed: Thu Apr 27 16:51:31 2017 +0300

----------------------------------------------------------------------
 .../token/DefaultValueForNullProvider.java      | 10 ++--
 .../dbsync/merge/token/ValueForNullIT.java      |  6 +-
 .../access/jdbc/SQLParameterBinding.java        | 62 --------------------
 .../cayenne/access/jdbc/SQLStatement.java       | 12 ++--
 .../cayenne/access/jdbc/SQLTemplateAction.java  | 32 ++++------
 .../access/translator/DbAttributeBinding.java   |  4 +-
 .../access/translator/ParameterBinding.java     | 18 ++++--
 .../translator/ProcedureParameterBinding.java   |  2 +-
 .../procedure/ProcedureTranslator.java          | 18 +++---
 .../org/apache/cayenne/dba/JdbcAdapter.java     |  4 +-
 .../org/apache/cayenne/dba/db2/DB2Adapter.java  |  4 +-
 .../apache/cayenne/dba/derby/DerbyAdapter.java  |  4 +-
 .../cayenne/dba/ingres/IngresAdapter.java       |  2 +-
 .../apache/cayenne/dba/mysql/MySQLAdapter.java  |  2 +-
 .../dba/oracle/Oracle8LOBBatchAction.java       | 19 +++---
 .../cayenne/dba/oracle/OracleAdapter.java       |  4 +-
 .../cayenne/dba/postgres/PostgresAdapter.java   |  2 +-
 .../cayenne/dba/sybase/SybaseAdapter.java       | 10 ++--
 .../cayenne/log/CommonsJdbcEventLogger.java     | 33 ++++++-----
 .../org/apache/cayenne/log/JdbcEventLogger.java | 24 +++-----
 .../apache/cayenne/log/NoopJdbcEventLogger.java |  6 +-
 .../apache/cayenne/velocity/BindDirective.java  | 10 ++--
 .../cayenne/velocity/BindEqualDirective.java    |  4 +-
 .../cayenne/velocity/BindNotEqualDirective.java |  4 +-
 .../velocity/BindObjectEqualDirective.java      |  6 +-
 .../velocity/BindObjectNotEqualDirective.java   |  4 +-
 .../velocity/VelocitySQLTemplateProcessor.java  |  6 +-
 .../cayenne/access/jdbc/SQLStatementTest.java   |  3 +-
 .../VelocitySQLTemplateProcessorTest.java       | 12 ++--
 29 files changed, 134 insertions(+), 193 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/3b22b475/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/merge/token/DefaultValueForNullProvider.java
----------------------------------------------------------------------
diff --git a/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/merge/token/DefaultValueForNullProvider.java b/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/merge/token/DefaultValueForNullProvider.java
index 54fd030..11867ef 100644
--- a/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/merge/token/DefaultValueForNullProvider.java
+++ b/cayenne-dbsync/src/main/java/org/apache/cayenne/dbsync/merge/token/DefaultValueForNullProvider.java
@@ -24,25 +24,25 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.cayenne.access.jdbc.SQLParameterBinding;
+import org.apache.cayenne.access.translator.ParameterBinding;
 import org.apache.cayenne.map.DbAttribute;
 import org.apache.cayenne.map.DbEntity;
 
 public class DefaultValueForNullProvider implements ValueForNullProvider {
 
-    private Map<String, SQLParameterBinding> values = new HashMap<>();
+    private Map<String, ParameterBinding> values = new HashMap<>();
 
     public void set(DbEntity entity, DbAttribute column, Object value, int type) {
-        values.put(createKey(entity, column), new SQLParameterBinding(value, type, column
+        values.put(createKey(entity, column), new ParameterBinding(value, type, column
                 .getAttributePrecision()));
     }
 
-    protected SQLParameterBinding get(DbEntity entity, DbAttribute column) {
+    protected ParameterBinding get(DbEntity entity, DbAttribute column) {
         return values.get(createKey(entity, column));
     }
 
     public List<String> createSql(DbEntity entity, DbAttribute column) {
-        SQLParameterBinding value = get(entity, column);
+        ParameterBinding value = get(entity, column);
         if (value == null) {
             return Collections.emptyList();
         }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3b22b475/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/token/ValueForNullIT.java
----------------------------------------------------------------------
diff --git a/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/token/ValueForNullIT.java b/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/token/ValueForNullIT.java
index f9801a0..823b56b 100644
--- a/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/token/ValueForNullIT.java
+++ b/cayenne-dbsync/src/test/java/org/apache/cayenne/dbsync/merge/token/ValueForNullIT.java
@@ -23,7 +23,7 @@ import junit.framework.AssertionFailedError;
 import org.apache.cayenne.DataObject;
 import org.apache.cayenne.Persistent;
 import org.apache.cayenne.access.DataContext;
-import org.apache.cayenne.access.jdbc.SQLParameterBinding;
+import org.apache.cayenne.access.translator.ParameterBinding;
 import org.apache.cayenne.dbsync.merge.DataMapMerger;
 import org.apache.cayenne.dbsync.merge.MergeCase;
 import org.apache.cayenne.di.Inject;
@@ -110,11 +110,11 @@ public class ValueForNullIT extends MergeCase {
         return super.merger().valueForNullProvider(new DefaultValueForNullProvider() {
 
             @Override
-            protected SQLParameterBinding get(DbEntity entity, DbAttribute column) {
+            protected ParameterBinding get(DbEntity entity, DbAttribute column) {
                 int type = column.getType();
                 switch (type) {
                     case Types.VARCHAR:
-                        return new SQLParameterBinding(DEFAULT_VALUE_STRING, type, -1);
+                        return new ParameterBinding(DEFAULT_VALUE_STRING, type, -1);
                     default:
                         throw new AssertionFailedError("should not get here");
                 }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3b22b475/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SQLParameterBinding.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SQLParameterBinding.java b/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SQLParameterBinding.java
deleted file mode 100644
index f2b2369..0000000
--- a/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SQLParameterBinding.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*****************************************************************
- *   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;
-
-/**
- * Describes PreparedStatement parameter binding.
- * 
- * @since 4.0
- */
-public class SQLParameterBinding {
-
-	protected int jdbcType;
-	protected int scale;
-	protected Object value;
-
-	public SQLParameterBinding(Object value, int jdbcType, int scale) {
-		this.value = value;
-		this.jdbcType = jdbcType;
-		this.scale = scale;
-	}
-
-	public int getJdbcType() {
-		return jdbcType;
-	}
-
-	public int getScale() {
-		return scale;
-	}
-
-	public Object getValue() {
-		return value;
-	}
-
-	public void setJdbcType(int i) {
-		jdbcType = i;
-	}
-
-	public void setScale(int i) {
-		scale = i;
-	}
-
-	public void setValue(Object object) {
-		value = object;
-	}
-}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3b22b475/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SQLStatement.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SQLStatement.java b/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SQLStatement.java
index 33d385d..38c872c 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SQLStatement.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SQLStatement.java
@@ -19,6 +19,8 @@
 
 package org.apache.cayenne.access.jdbc;
 
+import org.apache.cayenne.access.translator.ParameterBinding;
+
 /**
  * A PreparedStatement descriptor containing a String of SQL and an array of parameters.
  * SQLStatement is essentially a "compiled" version of any single query.
@@ -28,13 +30,13 @@ package org.apache.cayenne.access.jdbc;
 public class SQLStatement {
 
     protected String sql;
-    protected SQLParameterBinding[] bindings;
+    protected ParameterBinding[] bindings;
     protected ColumnDescriptor[] resultColumns;
 
     public SQLStatement() {
     }
 
-    public SQLStatement(String sql, SQLParameterBinding[] bindings) {
+    public SQLStatement(String sql, ParameterBinding[] bindings) {
         this(sql, null, bindings);
     }
 
@@ -42,7 +44,7 @@ public class SQLStatement {
      * @since 1.2
      */
     public SQLStatement(String sql, ColumnDescriptor[] resultColumns,
-            SQLParameterBinding[] bindings) {
+                        ParameterBinding[] bindings) {
 
         setSql(sql);
         setBindings(bindings);
@@ -63,7 +65,7 @@ public class SQLStatement {
         resultColumns = descriptors;
     }
 
-    public SQLParameterBinding[] getBindings() {
+    public ParameterBinding[] getBindings() {
         return bindings;
     }
 
@@ -71,7 +73,7 @@ public class SQLStatement {
         return sql;
     }
 
-    public void setBindings(SQLParameterBinding[] bindings) {
+    public void setBindings(ParameterBinding[] bindings) {
         this.bindings = bindings;
     }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3b22b475/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SQLTemplateAction.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SQLTemplateAction.java b/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SQLTemplateAction.java
index a7d502c..ba11ed4 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SQLTemplateAction.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/access/jdbc/SQLTemplateAction.java
@@ -132,13 +132,12 @@ public class SQLTemplateAction implements SQLAction {
 				query.getPositionalParams());
 
 		if (loggable) {
-			dataNode.getJdbcEventLogger().logQuery(compiled.getSql(), Arrays.asList(compiled.getBindings()));
+			dataNode.getJdbcEventLogger().logQuery(compiled.getSql(), compiled.getBindings(), 0);
 		}
 
 		execute(connection, callback, compiled, counts);
 	}
 
-	@SuppressWarnings("deprecation")
 	private void runWithNamedParametersBatch(Connection connection, OperationObserver callback, String template,
 			Collection<Number> counts, boolean loggable) throws Exception {
 
@@ -158,7 +157,7 @@ public class SQLTemplateAction implements SQLAction {
 			SQLStatement compiled = dataNode.getSqlTemplateProcessor().processTemplate(template, nextParameters);
 
 			if (loggable) {
-				dataNode.getJdbcEventLogger().logQuery(compiled.getSql(), Arrays.asList(compiled.getBindings()));
+				dataNode.getJdbcEventLogger().logQuery(compiled.getSql(), compiled.getBindings(), 0);
 			}
 
 			execute(connection, callback, compiled, counts);
@@ -332,25 +331,18 @@ public class SQLTemplateAction implements SQLAction {
 	/**
 	 * Binds parameters to the PreparedStatement.
 	 */
-	protected void bind(PreparedStatement preparedStatement, SQLParameterBinding[] bindings)
+	protected void bind(PreparedStatement preparedStatement, ParameterBinding[] bindings)
 			throws SQLException, Exception {
 		// bind parameters
-		if (bindings.length > 0) {
-			int len = bindings.length;
-			for (int i = 0; i < len; i++) {
-
-				Object value = bindings[i].getValue();
-				ExtendedType extendedType = value != null
-						? getAdapter().getExtendedTypes().getRegisteredType(value.getClass())
-						: getAdapter().getExtendedTypes().getDefaultType();
-
-				ParameterBinding binding = new ParameterBinding();
-				binding.setType(bindings[i].getJdbcType());
-				binding.setStatementPosition(i + 1);
-				binding.setValue(value);
-				binding.setExtendedType(extendedType);
-				dataNode.getAdapter().bindParameter(preparedStatement, binding);
-			}
+		int i = 1;
+		for (ParameterBinding binding : bindings) {
+			Object value = binding.getValue();
+			ExtendedType extendedType = value != null
+					? getAdapter().getExtendedTypes().getRegisteredType(value.getClass())
+					: getAdapter().getExtendedTypes().getDefaultType();
+			binding.setExtendedType(extendedType);
+			binding.setStatementPosition(i++);
+			dataNode.getAdapter().bindParameter(preparedStatement, binding);
 		}
 
 		if (queryMetadata.getStatementFetchSize() != 0) {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3b22b475/cayenne-server/src/main/java/org/apache/cayenne/access/translator/DbAttributeBinding.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/translator/DbAttributeBinding.java b/cayenne-server/src/main/java/org/apache/cayenne/access/translator/DbAttributeBinding.java
index 78b6d71..d9470bf 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/access/translator/DbAttributeBinding.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/access/translator/DbAttributeBinding.java
@@ -39,8 +39,8 @@ public class DbAttributeBinding extends ParameterBinding {
 	}
 
 	@Override
-	public Integer getType() {
-		return super.getType() != null ? super.getType() : attribute.getType();
+	public Integer getJdbcType() {
+		return super.getJdbcType() != null ? super.getJdbcType() : attribute.getType();
 	}
 
 	@Override

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3b22b475/cayenne-server/src/main/java/org/apache/cayenne/access/translator/ParameterBinding.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/translator/ParameterBinding.java b/cayenne-server/src/main/java/org/apache/cayenne/access/translator/ParameterBinding.java
index 68d68ba..1df0029 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/access/translator/ParameterBinding.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/access/translator/ParameterBinding.java
@@ -27,14 +27,20 @@ import org.apache.cayenne.access.types.ExtendedType;
  */
 public class ParameterBinding {
 
-	static final int EXCLUDED_POSITION = -1;
+	private static final int EXCLUDED_POSITION = -1;
 
 	private Object value;
 	private int statementPosition;
 	private ExtendedType extendedType;
-	private Integer type;
+	private Integer jdbcType;
 	private int scale;
 
+	public ParameterBinding(Object value, Integer jdbcType, int scale) {
+		this.value = value;
+		this.jdbcType = jdbcType;
+		this.scale = scale;
+	}
+
 	public ParameterBinding() {
 		this.statementPosition = EXCLUDED_POSITION;
 	}
@@ -86,12 +92,12 @@ public class ParameterBinding {
 		this.extendedType = extendedType;
 	}
 
-	public Integer getType() {
-		return type;
+	public Integer getJdbcType() {
+		return jdbcType;
 	}
 
-	public void setType(Integer type) {
-		this.type = type;
+	public void setJdbcType(Integer type) {
+		this.jdbcType = type;
 	}
 
 	public int getScale() {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3b22b475/cayenne-server/src/main/java/org/apache/cayenne/access/translator/ProcedureParameterBinding.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/translator/ProcedureParameterBinding.java b/cayenne-server/src/main/java/org/apache/cayenne/access/translator/ProcedureParameterBinding.java
index 6ccfaf2..2bf3da3 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/access/translator/ProcedureParameterBinding.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/access/translator/ProcedureParameterBinding.java
@@ -39,7 +39,7 @@ public class ProcedureParameterBinding extends ParameterBinding {
 	}
 
 	@Override
-	public Integer getType() {
+	public Integer getJdbcType() {
 		return parameter.getType();
 	}
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3b22b475/cayenne-server/src/main/java/org/apache/cayenne/access/translator/procedure/ProcedureTranslator.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/access/translator/procedure/ProcedureTranslator.java b/cayenne-server/src/main/java/org/apache/cayenne/access/translator/procedure/ProcedureTranslator.java
index aa9fdf7..2fc261d 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/access/translator/procedure/ProcedureTranslator.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/access/translator/procedure/ProcedureTranslator.java
@@ -26,6 +26,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.cayenne.access.translator.ParameterBinding;
 import org.apache.cayenne.access.translator.ProcedureParameterBinding;
 import org.apache.cayenne.access.types.ExtendedType;
 import org.apache.cayenne.dba.DbAdapter;
@@ -155,16 +156,17 @@ public class ProcedureTranslator {
 		if (logger.isLoggable()) {
 			// need to convert OUT/VOID parameters to loggable strings
 			long time = System.currentTimeMillis() - t1;
-
-			List<Object> loggableParameters = new ArrayList<>(values.size());
-			for (Object val : values) {
-				if (val instanceof NotInParam) {
-					val = val.toString();
+			ParameterBinding[] parameterBindings = new ParameterBinding[values.size()];
+			for (int i=0; i<values.size(); i++) {
+				ProcedureParameter procedureParameter = callParams.get(i);
+				Object value = values.get(i);
+				if(value instanceof NotInParam) {
+					value = value.toString();
 				}
-				loggableParameters.add(val);
+				parameterBindings[i] = new ParameterBinding(value,
+						procedureParameter.getType(), procedureParameter.getPrecision());
 			}
-
-			logger.logQuery(sqlStr, null, loggableParameters, time);
+			logger.logQuery(sqlStr, parameterBindings, time);
 		}
 		CallableStatement stmt = connection.prepareCall(sqlStr);
 		initStatement(stmt);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3b22b475/cayenne-server/src/main/java/org/apache/cayenne/dba/JdbcAdapter.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/dba/JdbcAdapter.java b/cayenne-server/src/main/java/org/apache/cayenne/dba/JdbcAdapter.java
index b163a88..2b39416 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/dba/JdbcAdapter.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/dba/JdbcAdapter.java
@@ -543,12 +543,12 @@ public class JdbcAdapter implements DbAdapter {
 			throws SQLException, Exception {
 
 		if (binding.getValue() == null) {
-			statement.setNull(binding.getStatementPosition(), binding.getType());
+			statement.setNull(binding.getStatementPosition(), binding.getJdbcType());
 		} else {
 			binding.getExtendedType().setJdbcObject(statement,
 					binding.getValue(),
 					binding.getStatementPosition(),
-					binding.getType(),
+					binding.getJdbcType(),
 					binding.getScale());
 		}
 	}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3b22b475/cayenne-server/src/main/java/org/apache/cayenne/dba/db2/DB2Adapter.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/dba/db2/DB2Adapter.java b/cayenne-server/src/main/java/org/apache/cayenne/dba/db2/DB2Adapter.java
index 7ac6dec..c6df839 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/dba/db2/DB2Adapter.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/dba/db2/DB2Adapter.java
@@ -166,10 +166,10 @@ public class DB2Adapter extends JdbcAdapter {
 
     @Override
     public void bindParameter(PreparedStatement statement, ParameterBinding binding) throws Exception {
-        if (binding.getValue() == null && (binding.getType() == 0 || binding.getType() == Types.BOOLEAN)) {
+        if (binding.getValue() == null && (binding.getJdbcType() == 0 || binding.getJdbcType() == Types.BOOLEAN)) {
             statement.setNull(binding.getStatementPosition(), Types.VARCHAR);
         } else {
-            binding.setType(convertNTypes(binding.getType()));
+            binding.setJdbcType(convertNTypes(binding.getJdbcType()));
             super.bindParameter(statement, binding);
         }
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3b22b475/cayenne-server/src/main/java/org/apache/cayenne/dba/derby/DerbyAdapter.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/dba/derby/DerbyAdapter.java b/cayenne-server/src/main/java/org/apache/cayenne/dba/derby/DerbyAdapter.java
index d2bb67e..7dd23a3 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/dba/derby/DerbyAdapter.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/dba/derby/DerbyAdapter.java
@@ -189,10 +189,10 @@ public class DerbyAdapter extends JdbcAdapter {
             PreparedStatement statement,
             ParameterBinding binding) throws SQLException, Exception {
 
-        if (binding.getValue() == null && binding.getType() == 0) {
+        if (binding.getValue() == null && binding.getJdbcType() == 0) {
             statement.setNull(binding.getStatementPosition(), Types.VARCHAR);
         } else {
-            binding.setType(convertNTypes(binding.getType()));
+            binding.setJdbcType(convertNTypes(binding.getJdbcType()));
             super.bindParameter(statement, binding);
         }
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3b22b475/cayenne-server/src/main/java/org/apache/cayenne/dba/ingres/IngresAdapter.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/dba/ingres/IngresAdapter.java b/cayenne-server/src/main/java/org/apache/cayenne/dba/ingres/IngresAdapter.java
index 2c76b2a..60a39b6 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/dba/ingres/IngresAdapter.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/dba/ingres/IngresAdapter.java
@@ -114,7 +114,7 @@ public class IngresAdapter extends JdbcAdapter {
 	public void bindParameter(PreparedStatement statement, ParameterBinding binding)
 			throws SQLException, Exception {
 
-		if (binding.getValue() == null && (binding.getType() == Types.BIT)) {
+		if (binding.getValue() == null && (binding.getJdbcType() == Types.BIT)) {
 			statement.setNull(binding.getStatementPosition(), Types.SMALLINT);
 		} else {
 			super.bindParameter(statement, binding);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3b22b475/cayenne-server/src/main/java/org/apache/cayenne/dba/mysql/MySQLAdapter.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/dba/mysql/MySQLAdapter.java b/cayenne-server/src/main/java/org/apache/cayenne/dba/mysql/MySQLAdapter.java
index 6e9529a..24d39ae 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/dba/mysql/MySQLAdapter.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/dba/mysql/MySQLAdapter.java
@@ -212,7 +212,7 @@ public class MySQLAdapter extends JdbcAdapter {
 	@Override
 	public void bindParameter(PreparedStatement statement, ParameterBinding binding)
 			throws SQLException, Exception {
-		binding.setType(mapNTypes(binding.getType()));
+		binding.setJdbcType(mapNTypes(binding.getJdbcType()));
 		super.bindParameter(statement, binding);
 	}
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3b22b475/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/Oracle8LOBBatchAction.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/Oracle8LOBBatchAction.java b/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/Oracle8LOBBatchAction.java
index 5392c55..144573e 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/Oracle8LOBBatchAction.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/Oracle8LOBBatchAction.java
@@ -131,7 +131,7 @@ class Oracle8LOBBatchAction implements SQLAction {
 			return;
 		}
 
-		boolean isLoggable = logger.isLoggable();
+		final boolean isLoggable = logger.isLoggable();
 
 		List<Object> qualifierValues = selectQuery.getValuesForLOBSelectQualifier(row);
 		List<Object> lobValues = selectQuery.getValuesForUpdatedLOBColumns();
@@ -140,12 +140,11 @@ class Oracle8LOBBatchAction implements SQLAction {
 
 		String selectStr = queryBuilder.createLOBSelectString(lobAttributes, qualifierAttributes);
 
-		if (isLoggable) {
-			logger.logQuery(selectStr, qualifierValues);
-			logger.logQueryParameters("write LOB", null, lobValues, false);
-		}
-
 		try (PreparedStatement selectStatement = con.prepareStatement(selectStr)) {
+			DbAttributeBinding[] attributeBindings = null;
+			if(isLoggable) {
+				attributeBindings = new DbAttributeBinding[parametersSize];
+			}
 			for (int i = 0; i < parametersSize; i++) {
 				DbAttribute attribute = qualifierAttributes.get(i);
 				Object value = qualifierValues.get(i);
@@ -158,6 +157,13 @@ class Oracle8LOBBatchAction implements SQLAction {
 				binding.setValue(value);
 				binding.setExtendedType(extendedType);
 				adapter.bindParameter(selectStatement, binding);
+				if(isLoggable) {
+					attributeBindings[i] = binding;
+				}
+			}
+
+			if (isLoggable) {
+				logger.logQuery(selectStr, attributeBindings, 0);
 			}
 
 			try (ResultSet result = selectStatement.executeQuery()) {
@@ -166,7 +172,6 @@ class Oracle8LOBBatchAction implements SQLAction {
 				}
 
 				// read the only expected row
-
 				for (int i = 0; i < lobSize; i++) {
 					DbAttribute attribute = lobAttributes.get(i);
 					int type = attribute.getType();

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3b22b475/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleAdapter.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleAdapter.java b/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleAdapter.java
index f6528c9..77f2be1 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleAdapter.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/dba/oracle/OracleAdapter.java
@@ -238,10 +238,10 @@ public class OracleAdapter extends JdbcAdapter {
 		// Oracle doesn't support BOOLEAN even when binding NULL, so have to
 		// intercept
 		// NULL Boolean here, as super doesn't pass it through ExtendedType...
-		if (binding.getValue() == null && binding.getType() == Types.BOOLEAN) {
+		if (binding.getValue() == null && binding.getJdbcType() == Types.BOOLEAN) {
 			ExtendedType typeProcessor = getExtendedTypes().getRegisteredType(Boolean.class);
 			typeProcessor.setJdbcObject(statement, binding.getValue(), binding.getStatementPosition(), binding
-							.getType(),binding.getScale());
+							.getJdbcType(),binding.getScale());
 		} else {
 			super.bindParameter(statement, binding);
 		}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3b22b475/cayenne-server/src/main/java/org/apache/cayenne/dba/postgres/PostgresAdapter.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/dba/postgres/PostgresAdapter.java b/cayenne-server/src/main/java/org/apache/cayenne/dba/postgres/PostgresAdapter.java
index bf3f6b9..c9dd4af 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/dba/postgres/PostgresAdapter.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/dba/postgres/PostgresAdapter.java
@@ -135,7 +135,7 @@ public class PostgresAdapter extends JdbcAdapter {
 	@Override
 	public void bindParameter(PreparedStatement statement, ParameterBinding binding)
 			throws SQLException, Exception {
-		binding.setType(mapNTypes(binding.getType()));
+		binding.setJdbcType(mapNTypes(binding.getJdbcType()));
 		super.bindParameter(statement, binding);
 	}
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3b22b475/cayenne-server/src/main/java/org/apache/cayenne/dba/sybase/SybaseAdapter.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/dba/sybase/SybaseAdapter.java b/cayenne-server/src/main/java/org/apache/cayenne/dba/sybase/SybaseAdapter.java
index 886308a..891995e 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/dba/sybase/SybaseAdapter.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/dba/sybase/SybaseAdapter.java
@@ -137,14 +137,14 @@ public class SybaseAdapter extends JdbcAdapter {
 
         // Sybase driver doesn't like CLOBs and BLOBs as parameters
         if (binding.getValue() == null) {
-            if (binding.getType() == Types.CLOB) {
-                binding.setType(Types.VARCHAR);
-            } else if (binding.getType() == Types.BLOB) {
-                binding.setType(Types.VARBINARY);
+            if (binding.getJdbcType() == Types.CLOB) {
+                binding.setJdbcType(Types.VARCHAR);
+            } else if (binding.getJdbcType() == Types.BLOB) {
+                binding.setJdbcType(Types.VARBINARY);
             }
         }
 
-        if (binding.getValue() == null && binding.getType() == 0) {
+        if (binding.getValue() == null && binding.getJdbcType() == 0) {
             statement.setNull(binding.getStatementPosition(), Types.VARCHAR);
         } else {
             super.bindParameter(statement, binding);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3b22b475/cayenne-server/src/main/java/org/apache/cayenne/log/CommonsJdbcEventLogger.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/log/CommonsJdbcEventLogger.java b/cayenne-server/src/main/java/org/apache/cayenne/log/CommonsJdbcEventLogger.java
index 17c5f4a..c0007bc 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/log/CommonsJdbcEventLogger.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/log/CommonsJdbcEventLogger.java
@@ -20,8 +20,8 @@ package org.apache.cayenne.log;
 
 import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.ExtendedEnumeration;
-import org.apache.cayenne.access.jdbc.SQLParameterBinding;
 import org.apache.cayenne.access.translator.DbAttributeBinding;
+import org.apache.cayenne.access.translator.ParameterBinding;
 import org.apache.cayenne.configuration.Constants;
 import org.apache.cayenne.configuration.RuntimeProperties;
 import org.apache.cayenne.conn.DataSourceInfo;
@@ -47,7 +47,7 @@ public class CommonsJdbcEventLogger implements JdbcEventLogger {
 	private static final Logger logger = LoggerFactory.getLogger(CommonsJdbcEventLogger.class);
 
     /**
-     * @deprecated  since 4.0
+     * @deprecated since 4.0
      */
 	private static final int TRIM_VALUES_THRESHOLD = 30;
 
@@ -86,7 +86,7 @@ public class CommonsJdbcEventLogger implements JdbcEventLogger {
 		}
 		// handle byte pretty formatting
 		else if (object instanceof Byte) {
-			IDUtil.appendFormattedByte(buffer, ((Byte) object).byteValue());
+			IDUtil.appendFormattedByte(buffer, (Byte) object);
 		} else if (object instanceof Number) {
 			// process numeric value (do something smart in the future)
 			buffer.append(object);
@@ -118,8 +118,8 @@ public class CommonsJdbcEventLogger implements JdbcEventLogger {
 				buffer.append(((Enum<?>) object).ordinal());
 				// FIXME -- this isn't quite right
 			}
-		} else if (object instanceof SQLParameterBinding) {
-			sqlLiteralForObject(buffer, ((SQLParameterBinding) object).getValue());
+		} else if (object instanceof ParameterBinding) {
+			sqlLiteralForObject(buffer, ((ParameterBinding) object).getValue());
 		} else if (object.getClass().isArray()) {
 			buffer.append("< ");
 
@@ -232,7 +232,7 @@ public class CommonsJdbcEventLogger implements JdbcEventLogger {
 
 	/**
 	 * @deprecated since 4.0 use
-	 *             {@link #logQuery(String, DbAttributeBinding[], long)}.
+	 *             {@link #logQuery(String, ParameterBinding[], long)}.
 	 */
 	@Deprecated
 	@Override
@@ -297,7 +297,7 @@ public class CommonsJdbcEventLogger implements JdbcEventLogger {
 	}
 
 	@Override
-	public void logQuery(String sql, DbAttributeBinding[] bindings, long translatedIn) {
+	public void logQuery(String sql, ParameterBinding[] bindings, long translatedIn) {
 		if (isLoggable()) {
 
 			StringBuilder buffer = new StringBuilder(sql).append(" ");
@@ -340,7 +340,7 @@ public class CommonsJdbcEventLogger implements JdbcEventLogger {
 	}
 
 	@Override
-	public void logQueryParameters(String label, DbAttributeBinding[] bindings) {
+	public void logQueryParameters(String label, ParameterBinding[] bindings) {
 
 		if (isLoggable() && bindings.length > 0) {
 
@@ -353,7 +353,7 @@ public class CommonsJdbcEventLogger implements JdbcEventLogger {
 		}
 	}
 
-	private void appendParameters(StringBuilder buffer, String label, DbAttributeBinding[] bindings) {
+	private void appendParameters(StringBuilder buffer, String label, ParameterBinding[] bindings) {
 
 		int len = bindings.length;
 		if (len > 0) {
@@ -361,7 +361,7 @@ public class CommonsJdbcEventLogger implements JdbcEventLogger {
 			boolean hasIncluded = false;
 
 			for (int i = 0, j = 1; i < len; i++) {
-				DbAttributeBinding b = bindings[i];
+				ParameterBinding b = bindings[i];
 
 				if (b.isExcluded()) {
 					continue;
@@ -374,13 +374,15 @@ public class CommonsJdbcEventLogger implements JdbcEventLogger {
 					buffer.append("[").append(label).append(": ");
 				}
 
-				DbAttribute attribute = b.getAttribute();
 
 				buffer.append(j++);
 
-				if (attribute != null) {
-					buffer.append("->");
-					buffer.append(attribute.getName());
+				if(b instanceof DbAttributeBinding) {
+					DbAttribute attribute = ((DbAttributeBinding) b).getAttribute();
+					if (attribute != null) {
+						buffer.append("->");
+						buffer.append(attribute.getName());
+					}
 				}
 
 				buffer.append(":");
@@ -389,8 +391,7 @@ public class CommonsJdbcEventLogger implements JdbcEventLogger {
 					buffer.append(b.getExtendedType().toString(b.getValue()));
 				} else if(b.getValue() == null) {
 				    buffer.append("NULL");
-                }
-                else {
+                } else {
 					buffer.append(b.getValue().getClass().getName())
                             .append("@")
                             .append(System.identityHashCode(b.getValue()));

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3b22b475/cayenne-server/src/main/java/org/apache/cayenne/log/JdbcEventLogger.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/log/JdbcEventLogger.java b/cayenne-server/src/main/java/org/apache/cayenne/log/JdbcEventLogger.java
index 5ada199..ea9aec8 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/log/JdbcEventLogger.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/log/JdbcEventLogger.java
@@ -20,7 +20,7 @@ package org.apache.cayenne.log;
 
 import java.util.List;
 
-import org.apache.cayenne.access.translator.DbAttributeBinding;
+import org.apache.cayenne.access.translator.ParameterBinding;
 import org.apache.cayenne.conn.DataSourceInfo;
 import org.apache.cayenne.map.DbAttribute;
 
@@ -76,15 +76,13 @@ public interface JdbcEventLogger {
 	void logGeneratedKey(DbAttribute attribute, Object value);
 
 	/**
-	 * @deprecated since 4.0 use
-	 *             {@link #logQuery(String, DbAttributeBinding[], long)}.
+	 * @deprecated since 4.0 use {@link #logQuery(String, ParameterBinding[], long)}.
 	 */
 	@Deprecated
 	void logQuery(String sql, List<?> params);
 
 	/**
-	 * @deprecated since 4.0 use
-	 *             {@link #logQuery(String, DbAttributeBinding[], long)}.
+	 * @deprecated since 4.0 use {@link #logQuery(String, ParameterBinding[], long)}.
 	 */
 	@Deprecated
 	void logQuery(String sql, List<DbAttribute> attrs, List<?> params, long time);
@@ -92,16 +90,15 @@ public interface JdbcEventLogger {
 	/**
 	 * @since 4.0
 	 */
-	void logQuery(String sql, DbAttributeBinding[] bindings, long translatedIn);
+	void logQuery(String sql, ParameterBinding[] bindings, long translatedIn);
 
 	/**
 	 * @since 4.0
 	 */
-	void logQueryParameters(String label, DbAttributeBinding[] bindings);
+	void logQueryParameters(String label, ParameterBinding[] bindings);
 
 	/**
-	 * @deprecated since 4.0 in favor of
-	 *             {@link #logQueryParameters(String, DbAttributeBinding[])}
+	 * @deprecated since 4.0 use {@link #logQueryParameters(String, ParameterBinding[])}
 	 */
 	@Deprecated
 	void logQueryParameters(String label, List<DbAttribute> attrs, List<Object> parameters, boolean isInserting);
@@ -109,12 +106,9 @@ public interface JdbcEventLogger {
 	void logSelectCount(int count, long time);
 
 	/**
-	 * 
-	 * @param count
-	 * @param time
-	 *            (milliseconds) time query took to run
-	 * @param sql
-	 *            SQL that was executed, printed when time exceeds timeThreshold
+	 * @param count of selected rows
+	 * @param time (milliseconds) time query took to run
+	 * @param sql SQL that was executed, printed when time exceeds timeThreshold
 	 * 
 	 * @since 4.0
 	 */

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3b22b475/cayenne-server/src/main/java/org/apache/cayenne/log/NoopJdbcEventLogger.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/log/NoopJdbcEventLogger.java b/cayenne-server/src/main/java/org/apache/cayenne/log/NoopJdbcEventLogger.java
index 6e675ac..b2dc36f 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/log/NoopJdbcEventLogger.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/log/NoopJdbcEventLogger.java
@@ -20,7 +20,7 @@ package org.apache.cayenne.log;
 
 import java.util.List;
 
-import org.apache.cayenne.access.translator.DbAttributeBinding;
+import org.apache.cayenne.access.translator.ParameterBinding;
 import org.apache.cayenne.conn.DataSourceInfo;
 import org.apache.cayenne.map.DbAttribute;
 
@@ -83,7 +83,7 @@ public class NoopJdbcEventLogger implements JdbcEventLogger {
 	}
 	
 	@Override
-	public void logQuery(String sql, DbAttributeBinding[] bindings, long translatedIn) {
+	public void logQuery(String sql, ParameterBinding[] bindings, long translatedIn) {
 	}
 
 	@Override
@@ -92,7 +92,7 @@ public class NoopJdbcEventLogger implements JdbcEventLogger {
 	}
 
 	@Override
-	public void logQueryParameters(String label, DbAttributeBinding[] bindings) {
+	public void logQueryParameters(String label, ParameterBinding[] bindings) {
 	}
 
 	@Override

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3b22b475/cayenne-server/src/main/java/org/apache/cayenne/velocity/BindDirective.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/velocity/BindDirective.java b/cayenne-server/src/main/java/org/apache/cayenne/velocity/BindDirective.java
index 8529a77..94080d6 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/velocity/BindDirective.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/velocity/BindDirective.java
@@ -24,7 +24,7 @@ import java.io.Writer;
 import java.util.Collection;
 import java.util.Iterator;
 
-import org.apache.cayenne.access.jdbc.SQLParameterBinding;
+import org.apache.cayenne.access.translator.ParameterBinding;
 import org.apache.cayenne.dba.TypesMapping;
 import org.apache.cayenne.util.ConversionUtil;
 import org.apache.velocity.context.InternalContextAdapter;
@@ -81,7 +81,7 @@ public class BindDirective extends Directive {
 
 	/**
 	 * Extracts the value of the object property to render and passes control to
-	 * {@link #render(InternalContextAdapter, Writer, SQLParameterBinding)} to do
+	 * {@link #render(InternalContextAdapter, Writer, ParameterBinding)} to do
 	 * the actual rendering.
 	 */
 	@Override
@@ -130,10 +130,10 @@ public class BindDirective extends Directive {
 					+ ") at line " + node.getLine() + ", column " + node.getColumn());
 		}
 
-		render(context, writer, new SQLParameterBinding(value, jdbcType, scale));
+		render(context, writer, new ParameterBinding(value, jdbcType, scale));
 	}
 
-	protected void render(InternalContextAdapter context, Writer writer, SQLParameterBinding binding) throws IOException {
+	protected void render(InternalContextAdapter context, Writer writer, ParameterBinding binding) throws IOException {
 
 		bind(context, binding);
 		writer.write('?');
@@ -146,7 +146,7 @@ public class BindDirective extends Directive {
 	/**
 	 * Adds value to the list of bindings in the context.
 	 */
-	protected void bind(InternalContextAdapter context, SQLParameterBinding binding) {
+	protected void bind(InternalContextAdapter context, ParameterBinding binding) {
 
 		Collection bindings = (Collection) context.getInternalUserContext().get(
 				VelocitySQLTemplateProcessor.BINDINGS_LIST_KEY);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3b22b475/cayenne-server/src/main/java/org/apache/cayenne/velocity/BindEqualDirective.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/velocity/BindEqualDirective.java b/cayenne-server/src/main/java/org/apache/cayenne/velocity/BindEqualDirective.java
index f109b82..bf9c820 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/velocity/BindEqualDirective.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/velocity/BindEqualDirective.java
@@ -22,7 +22,7 @@ package org.apache.cayenne.velocity;
 import java.io.IOException;
 import java.io.Writer;
 
-import org.apache.cayenne.access.jdbc.SQLParameterBinding;
+import org.apache.cayenne.access.translator.ParameterBinding;
 import org.apache.velocity.context.InternalContextAdapter;
 
 /**
@@ -43,7 +43,7 @@ public class BindEqualDirective extends BindDirective {
     protected void render(
         InternalContextAdapter context,
         Writer writer,
-        SQLParameterBinding binding)
+        ParameterBinding binding)
         throws IOException {
 
         if (binding.getValue() != null) {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3b22b475/cayenne-server/src/main/java/org/apache/cayenne/velocity/BindNotEqualDirective.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/velocity/BindNotEqualDirective.java b/cayenne-server/src/main/java/org/apache/cayenne/velocity/BindNotEqualDirective.java
index 3b17732..af548da 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/velocity/BindNotEqualDirective.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/velocity/BindNotEqualDirective.java
@@ -22,7 +22,7 @@ package org.apache.cayenne.velocity;
 import java.io.IOException;
 import java.io.Writer;
 
-import org.apache.cayenne.access.jdbc.SQLParameterBinding;
+import org.apache.cayenne.access.translator.ParameterBinding;
 import org.apache.velocity.context.InternalContextAdapter;
 
 /**
@@ -43,7 +43,7 @@ public class BindNotEqualDirective extends BindDirective {
     protected void render(
             InternalContextAdapter context,
             Writer writer,
-            SQLParameterBinding binding) throws IOException {
+            ParameterBinding binding) throws IOException {
 
         if (binding.getValue() != null) {
             bind(context, binding);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3b22b475/cayenne-server/src/main/java/org/apache/cayenne/velocity/BindObjectEqualDirective.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/velocity/BindObjectEqualDirective.java b/cayenne-server/src/main/java/org/apache/cayenne/velocity/BindObjectEqualDirective.java
index 35785d3..8394673 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/velocity/BindObjectEqualDirective.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/velocity/BindObjectEqualDirective.java
@@ -27,7 +27,7 @@ import java.util.Map;
 
 import org.apache.cayenne.ObjectId;
 import org.apache.cayenne.Persistent;
-import org.apache.cayenne.access.jdbc.SQLParameterBinding;
+import org.apache.cayenne.access.translator.ParameterBinding;
 import org.apache.cayenne.dba.TypesMapping;
 import org.apache.velocity.context.InternalContextAdapter;
 import org.apache.velocity.exception.MethodInvocationException;
@@ -94,7 +94,7 @@ public class BindObjectEqualDirective extends BindDirective {
 
             renderColumn(context, writer, sqlColumnsArray[i], i);
             writer.write(' ');
-            render(context, writer, new SQLParameterBinding(value, jdbcType, -1));
+            render(context, writer, new ParameterBinding(value, jdbcType, -1));
         }
 
         return true;
@@ -151,7 +151,7 @@ public class BindObjectEqualDirective extends BindDirective {
     protected void render(
             InternalContextAdapter context,
             Writer writer,
-            SQLParameterBinding binding) throws IOException {
+            ParameterBinding binding) throws IOException {
 
         if (binding.getValue() != null) {
             bind(context, binding);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3b22b475/cayenne-server/src/main/java/org/apache/cayenne/velocity/BindObjectNotEqualDirective.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/velocity/BindObjectNotEqualDirective.java b/cayenne-server/src/main/java/org/apache/cayenne/velocity/BindObjectNotEqualDirective.java
index bf76993..6c95852 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/velocity/BindObjectNotEqualDirective.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/velocity/BindObjectNotEqualDirective.java
@@ -21,7 +21,7 @@ package org.apache.cayenne.velocity;
 import java.io.IOException;
 import java.io.Writer;
 
-import org.apache.cayenne.access.jdbc.SQLParameterBinding;
+import org.apache.cayenne.access.translator.ParameterBinding;
 import org.apache.velocity.context.InternalContextAdapter;
 
 /**
@@ -57,7 +57,7 @@ public class BindObjectNotEqualDirective extends BindObjectEqualDirective {
     protected void render(
             InternalContextAdapter context,
             Writer writer,
-            SQLParameterBinding binding) throws IOException {
+            ParameterBinding binding) throws IOException {
 
         if (binding.getValue() != null) {
             bind(context, binding);

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3b22b475/cayenne-server/src/main/java/org/apache/cayenne/velocity/VelocitySQLTemplateProcessor.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/main/java/org/apache/cayenne/velocity/VelocitySQLTemplateProcessor.java b/cayenne-server/src/main/java/org/apache/cayenne/velocity/VelocitySQLTemplateProcessor.java
index 1fc4f14..cfa5f33 100644
--- a/cayenne-server/src/main/java/org/apache/cayenne/velocity/VelocitySQLTemplateProcessor.java
+++ b/cayenne-server/src/main/java/org/apache/cayenne/velocity/VelocitySQLTemplateProcessor.java
@@ -21,9 +21,9 @@ package org.apache.cayenne.velocity;
 
 import org.apache.cayenne.CayenneRuntimeException;
 import org.apache.cayenne.access.jdbc.ColumnDescriptor;
-import org.apache.cayenne.access.jdbc.SQLParameterBinding;
 import org.apache.cayenne.access.jdbc.SQLStatement;
 import org.apache.cayenne.access.jdbc.SQLTemplateProcessor;
+import org.apache.cayenne.access.translator.ParameterBinding;
 import org.apache.cayenne.exp.ExpressionException;
 import org.apache.velocity.VelocityContext;
 import org.apache.velocity.context.InternalContextAdapterImpl;
@@ -152,7 +152,7 @@ public class VelocitySQLTemplateProcessor implements SQLTemplateProcessor {
 	}
 
 	SQLStatement processTemplate(String template, SimpleNode parsedTemplate, Map<String, Object> parameters) {
-		List<SQLParameterBinding> bindings = new ArrayList<>();
+		List<ParameterBinding> bindings = new ArrayList<>();
 		List<ColumnDescriptor> results = new ArrayList<>();
 		parameters.put(BINDINGS_LIST_KEY, bindings);
 		parameters.put(RESULT_COLUMNS_LIST_KEY, results);
@@ -165,7 +165,7 @@ public class VelocitySQLTemplateProcessor implements SQLTemplateProcessor {
 			throw new CayenneRuntimeException("Error processing Velocity template", e);
 		}
 
-		SQLParameterBinding[] bindingsArray = new SQLParameterBinding[bindings.size()];
+		ParameterBinding[] bindingsArray = new ParameterBinding[bindings.size()];
 		bindings.toArray(bindingsArray);
 
 		ColumnDescriptor[] resultsArray = new ColumnDescriptor[results.size()];

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3b22b475/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/SQLStatementTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/SQLStatementTest.java b/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/SQLStatementTest.java
index e0cc575..b6b7c6c 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/SQLStatementTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/access/jdbc/SQLStatementTest.java
@@ -19,6 +19,7 @@
 
 package org.apache.cayenne.access.jdbc;
 
+import org.apache.cayenne.access.translator.ParameterBinding;
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
@@ -31,7 +32,7 @@ public class SQLStatementTest {
 
     @Test
     public void testConstructor() throws Exception {
-        SQLParameterBinding[] bindings = new SQLParameterBinding[0];
+        ParameterBinding[] bindings = new ParameterBinding[0];
         SQLStatement statement = new SQLStatement("abc", bindings);
         assertEquals("abc", statement.getSql());
         assertSame(bindings, statement.getBindings());

http://git-wip-us.apache.org/repos/asf/cayenne/blob/3b22b475/cayenne-server/src/test/java/org/apache/cayenne/velocity/VelocitySQLTemplateProcessorTest.java
----------------------------------------------------------------------
diff --git a/cayenne-server/src/test/java/org/apache/cayenne/velocity/VelocitySQLTemplateProcessorTest.java b/cayenne-server/src/test/java/org/apache/cayenne/velocity/VelocitySQLTemplateProcessorTest.java
index b6c6ff3..504179b 100644
--- a/cayenne-server/src/test/java/org/apache/cayenne/velocity/VelocitySQLTemplateProcessorTest.java
+++ b/cayenne-server/src/test/java/org/apache/cayenne/velocity/VelocitySQLTemplateProcessorTest.java
@@ -31,8 +31,8 @@ import java.util.Map;
 import org.apache.cayenne.CayenneDataObject;
 import org.apache.cayenne.DataObject;
 import org.apache.cayenne.ObjectId;
-import org.apache.cayenne.access.jdbc.SQLParameterBinding;
 import org.apache.cayenne.access.jdbc.SQLStatement;
+import org.apache.cayenne.access.translator.ParameterBinding;
 import org.junit.Before;
 import org.junit.Test;
 
@@ -223,12 +223,12 @@ public class VelocitySQLTemplateProcessorTest {
 	}
 
 	private void assertBindingValue(Object expectedValue, Object binding) {
-		assertTrue("Not a binding!", binding instanceof SQLParameterBinding);
-		assertEquals(expectedValue, ((SQLParameterBinding) binding).getValue());
+		assertTrue("Not a binding!", binding instanceof ParameterBinding);
+		assertEquals(expectedValue, ((ParameterBinding) binding).getValue());
 	}
 
-	private void assertBindingType(int expectedType, Object binding) {
-		assertTrue("Not a binding!", binding instanceof SQLParameterBinding);
-		assertEquals(expectedType, ((SQLParameterBinding) binding).getJdbcType());
+	private void assertBindingType(Integer expectedType, Object binding) {
+		assertTrue("Not a binding!", binding instanceof ParameterBinding);
+		assertEquals(expectedType, ((ParameterBinding) binding).getJdbcType());
 	}
 }


Mime
View raw message