Permalink
Browse files

HHH-7317 : Boolean values bound to parameters in SQL predicate cause …

…failures using DB2 with deferPrepares = true
  • Loading branch information...
1 parent c533f21 commit ce74c6aa3a8638f7c0fccbac5aaa9b9a7d30c227 @gbadner gbadner committed May 11, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 hibernate-core/src/main/java/org/hibernate/dialect/DB2Dialect.java
@@ -36,6 +36,8 @@
import org.hibernate.dialect.function.StandardSQLFunction;
import org.hibernate.dialect.function.VarArgsSQLFunction;
import org.hibernate.type.StandardBasicTypes;
+import org.hibernate.type.descriptor.sql.SmallIntTypeDescriptor;
+import org.hibernate.type.descriptor.sql.SqlTypeDescriptor;
/**
* An SQL dialect for DB2.
@@ -420,4 +422,9 @@ public boolean doesReadCommittedCauseWritersToBlockReaders() {
public boolean supportsTupleDistinctCounts() {
return false;
}
+
+ @Override
+ protected SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) {
+ return sqlCode == Types.BOOLEAN ? SmallIntTypeDescriptor.INSTANCE : super.getSqlTypeDescriptorOverride( sqlCode );
+ }
}

0 comments on commit ce74c6a

Please sign in to comment.