diff --git a/hibernate-core/src/main/java/org/hibernate/dialect/SybaseAnywhereDialect.java b/hibernate-core/src/main/java/org/hibernate/dialect/SybaseAnywhereDialect.java index 730da230c8..fa44131bbe 100644 --- a/hibernate-core/src/main/java/org/hibernate/dialect/SybaseAnywhereDialect.java +++ b/hibernate-core/src/main/java/org/hibernate/dialect/SybaseAnywhereDialect.java @@ -7,8 +7,12 @@ package org.hibernate.dialect; +import java.sql.Types; + import org.hibernate.dialect.identity.IdentityColumnSupport; import org.hibernate.dialect.identity.SybaseAnywhereIdentityColumnSupport; +import org.hibernate.type.descriptor.sql.BitTypeDescriptor; +import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; /** * SQL Dialect for Sybase Anywhere @@ -16,6 +20,13 @@ import org.hibernate.dialect.identity.SybaseAnywhereIdentityColumnSupport; * (Tested on ASA 8.x) */ public class SybaseAnywhereDialect extends SybaseDialect { + + public SybaseAnywhereDialect() { + super(); + + registerColumnType( Types.BOOLEAN, "bit" ); + } + /** * Sybase Anywhere syntax would require a "DEFAULT" for each column specified, * but I suppose Hibernate use this syntax only with tables with just 1 column @@ -30,7 +41,7 @@ public class SybaseAnywhereDialect extends SybaseDialect { /** * ASA does not require to drop constraint before dropping tables, so disable it. *
- * NOTE : Also, the DROP statement syntax used by Hibernate to drop constraints is + * NOTE : Also, the DROP statement syntax used by Hibernate to drop constraints is * not compatible with ASA. * * {@inheritDoc} @@ -44,4 +55,9 @@ public class SybaseAnywhereDialect extends SybaseDialect { public IdentityColumnSupport getIdentityColumnSupport() { return new SybaseAnywhereIdentityColumnSupport(); } + + @Override + protected SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) { + return sqlCode == Types.BOOLEAN ? BitTypeDescriptor.INSTANCE : super.getSqlTypeDescriptorOverride( sqlCode ); + } }