是否可以将变量声明Long documentID
为外键而不是自然的Document document
?下面的例子:
@Entity
@Table("document")
class Document{
...
@Id
Long id;
...
}
@Entity
@Table("something")
class Something{
....
//instead of
@ManyToOne
Document document;
// this one with the appropriate annotations
Long documentID;
...
}
提前致谢....