如果我这样写
<html amp>
它说
@Id
@OneToOne
@JoinColumn(name="Id")
private Region region;
我不希望它是复合键,我只想将Composite-id class must implement Serializable: ....InPopulation
替换为适当ID的id
。
答案 0 :(得分:1)
你使用MapsId
注释(我假设如何声明@Id):
@Id
private Long id;
@JoinColumn(name = "Id")
@OneToOne
@MapsId
private Region region;