是否可以将变量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;
...
}
提前致谢....