我在MySQL表(TINYINT(1))中有一个BOOLEAN类型,我正在尝试映射实体中的布尔字段,但是会产生一个异常:
org.hibernate.HibernateException: Wrong column type in maegul.users for column admin. Found: bit, expected: boolean
我将实体中的字段更改为字节,并进行相应的更改,因此它的行为是一个布尔值,我得到:
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