Re: Maintaining relationship integrity

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Tue Dec 07 2004 - 19:49:13 EST

  • Next message: Andrus Adamchik: "Re: problem with flattened relationship"

    In this case Cayenne is "smart enough" ;-) Just setting a new subject
    should suffice.

    Andrus

    On Dec 6, 2004, at 8:03 PM, Alex Gunawan Wibowo wrote:
    > Hello..
    >
    >
    > Say I have 2 tables..
    >
    > Student and Subject.
    >
    > For the sake of simplicity, let's say a student can
    > only enrol in 1 subject, and a subject can have many
    > students.
    >
    > I have a student X that's enrolled in subject A, and
    > wishes
    > to move him/her to subject B.
    >
    > Do I have to manually call
    > subjectA.removeFromStudentArray(studentX);
    > and then
    > studentX.setSubject(subjectB);
    > ??
    > (subjectB.addToStudentArray(studentX) is not
    > necessary, am I right??)
    >
    > (I hope Cayenne is smart enough so that I just need to
    > call
    > studentX.setSubject(subjectB);
    > )
    >
    >
    > Sorry for the basic question...
    >
    > Thanks a lot!
    >
    > Best regards,
    >
    > Alex.
    >
    >
    >
    > __________________________________
    > Do you Yahoo!?
    > Meet the all-new My Yahoo! - Try it today!
    > http://my.yahoo.com
    >
    >
    >



    This archive was generated by hypermail 2.0.0 : Tue Dec 07 2004 - 19:49:16 EST