@Entity
@Table(name = "RMS_USER_UPDATE", uniqueConstraints = {
@UniqueConstraint(columnNames = "UPDATE_ID") })
public class UserUpdateData implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "UPDATE_ID", unique = true, nullable = false)
private long updateId;
@Column(name = "USER_ID", unique = false, nullable = true)
private long userId;
@Column(name = "CNAME", unique = false, nullable = true)
private String cname;
@Column(name = "BALANCE_AMOUT ", unique = false, nullable = true)
private double balanceAmnt;
这是我的实体类。我没有使用任何类型的映射,但 USER_ID 列对于其他一些表是通用的。当我运行代码时,显示 BALANCE_AMOUT 的重复列名称错误。 错误是,
[ERROR] 2017-08-04 07:18:AM [org.hibernate.tool.hbm2ddl.SchemaUpdate]
[execute : 236] - HHH000388: Unsuccessful: alter table RMS_USER_UPDATE add
column BALANCE_AMOUT double precision
[ERROR] 2017-08-04 07:18:AM [org.hibernate.tool.hbm2ddl.SchemaUpdate]
[execute : 237] - Duplicate column name 'BALANCE_AMOUT'
当我更改 BALANCE_AMOUT 的列名时,错误消失了。为什么会这样?我没理由。有人可以帮忙吗?