[Prev] Thread [Next] |
[Prev] Date [Next]
Re: Detecting inconsistencies of mapped-by declarations?
Jörg von Frantzius
Thu May 07 14:00:18 2009
I just happened to write:
> >> Also it is possible to declare two fields in two different classes, e.g.
> >> B1.a and B2.a, with the identical mapped-by pointing to the same field
> >> of the same related class, e.g. A.a. That would mean that in theory two
> >> FKs would have to be created for the same column, pointing to different
> >> tables. That neither seems to make sense to me.
> > It makes sense to me. Same as above.
> > It's not common to handle these associations in relational databases, but
> > very common when using UML.
> 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
Sorry that was utter nonsense. After thinking about really, it rather
seems to mean two mutually exclusive associations. So if an object of
type A is referenced by a B1 object through B1.a, there can be no B2
object referencing it through B2.a (and vice versa).
Implementing this using mapped-by would firstly lead to problems due to
impossibility of FK constraints, and secondly be one of the least
obvious and understandable ways of implementing it ;)
RE: Detecting inconsistencies of mapped-by declarations? Erik Bengtson
Re: Detecting inconsistencies of mapped-by declarations? Jörg von Frantzius <=
- Re: Detecting inconsistencies of mapped-by declarations?, (continued)