How map a bit type in Mysql to hibernate?

前端 未结 4 1616
情书的邮戳
情书的邮戳 2021-01-04 14:20

i use the reverse engeneering in my class and get this:

@Entity
@Table(name = \"user\", catalog = \"bytecode\", uniqueConstraints =
@UniqueConstraint(columnN         


        
4条回答
  •  北海茫月
    2021-01-04 14:53

    Hibernate has a special numeric_boolean type for this kind of mapping. You can configure it as follows:

    @Type(type = "numeric_boolean")
    private boolean type;  
    

    See also:

    • 6.1.1. Basic value types

提交回复
热议问题