Re: Many To Many relations: how to?

From: Tore Halset (halse..vv.ntnu.no)
Date: Thu Jul 01 2004 - 13:14:48 EDT

  • Next message: Andrus Adamchik: "Re: Help: Cannot set the read only flattened relationship x"

    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.

    On Jul 1, 2004, at 6:02, Claudio Rosati wrote:

    > Hello all,
    >  
    > I have two classes, Record and Collocation, that should have a
    > many-to-many relation, like the one in the picture.
    >  
    > <image.tiff> 
    > Each class is backed by a corresponding DbEntity (records and
    > collections). These entities contains just one attribute: a primary
    > key VARCHAR[64] one called uid, reflected into the corresponding
    > class as the uid String attribute.
    >  
    > What I would like is the situation depicted, where when I add a
    > Collocation to a Record using the addToCollocations method, the
    > corresponding list of Records in the Collocation object is updated
    > automatically.
    >  
    > Being ignorant about DBs and their management (this is why I'm using
    > Cayenne), I don't understand if it is possible and how to realize it
    > with Cayenne (and its modeler): I need to add some attributes to the
    > DbEntities (which one?), I need to add helper tables (whicwh one?),
    > Which kind of relation I need to set up...?
    >  
    > Thanks in advance for any help.
    >  
    > Claudio
    >  
    >  
    >
    > <image.tiff>Multimedia Division
    >
    > Claudio Rosati
    > Project Manager
    > Advanced Computer Systems S.p.A.
    > via Della Bufalotta 378
    > 00139 Roma, RM
    > Italy
    >
    > claudio.rosat..csys.it
    >
    > tel:
    > fax:
    > +39 06 8709 0516
    > +39 06 8720 1502
    >
    > Signature powered by Plaxo
    > Want a signature like this?
    >
    > Add me to your address book...
    >  



    This archive was generated by hypermail 2.0.0 : Thu Jul 01 2004 - 13:15:00 EDT