How to set default boolean value in JPA

前端 未结 9 1516
遥遥无期
遥遥无期 2021-02-01 13:53

I have an attribute

private boolean include;

I would like to set its default value to true, so that in the database it must display True from d

9条回答
  •  闹比i
    闹比i (楼主)
    2021-02-01 14:09

    Maybe will be useful for people who work with Microsoft SQL SERVER

        @Column(columnDefinition="bit default 0")
        private Boolean active;
    

    Possible values: 0 or 1

提交回复
热议问题