在服务器启动时,hibernate通过添加新列来改变表。当它在控制台中打印时,"架构更新完成"桌子被改变了。!
我有一个表格,其中包含少量数字类型的字段。但是当我从eclipse启动我的tomcat时,hibernate通过添加同名数据类型float的新列来改变我的表。
这个
背后的根本原因是什么?import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "EPAMRT_BUC_COSTS_ARRAY")
public class EPAMRTBucCostArray {
@Id
@GeneratedValue
private Integer BUC_COSTS_ARRAY_ID;
@Column(name= "BUC_CODE")
private String BUC_CODE;
@Column(name= "BUC_DESC")
private String BUC_DESC;
@Column(name= "BUC_AMOUNT")
private BigDecimal BUC_AMOUNT;
@Column(name= "MTD_BUC")
private BigDecimal MTD_BUC;
@Column(name= "YTD_BUC")
private BigDecimal YTD_BUC;
@Column(name= "UNAMRT_BUC")
private BigDecimal UNAMRT_BUC;
public Integer getBUC_COSTS_ARRAY_ID() {
return BUC_COSTS_ARRAY_ID;
}
public void setBUC_COSTS_ARRAY_ID(Integer bUC_COSTS_ARRAY_ID) {
BUC_COSTS_ARRAY_ID = bUC_COSTS_ARRAY_ID;
}
public String getBUC_CODE() {
return BUC_CODE;
}
public void setBUC_CODE(String bUC_CODE) {
BUC_CODE = bUC_CODE;
}
public String getBUC_DESC() {
return BUC_DESC;
}
public void setBUC_DESC(String bUC_DESC) {
BUC_DESC = bUC_DESC;
}
public BigDecimal getBUC_AMOUNT() {
return BUC_AMOUNT;
}
public void setBUC_AMOUNT(BigDecimal bUC_AMOUNT) {
BUC_AMOUNT = bUC_AMOUNT;
}
public BigDecimal getMTD_BUC() {
return MTD_BUC;
}
public void setMTD_BUC(BigDecimal mTD_BUC) {
MTD_BUC = mTD_BUC;
}
public BigDecimal getYTD_BUC() {
return YTD_BUC;
}
public void setYTD_BUC(BigDecimal yTD_BUC) {
YTD_BUC = yTD_BUC;
}
public BigDecimal getUNAMRT_BUC() {
return UNAMRT_BUC;
}
public void setUNAMRT_BUC(BigDecimal uNAMRT_BUC) {
UNAMRT_BUC = uNAMRT_BUC;
}
}
架构更新完成后,有4列要添加的是MTD_BUC,YTD_BUC,UNAMRT_BUC和BUC_DESC
之前我的表是:由hibernate修改: