HHH-6759 : Null properties mapped as boolean cause exception on Oracle

This commit is contained in:
Gail Badner 2011-10-21 16:02:33 -07:00
parent 0d007bce7c
commit 70b9210864
1 changed files with 7 additions and 0 deletions

View File

@ -43,6 +43,8 @@ import org.hibernate.sql.DecodeCaseFragment;
import org.hibernate.sql.JoinFragment; import org.hibernate.sql.JoinFragment;
import org.hibernate.sql.OracleJoinFragment; import org.hibernate.sql.OracleJoinFragment;
import org.hibernate.type.StandardBasicTypes; import org.hibernate.type.StandardBasicTypes;
import org.hibernate.type.descriptor.sql.BitTypeDescriptor;
import org.hibernate.type.descriptor.sql.SqlTypeDescriptor;
/** /**
* A dialect for Oracle 8i. * A dialect for Oracle 8i.
@ -197,6 +199,11 @@ public class Oracle8iDialect extends Dialect {
getDefaultProperties().setProperty( Environment.USE_GET_GENERATED_KEYS, "false" ); getDefaultProperties().setProperty( Environment.USE_GET_GENERATED_KEYS, "false" );
} }
@Override
protected SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) {
return sqlCode == Types.BOOLEAN ? BitTypeDescriptor.INSTANCE : super.getSqlTypeDescriptorOverride( sqlCode );
}
// features which change between 8i, 9i, and 10g ~~~~~~~~~~~~~~~~~~~~~~~~~~ // features which change between 8i, 9i, and 10g ~~~~~~~~~~~~~~~~~~~~~~~~~~