Re: Arbitrary reverse relationship limitations

From: Malcolm Edgar (malcolm.edga..mail.com)
Date: Sun Aug 05 2007 - 07:06:17 EDT

  • Next message: Michael Gentry: "Re: Java 5"

    That would be great.

    Often object elationships represent ownership, so having the reverse
    relationship exposed doesn't make much sense. Also I often have the
    use case where may classes will have a relationship with a particular
    class, which ends up being cluttered with the reverse relationships.

    regards Malcolm Edgar

    On 8/5/07, Andrus Adamchik <andru..bjectstyle.org> wrote:
    > We have two rules related to relationship mapping that we can really
    > do well without:
    >
    > 1. A DbRelationship always requires a reverse DbRelationship.
    > 2. A to-many ObjRelationship without a reverse to-one is effectively
    > read only.
    >
    > I've done some work on a project where we've used generic persistent
    > classes, and it occurred to me that while the two things above are
    > indeed a property of Cayenne runtime, users don't have to worry about
    > such low level details. Cayenne can automagically add missing reverse
    > relationships in runtime to the corresponding entities, without user
    > ever noticing. That simple - don't know why nobody thought of that
    > before :-)
    >
    > BTW what makes (2) painless is CayenneDataObject that can store
    > arbitrary data in it, so a back pointer from toOne side to the toMany
    > site can be stored. This won't work in case of POJO's (without extra
    > enhancement), but for normal Cayenne we get that functionality out of
    > the box.
    >
    > Any comments on that?
    >
    > Andrus
    >
    >
    >
    >
    >



    This archive was generated by hypermail 2.0.0 : Sun Aug 05 2007 - 07:06:44 EDT