openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Hardy <adam....@cyberspaceroad.com>
Subject many-to-many with extra value
Date Thu, 23 Oct 2008 17:54:30 GMT
Just reading the EJB3 persistence spec and would like to get some knowledgeable 
confirmation that my understanding is correct:

AFAIK if I have a unidirectional many-to-many relationship from A to B, so A has 
a collection of Bs in my object model, there's no way in the current JPA spec to 
cater for mapping an extra value from the join table onto my B object.

The more I think about how it might be implemented behind the scenes, the more I 
think it is probably rife with impossible requirements, but I thought I'd ask.

Alternatively I guess I could map the join table to a new object C which has the 
property / extra value, and to make coding against it easier, give it 
pass-through getters and setters for the B object's properties.

How have others approached this?

Regards
Adam


Mime
View raw message