@Column(columnDefinition="boolean default false")
public boolean getusernameChange() {
return usernameChange;
}
public void setusernameChange(boolean usernameChange) {
this.usernameChange =usernameChange;
}
上述方法是使用@Entity
注释实现的。
答案 0 :(得分:0)
删除旧列并使用以下@Column
注释
@Column(name="USER_CHANGE", columnDefinition = "tinyint default false")
答案 1 :(得分:0)
尝试
@Type(type = "org.hibernate.type.NumericBooleanType")
private Boolean usernameChange = false;
public Boolean getUsernameChange() {
return this.usernameChange;
}
public void setUsernameChange(Boolean usernameChange) {
this.usernameChange = usernameChange;
}