Doesn't work setting default value of property in Hibernate

前端 未结 2 969
北海茫月
北海茫月 2021-02-05 10:20

I have a boolean property in my entity. Here\'s my annotations for it:

@Column(name = \"IS_ACTIVE\", nullable = false, columnDefinition=\"BIT DEFAULT 1\", length         


        
2条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-05 10:53

    Try using BOOLEAN data type, define your @Column annotation like that:

    @Column(name = "IS_ACTIVE", columnDefinition = "boolean default true", nullable = false)
    private Boolean active = true;
    

提交回复
热议问题