A different object with the same identifier value was already associated with the session
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
在主码上加上
IDENTITY:主键由数据库自动生成(主要是自动增长型)
A different object with the same identifier value was already associated with the session
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
在主码上加上
IDENTITY:主键由数据库自动生成(主要是自动增长型)