db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Bengtson" <e...@jpox.org>
Subject RE: Detecting inconsistencies of mapped-by declarations?
Date Thu, 07 May 2009 19:32:48 GMT
>Why would you want to have two different fields for the same
>association? As far as I can see, it would always hold true that
>b.a1==b.a2. You could express that in OCL in your UML, but in most cases
>in the jdo metadata the above would be an error. You could still have
>another getter getA2() returning the same field a1 if you really want
>that behaviour implemented.

It's not the same association. There are two associations in here, and they
are probably meant to be used exclusively.

>In UML you'd have to write something like "for any b1 of type B1 and b2
>of type B2: b1.a==b2.a" in OCL to express the above. Why should we
>support implementing this using mapped-by if no database supports it?
>Also, you can of course still implement this in other ways.

Why not? We can add one column that preserves the role name(example 1) of
the association or the class name(example 2) that has the association

I think we can raise a warning if the user tries to map such situations, but
throwing an error would be a blocker for advanced usage.

View raw message