0

is it possible to set the DDL type Boolean to all @Basic attributes of type java.lang.Boolean?

I'm using Hibernate, which by default creates an sql bit as DDL type.

Update

I currently solved it Hibernate specific by using a custom org.hibernate.dialect.Dialect with:

registerColumnType(Types.BOOLEAN, "boolean"); 
Stefan K.
  • 7,701
  • 6
  • 52
  • 64

1 Answers1

0

I currently solved it with a Hibernate specific way by using a custom org.hibernate.dialect.Dialect:

public class MySqlDialect extends MySQL57InnoDBDialect {
    public MySqlDialect() {
        registerColumnType(Types.BOOLEAN, "boolean");
    }
}

I registered it with the Spring Boot property:

spring.jpa.database-platform=my.MySqlDialect
Stefan K.
  • 7,701
  • 6
  • 52
  • 64