RE: One to many relationships require reverse relationships?

From: Merritt, Scott (Scott.Merrit..amu.net)
Date: Fri Apr 25 2003 - 12:21:05 EDT

  • Next message: Andrus Adamchik: "RE: One to many relationships require reverse relationships?"

    Also, please try looking into the one-to-one relationship. I can't get
    it working even with a "reverse" relationship. Once I click the
    "to-many" on the child side it ends up working. I'd like to say, my
    parent has one, and only one child object. Also, when this other bug
    gets fixed, the parent can only get to this child, not the other way
    around.

    Thanks,
    -smerritt

    -----Original Message-----
    From: Andrus Adamchik [mailto:andru..bjectstyle.org]
    Sent: Thursday, April 24, 2003 8:54 PM
    To: cayenne-use..bjectstyle.org
    Subject: Re: One to many relationships require reverse relationships?

    > Hi Scott,
    >
    >> I saw the many-to-many relationship example in the users guide but am
    >> wondering why I have to create reverse relationships even when I
    build
    >> a one-to-many relationship?
    >
    > Cayenne always requires a reverse *Db* relationship, but not *Obj*
    > relationship. So from the object model perspective you are OK: your
    Java
    > classes will only have the required methods, and no artificial
    "reverse"
    > properties are needed.
    >
    > This is just the way inner working is done in Cayenne. In the future
    we
    > will most likely implement DbRelationships to be bidirectional by
    > definition to avoid such confusion.

    I looked at the sample code that Scott sent me, this is indeed a bug.
    (Only when there is one-way TO MANY, it works as advertised for one way
    TO
    ONE). Once SourceForge gets out of the maintenance mode, and I can get
    to
    the bug tracker, I will enter a bug for that. Though the fix is not
    trivial and some investigation is needed.

    Thanks.

    Andrus



    This archive was generated by hypermail 2.0.0 : Fri Apr 25 2003 - 12:21:20 EDT