Re: Many To Many relations: how to?

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Jul 01 2004 - 13:48:51 EDT

  • Next message: Andrus Adamchik: "Re: Rich Client and other J2EE related Qs"

    > Hello Claudio!
    >
    > You have to create a join table. It can be done from the Modeler.
    >
    > http://www.objectstyle.org/cayenne/modelerguide/modeling-object-layer/
    > flattenedrel.html
    >
    > Regards,
    > - Tore.

    Adding to Tore's comment ... right now you will have to create a join
    DbEntity (and generate a corresponding table in DB from the modeler
    provided SQL). This table should have two PK columns - RECORD_ID and
    COLLOCATION_ID, both are also FKs to RECORD and COLLOCATION tables. Create
    all DbRelationships in the modeler.

    Also the docs screenshots for making flattened many-to-many are a bit
    outdated. The dialogs have changed in 1.1 (and will likely be improved
    further in Beta). But the idea is the same - take an ObjRelationship and
    map it to a chain of DbRelationships.

    Andrus

    P.S. - Claudio, you are making a good point - we should actually have some
    sort of wizard/checkbox that automatically creates a join table for
    many-to-many. Feel free to open a feature request for that.



    This archive was generated by hypermail 2.0.0 : Thu Jul 01 2004 - 13:48:52 EDT