Re: having two sep. foreign keys with same table

From: Dhruti Ramani (dhrutiraman..ahoo.com)
Date: Fri Jun 10 2005 - 15:28:37 EDT

  • Next message: Andrus Adamchik: "Re: Conn to MS SQL Server in Modeler"

    Thank you so much for your help.
     
    Denna

    Andrus Adamchik <andru..bjectstyle.org> wrote:
    Denna,

    In Cayenne terms you'll have to add 2 DbAttributes to the Deal DbEntity. I
    would call them "primary_contact_id" and "secondary_contact_id" (if needed
    adjust the names to follow your naming convention for DbAttributes).

    Then map 2 corresponding DbRelationships to SystemUser using the following
    joins: (Deal.primary_contact_id/SystemUser.id) and
    (Deal.secondary_contact_id/SystemUser.id)

    Andrus

    P.S. For those who are wondering what this is all about, it is a followup
    on this message (and some offline discussion that we had):
    http://objectstyle.org/cayenne/lists/cayenne-user/2005/06/0019.html

    > Andrus you said,
    >
    > Join on "deal_id" is probably wrong (it seems to be done backwards). If
    > I understand correctly what you are trying to achieve, I'd say Deal table
    > should have two separate foreign keys pointing to SystemUser primary
    > key
    > (e.g. Deal.primaryContactId and Deal.secondaryContactId). Map
    > relationships using those keys. Both forward and reverse relationships
    > should work.
    >
    > Andrei
    >
    > SystemUser has one primary key systemUser_id how do I add two foreign keys
    > for this in Deal in cayenne modeler?
    > Thanks,
    > Denna
    >

                    
    ---------------------------------
    Yahoo! Mail
     Stay connected, organized, and protected. Take the tour



    This archive was generated by hypermail 2.0.0 : Fri Jun 10 2005 - 15:28:38 EDT