Wednesday, 11 September 2013

JPA: How to associate entities with relationship attributes?

JPA: How to associate entities with relationship attributes?

We can always do :
EntityA @OneToOne EntityB
EntityC @OneToMany EntityD
But what if you have relationship properties associated ?
Like:
EntityC -- JoinTable -- EntityD
|
|
EntityType
Now in this case my join table has 3 ids ( EntityC_id, EntityType_id,
EntityD_id )
How can I create an association with EntityC and EntityD ( With EntityType
) ?

No comments:

Post a Comment