Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

In JDO, can a foreign key be part of a primary key?

Hi, it's possible to have a foreing key a part of a primary key in JDO?

The JDO checker is complaining about that. It says "Primary key field 'person' cannot declare relationship".

For example, if I have an entity 'Person' (id, name) and and entity 'Pet' (name, age). Can I have the primary key of 'Person' (id) as a foreign key in 'Pet', and can I have a compound primary key in 'Pet' with 'name' and 'id' as the compound key?

Thanks in advance.

Rafael

Not what you were looking for? View more on this topic or Ask a question