0
Hibernate在本文后面的代码中创建空的“ID”列。删除休眠中复合键的冗余列
如何调整它以不创建“ID”列(“ID”是创建列的确切名称),或者这是无法更改的?
@Entity
@Table(name = "CATEGORY_RELATIONS")
public class CategoryRelations implements Serializable {
private CategoryRelationsPrimaryKey id;
@Id
@Column(name = "CATEGORY_RELATIONS_CATEGORY_ID")
private String categoryId;
@Id
@Column(name = "CATEGORY_RELATIONS_PARENT_ID")
private String parentId;
//getters and setters
@Entity
@IdClass(CategoryRelationsPrimaryKey.class)
public class CategoryRelationsPrimaryKey implements Serializable {
protected long categoryId;
protected long parentId;
//euqals, hashCode
}
}