Navigation Menu

Skip to content

Commit

Permalink
Remove BIT column type registrations from dialects
Browse files Browse the repository at this point in the history
  • Loading branch information
beikov committed Feb 24, 2021
1 parent 9ce2fa9 commit 0f92f53
Show file tree
Hide file tree
Showing 17 changed files with 1 addition and 40 deletions.
Expand Up @@ -767,9 +767,7 @@ public AbstractHANADialect() {
registerColumnType( Types.VARCHAR, "clob" );
registerColumnType( Types.NVARCHAR, "nclob" );

registerColumnType( Types.BIT, 1, "boolean" );
// map bit/tinyint to smallint since tinyint is unsigned on HANA
registerColumnType( Types.BIT, "smallint" );
// map tinyint to smallint since tinyint is unsigned on HANA
registerColumnType( Types.TINYINT, "smallint" );

registerHibernateType( Types.NCLOB, StandardBasicTypes.MATERIALIZED_NCLOB.getName() );
Expand Down
Expand Up @@ -43,9 +43,6 @@ public AbstractTransactSQLDialect() {

registerColumnType( Types.BOOLEAN, "bit" );

//SQL Server/Sybase 'bit' type is always exactly one bit
registerColumnType( Types.BIT, "smallint" );

//'tinyint' is an unsigned type in Sybase and
//SQL Server, holding values in the range 0-255
//see HHH-6779
Expand Down
Expand Up @@ -102,7 +102,6 @@ public DB2Dialect(int version) {
//prior to DB2 11, the 'boolean' type existed,
//but was not allowed as a column type
registerColumnType( Types.BOOLEAN, "smallint" );
registerColumnType( Types.BIT, 1, "smallint" );
}

registerColumnType( Types.BLOB, "blob($l)" );
Expand Down
Expand Up @@ -98,10 +98,6 @@ public DerbyDialect(int version) {

if ( getVersion() < 1070) {
registerColumnType( Types.BOOLEAN, "smallint" ); //no boolean before 10.7
registerColumnType( Types.BIT, 1, "smallint" ); //no bit
}
else {
registerColumnType( Types.BIT, 1, "boolean" ); //no bit
}
registerColumnType( Types.TINYINT, "smallint" ); //no tinyint
registerColumnType( Types.CHAR, 254, "char($l)" );
Expand Down
Expand Up @@ -157,8 +157,6 @@ public abstract class Dialect implements ConversionContext {

protected Dialect() {

registerColumnType( Types.BIT, 1, "bit" );
registerColumnType( Types.BIT, "bit($l)" );
registerColumnType( Types.BOOLEAN, "boolean" );

registerColumnType( Types.TINYINT, "tinyint" );
Expand Down
Expand Up @@ -94,9 +94,6 @@ public FirebirdDialect(int version) {
super();
this.version = version;

registerColumnType( Types.BIT, 1, "smallint" );
registerColumnType( Types.BIT, "smallint" );

if ( getVersion() < 300 ) {
//'boolean' type introduced in 3.0
registerColumnType( Types.BOOLEAN, "smallint" );
Expand Down
Expand Up @@ -91,8 +91,6 @@ public H2Dialect(int version) {
? OffsetFetchLimitHandler.INSTANCE
: LimitOffsetLimitHandler.INSTANCE;

//Note: H2 'bit' is a synonym for 'boolean', not a proper bit type
// registerColumnType( Types.BIT, "bit" );
if ( version < 102139 ) {
final int majorVersion = version / 100000;
final int minorVersion = version % 100000 / 1000;
Expand Down
Expand Up @@ -74,10 +74,6 @@ public InformixDialect(int version) {
super();
this.version = version;

// Informix doesn't have a bit type
registerColumnType( Types.BIT, 1, "boolean" );
registerColumnType( Types.BIT, "smallint" );

registerColumnType( Types.TINYINT, "smallint" );
registerColumnType( Types.BIGINT, "int8" );

Expand Down
Expand Up @@ -87,14 +87,11 @@ public IngresDialect(int version) {
this.version = version;

if ( getVersion() < 1000 ) {
registerColumnType( Types.BIT, 1, "tinyint" );
registerColumnType( Types.BOOLEAN, "tinyint" );
}
else {
registerColumnType( Types.BIT, 1, "boolean" );
registerColumnType( Types.BOOLEAN, "boolean" );
}
registerColumnType( Types.BIT, "tinyint" );

registerColumnType( Types.NUMERIC, "decimal($p, $s)" ); //Ingres has no 'numeric' type

Expand Down
Expand Up @@ -42,7 +42,6 @@ public class MaxDBDialect extends Dialect {

public MaxDBDialect() {
super();
registerColumnType( Types.BIT, 1, "boolean" ); //no BIT type
registerColumnType( Types.TINYINT, "smallint" );

registerColumnType( Types.BIGINT, "fixed(19,0)" );
Expand Down
Expand Up @@ -50,10 +50,7 @@ public class MimerSQLDialect extends Dialect {

public MimerSQLDialect() {
super();
//no 'bit' type
registerColumnType( Types.BIT, 1, "boolean" );
//no 'tinyint', so use integer with 3 decimal digits
registerColumnType( Types.BIT, "integer(3)" );
registerColumnType( Types.TINYINT, "integer(3)" );

//Mimer CHARs are ASCII!!
Expand Down
Expand Up @@ -521,8 +521,6 @@ protected void registerCharacterTypeMappings() {
}

protected void registerNumericTypeMappings() {
registerColumnType( Types.BIT, 1, "number(1,0)" );
registerColumnType( Types.BIT, "number(3,0)" );
registerColumnType( Types.BOOLEAN, "number(1,0)" );

registerColumnType( Types.BIGINT, "number(19,0)" );
Expand Down
Expand Up @@ -83,8 +83,6 @@ public RDMSOS2200Dialect() {
* Note that $l (dollar-L) will use the length value if provided.
* Also new for Hibernate3 is the $p percision and $s (scale) parameters
*/
registerColumnType( Types.BIT, 1, "smallint" );
registerColumnType( Types.BIT, "smallint" );
registerColumnType( Types.BOOLEAN, "smallint" );
registerColumnType( Types.TINYINT, "smallint" );
registerColumnType( Types.BIGINT, "numeric(19,0)" );
Expand Down
Expand Up @@ -64,8 +64,6 @@ public class SpannerDialect extends Dialect {

public SpannerDialect() {
registerColumnType( Types.BOOLEAN, "bool" );
registerColumnType( Types.BIT, 1, "bool" );
registerColumnType( Types.BIT, "int64" );

registerColumnType( Types.TINYINT, "int64" );
registerColumnType( Types.SMALLINT, "int64" );
Expand Down
Expand Up @@ -54,7 +54,6 @@ public SybaseASEDialect(int version) {
//tinyint to store signed bytes, we can use it
//to store boolean values)
registerColumnType( Types.BOOLEAN, "tinyint" );
registerColumnType( Types.BIT, 1, "tinyint" );


if ( getVersion() >= 1500 ) {
Expand Down
Expand Up @@ -80,8 +80,6 @@ public TeradataDialect(int version) {
this.version = version;

registerColumnType( Types.BOOLEAN, "byteint" );
registerColumnType( Types.BIT, 1, "byteint" );
registerColumnType( Types.BIT, "byteint" );

registerColumnType( Types.TINYINT, "byteint" );

Expand Down
Expand Up @@ -61,8 +61,6 @@ public TimesTenDialect() {
//Note: these are the correct type mappings
// for the default Oracle type mode
// TypeMode=0
registerColumnType( Types.BIT, 1, "tt_tinyint" );
registerColumnType( Types.BIT, "tt_tinyint" );
registerColumnType( Types.BOOLEAN, "tt_tinyint" );

registerColumnType(Types.TINYINT, "tt_tinyint");
Expand Down

0 comments on commit 0f92f53

Please sign in to comment.