我在hibernate带注释的超类的子类中有两个布尔值以及其他几个属性:
private Boolean currentLoan;
private Boolean unpaidFine;
@Column(name="current_loan")
@NotNull
public Boolean hasCurrentLoan() {
return currentLoan;
}
public void setCurrentLoans(boolean currentLoan) {
this.currentLoan = currentLoan;
}
@Column(name="unpaid_fine")
@NotNull
public Boolean hasUnpaidFine() {
return unpaidFine;
}
public void setUnpaidFine(boolean unpaidFine) {
this.unpaidFine = unpaidFine;
}
当hibernate创建表时,子类的其他属性在超类的表中显示为列,除了这两个。我注意到其他属性不是 Boolean 类型。我在这里做错了什么?
答案 0 :(得分:0)
尝试将“has”方法更改为“is”方法。另外,如何声明其他列正在工作。恩。 public boolean isUnpaidLoans()