Map Parent-Child Entity Relationship to Flat (Denormalized) Table? RRS feed

  • Question

  • Hi,

    In my conceptual model I have two associated entities in a parent-child (1:many) relationship.  In the database, however, this data is stored in a single table, with all "parent" data repeated in each row.  So:


    Entity: Email

    Email ID
    Email Subject

    Entity:Email Attachment

    Attachment ID
    Attachment Type

    Entity:Email in 1:many association with Entity:Email_Attachment

    In the store:

    Table:  EmailAttachments

    Email ID
    Email Subject
    Attachment ID
    Attachment Type

    How do a map the parent-child conceptual entities onto a single table?  I have searched the documentation looking for this kind of mapping, but cannot find any examples.  Perhaps I've missed something obvious.  How might I create this kind of map?

    Thank you.

    Thursday, March 19, 2009 12:48 AM


  • Hi *,

    I think the best way will be to go to views and create two views from this one table. And then map these. Or you can tweak the model to do this only in SSDL part, with DefiningQuery.

    Jiri {x2} Cincura
    Saturday, March 21, 2009 6:25 PM