#356 - ENH: Change to Binder logging such that the value in the bind log is the converted/bound value

This commit is contained in:
Robin Bygrave
2015-07-27 20:59:40 +12:00
parent f2aa2b5b8b
commit 962d7f601d
2 changed files with 6 additions and 4 deletions
@@ -142,11 +142,12 @@ public class Binder {
/**
* Bind an Object with unknown data type.
*/
public void bindObject(DataBind dataBind, Object value) throws SQLException {
public Object bindObject(DataBind dataBind, Object value) throws SQLException {
if (value == null) {
// null of unknown type
bindObject(dataBind, null, Types.OTHER);
return null;
} else {
@@ -163,6 +164,7 @@ public class Binder {
int dbType = type.getJdbcType();
bindObject(dataBind, value, dbType);
return value;
}
}
@@ -156,7 +156,7 @@ public class CQueryPredicates {
for (int i = 0; i < whereExprBindValues.size(); i++) {
Object bindValue = whereExprBindValues.get(i);
binder.bindObject(dataBind, bindValue);
bindValue = binder.bindObject(dataBind, bindValue);
if (i > 0 || idValue != null) {
bindLog.append(",");
}
@@ -168,7 +168,7 @@ public class CQueryPredicates {
for (int i = 0; i < filterManyExprBindValues.size(); i++) {
Object bindValue = filterManyExprBindValues.get(i);
binder.bindObject(dataBind, bindValue);
bindValue = binder.bindObject(dataBind, bindValue);
if (i > 0 || idValue != null) {
bindLog.append(",");
}
@@ -198,7 +198,7 @@ public class CQueryPredicates {
bindLog.append(" having ");
for (int i = 0; i < havingExprBindValues.size(); i++) {
Object bindValue = havingExprBindValues.get(i);
binder.bindObject(dataBind, bindValue);
bindValue = binder.bindObject(dataBind, bindValue);
if (i > 0) {
bindLog.append(",");
}