Hi!
I have 2 tables - documents and scans. One document has one or more scans (OneToMany). Table document has complex primary key on fields docId and docIdVersion. I have a class DocumentPK. In Document entity i have:
@EmbeddedId
@AttributeOverrides({
@AttributeOverride(name = "docId", column = @Column(name = "docId")),
@AttributeOverride(name = "docIdVersion", column = @Column(name = "docIdVersion"))
})
public DocumentPK getDocumentPK()
{
return documentPK;
}
It's great. Problem is how can I make referance from entity Scan (it has the same 2 columns as a FK) to table Document?
Best regards.
Rafal