Menu

Aggregation

M Benny
2004-11-24
2013-03-07
  • M Benny

    M Benny - 2004-11-24

    Hi,

    I've got an object Student and an object College. College has a collection of students and a student can be part of a College.

    Mapping this in a relational database, I've got a table of students, a table of colleges. And an associative table CollegeStudents. The last only consists of a FK to the OID of a student and a FK to a College.

    How can I get the students from a College (like oCollege.Students) and the College (if it has been assigned) from a student (like oStudent.College). The examples from your site only have direct associations between tables.

     
    • Richard Banks

      Richard Banks - 2004-12-02

      Hi,

      This is a standard one-to-many association.  Have a look at the sample code for order/orderline classes (in the source .zip download) to get an idea of how this is done.

      If you still have questions after that, please feel free to ask.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.