我在MySQL表中有一个BOOLEAN类型的字段(TINYINT(1)),我试图映射实体中的布尔字段,但这会生成一个异常:
org.hibernate.HibernateException: Wrong column type in maegul.users for column admin. Found: bit, expected: boolean
我把实体中的字段改成了byte类型,并做出相应的更改,使其作为布尔值运行,但是我收到了如下错误信息:
org.hibernate.HibernateException: Wrong column type in maegul.users for column admin. Found: bit, expected: tinyint
我尝试在字段上使用@Type
注释:
@Type(type = "org.hibernate.type.NumericBooleanType")
但我得到了:
org.hibernate.HibernateException: Wrong column type in maegul.users for column admin. Found: bit, expected: integer