Re: Many to Many Relation

From: Dhruti Ramani (dhrutiraman..ahoo.com)
Date: Wed Jun 29 2005 - 14:53:58 EDT

  • Next message: Daniel Lorimer: "Need help with date query"

    I thought so but I read the userguide and misunderstood it. Now i can have M to M relations between UserRole and SystemUser. Thank you so much.
     
    Another Problem . When I generate those two classes I don't get any add or remove methods, I just got getUsers() in UserRole and getRoles() in SystemUser.
     
    In userguide I read somewhere that "Most of flattened relationships are treated as read-only by Cayenne. Only one (the most commonly used) type is read/write. It is many-to-many (n:m) flattened relationships with a single join table."
     
    So how do I insert values to those objects?
    Thanks,
    Denna

    Mike Kienenberger <mkienen..laska.net> wrote:
    Dhruti Ramani wrote:
    > Thanks for helping. I have tried what ever you asked in your last email. I
    have created a new DbEntity called "UserRole_systemUser" and between
    UserRole and UserRole_systemUser I did 1 to M and between
    UserRole_SystemUser and SystemUser I have 1 to 1. is this correct?
    >
    > now in object entity I can get ToMany relation from "UserRole" but not
    from "SystemUser".
    >
    > What am I missing here?

    Between UserRole_SystemUser and SystemUser needs to be 1 to M.
    Each system user can have many roles.

    Otherwise, you just have a flattened one to many relationship and not a
    flattened many to many relationship.

                    
    ---------------------------------
    Yahoo! Sports
     Rekindle the Rivalries. Sign up for Fantasy Football



    This archive was generated by hypermail 2.0.0 : Wed Jun 29 2005 - 14:54:00 EDT