openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject Re: many-to-many with extra value
Date Fri, 24 Oct 2008 05:01:24 GMT
In JDO, you would map this to a Map<Other, Extra>. I'd have to check  
whether OpenJPA supports this directly...

Craig

On Oct 23, 2008, at 10:54 AM, Adam Hardy wrote:

> 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
>

Craig L Russell
Architect, Sun Java Enterprise System http://db.apache.org/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Mime
View raw message