Maintaining relationship integrity

From: Alex Gunawan Wibowo (netzone_tec..ahoo.com)
Date: Mon Dec 06 2004 - 20:03:45 EST

  • Next message: Mike Kienenberger: "Re: Reading Cayenne configuration from custom streams."

    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 : Mon Dec 06 2004 - 20:03:47 EST