我需要将我的项目的“最新版本”编号加入表 Project_version。如何使用注释 @JoinColumn 等声明它?
我的表“项目”:
* Project_id
Title
...
LastVersion_id
我的表“ Project_version ”(主键 = Project_id + Version_id):
* Project_id
* Version_id
DateCreat
...
我的 bean “ Project ”:我需要声明属性“ LastVersion_id ”来加入 Project_version:
@Id
private Integer Project_id;
private String Title
...
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name="LastVersion_id")
// How to declare the join to (Project_id + Version_id) ?
private Project_version pv;