“Found: bit, expected: boolean” after Hibernate 4 upgrade

前端 未结 5 1874
无人及你
无人及你 2020-12-08 14:03

I\'m trying to upgrade from Hibernate 3.6.5 to 4.0 (and from Spring 3.0.5 to 3.1 which is required for Hibernate 4 support).

Now, with both MySQL and HSQL, I\'m runn

5条回答
  •  孤街浪徒
    2020-12-08 14:32

    I had the same problem and I extended the Dialect to take into account the fact that mysql treats boolean as an alias of bit.

    public class Mysql5BitBooleanDialect extends MySQL5Dialect{     
        public Mysql5BitBooleanDialect() {
            super();
            registerColumnType( java.sql.Types.BOOLEAN, "bit" );        
        }       
    }
    

    I don't use longer bit() fields (to represent for example byte[]) so this might break that.

提交回复
热议问题