【发布时间】:2015-11-14 19:41:46
【问题描述】:
如果我将这样的列添加到现有实体,hibernate 无法添加该列,因为存在没有值的现有行:
@Column(name = "width", nullable = false)
private int width;
失败并出现此错误:
2015-11-14 20:33:41.163 ERROR 9068 --- [ost-startStop-1] org.hibernate.tool.hbm2ddl.SchemaUpdate : HHH000388: Unsuccessful: alter table texture add column width int4 not null
2015-11-14 20:33:41.163 ERROR 9068 --- [ost-startStop-1] org.hibernate.tool.hbm2ddl.SchemaUpdate : FEHLER: Spalte „width“ enthält NULL-Werte
我不想在我的数据库列定义中使用默认值。
【问题讨论】:
标签: java hibernate postgresql