Carte un tinyint as boolean hibernate

J'ai un type BOOLÉEN dans une table MySQL (TINYINT(1)) et je suis en train de cartographier le champ booléen dans une entité, mais cela génère une exception:

org.hibernate.HibernateException: Wrong column type in maegul.users for column admin. Found: bit, expected: boolean

J'ai changé le champ dans mon entité d'octets et de faire les changements respectifs agit d'un booléen, et j'obtiens:

org.hibernate.HibernateException: Wrong column type in maegul.users for column admin. Found: bit, expected: tinyint

J'ai essayé d'utiliser le @Type annotation sur le terrain:

@Type(type = "org.hibernate.type.NumericBooleanType")

mais j'obtiens:

org.hibernate.HibernateException: Wrong column type in maegul.users for column admin. Found: bit, expected: integer
  • Ce que votre version de MySQL ?
  • c'est 5.5.16
  • probablement quelques infos utiles ici.
  • toute bonne réponse ci-dessous??
  • Je pense que c'est une double question qui a été posée ici : stackoverflow.com/questions/3383169/...
InformationsquelleAutor Alvin Baena | 2011-11-07