JPA为字段设置默认值

在使用JPA时,若是须要为属性设置默认值,很天然的,你可能会想到用下面的方式。java @Column(name="state",columnDefinition="tinyint default 0") private Integer state=0; 但很不幸的是,这种方案有时候并不可行,缘由在于columnDefinition是在建立表的时候使用的,若是你的表不是自动生成的。web 那咱们又
相关文章
相关标签/搜索