Reputation: 4463
I have these ER relations:
Person
ID_PERSON
NAME
Animal
ID_ANIMAL
NAME
Person_animal
ID_PERSON
ID_ANIMAL
DATE_OF_BUY
How to map the property DATE_OF_BUY in the association?
Upvotes: 0
Views: 2076
Reputation: 18379
The best way is normally to map the join table to a relationship class. i.e.
Person - OneToMany - AnimalOwnership - ManyToOne - Animal
See,
In JPA 2.0 you can also use a MapKey for some additional data, but this is normally more complex.
Upvotes: 2