[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-6935) HibernateException in mysql Found: bit, expected: boolean

Torsten Krah (JIRA) noreply at atlassian.com
Tue Jan 10 07:53:09 EST 2012


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-6935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45062#comment-45062 ] 

Torsten Krah commented on HHH-6935:
-----------------------------------

Workaround is to use a custom dialect which does map the boolean type to a bit(1) type which does result in the "old" behaviour:

public class MyDialect extends MySQL5InnoDBDialect {

  public MyDialect() {
    super();
    registerColumnType(Types.BOOLEAN, "bit(1)");
  }
}

Now validate passes and all is like before, i'll hope, correct me if not, at least it works for me.


> HibernateException in mysql Found: bit, expected: boolean
> ---------------------------------------------------------
>
>                 Key: HHH-6935
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6935
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 4.0.0.Final
>         Environment: spring jpa hibernate project above mysql 5.1
>            Reporter: orasio spieler
>              Labels: BooleanType, mysql
>         Attachments: hib4-check.zip
>
>
> Found the problem i also got org.hibernate.HibernateException: Wrong column type ... Found: bit, expected: boolean
> on BooleanType in hibernate 4 they changed the Ctor to
> public BooleanType() {
>     this( org.hibernate.type.descriptor.sql.BooleanTypeDescriptor.INSTANCE, BooleanTypeDescriptor.INSTANCE );
> }
> instead of old versions
> public BooleanType() {
>     this( BitTypeDescriptor.INSTANCE, BooleanTypeDescriptor.INSTANCE );
> }
> spieler.orasio at gmail.com

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list