locked
Entity Data Model Wizard: Missing Associations RRS feed

  • Question

  •  

    Hi,

     

    i created one Entity Data Model using the wizard.

    One oft the tables dont't get the existing foreign key associations (12x 1:1 or 1:n).

    Manually inserting the same associations is possible.

     

    Somebody with the same problem?

     

    Ciao:

    GG ;-)

    Tuesday, October 7, 2008 4:41 PM

Answers

  • Sorry for the delayed response...

     

    The EF does not support mapping scenarios where the FK is a subset of PK. It does support the case where FK is a subset of PK and also where FK is disjoint of PK. Support for the subset scenario in the next version is under consideration.

     

    -Brian

     

    Thursday, October 9, 2008 11:34 PM

All replies

  • Is the table that didn't get added to the model a link table (i.e. does it only contain keys that link two other tables)? If this is the case, a corresponding entity type will not be added to the model by design. This type of table appears as an association in the model.

     

    Let me know if this isn't your situation.

     

    -Brian

    Tuesday, October 7, 2008 10:03 PM
  • Hi Brian,

     Brian Swan - MSFT wrote:
    Is the table that didn't get added to the model a link table (i.e. does it only contain keys that link two other tables)?

    the table contains not only keys, it's the source table for positions, like:

    Master-Table

    [dbo].[REC_POS]
    [PK1][Version        decimal(9,0)]
    [PK2][Typ            decimal(2,0)]
    [PK3][PosNr          decimal(9,0)]
         [PosName       nvarchar(255)]
         [PosRefPosTyp   decimal(2,0)]
         [PosRefPosNr    decimal(9,0)]
                    ...
         [PosX           decimal(10,0)]
         [PosY           decimal(10,0)]
         [PosZ           decimal(10,0)]

     

     


    and two examples (not the original) for other tables:

    Slave-Table 1
    [dbo].[REC_HP]
    [PK1,FK1][Version        decimal(9,0)]
    [PK2,FK2][Typ            decimal(2,0)]
    [PK3,FK3][PosNr          decimal(9,0)]
             [HpNr           decimal(2,0)]
             [HpInfo        nvarchar(255)]

     

     

    Slave-Tabel 2
    [dbo].[REC_LINE]
    [PK1,FK1-2,1][Version        decimal(9,0)]
    [PK2]        [LineNr         decimal(9,0)]
                 [LineName      nvarchar(255)]
    [FK1,2]      [StartPosTyp    decimal(2,0)]
    [FK1,3]      [StartPosNr     decimal(9,0)]
    [FK2,2]      [EndPosTyp      decimal(2,0)]
    [FK2,3]      [EndPosNr       decimal(9,0)]

     

     


    Then i missing the associations:

    [REC_HP]   -(0/1:1)-> [REC_POS]
    [REC_LINE] -(0/1:n)-> [REC_POS]
    [REC_LINE] -(0/1:m)-> [REC_POS]

     

    Ciao:
    GG ;-)

    Wednesday, October 8, 2008 8:33 AM
  • Sorry for the delayed response...

     

    The EF does not support mapping scenarios where the FK is a subset of PK. It does support the case where FK is a subset of PK and also where FK is disjoint of PK. Support for the subset scenario in the next version is under consideration.

     

    -Brian

     

    Thursday, October 9, 2008 11:34 PM