Cameron Wallace McKenzie wrote:
How do you enforce a constrained association between two tables without an apparently redundant and superfluous foreign key?
Each field in the table can be used as foreign key, even primary key. In table A field id can be autoincrement, in table B it should be usual integer that is linked with table A.
The same happens when a table builds many-to-many relationship. It doesn't have any special primary keys. We use pair of foreign keys as a natural primary key. I want the same but for one foreign key instead of two.
Is it impossible in JPA ?