IsJoinTable with an extra column

3 posts, 0 answers
  1. Erik
    Erik avatar
    9 posts
    Member since:
    Jul 2012

    Posted 25 Sep 2012 Link to this post

    Hi all,

    I've got a join table consisting of 2 ID's. OpenAccess marks this table as a join table. Therefor it's not created as a separate class.
    This works perfectly.

    Now I'd like to add an extra column to this table. When I update the model the IsJoinTable mark is obviously removed.
    My question is, can I somehow combine the extra field and still maintain the join table functionality?

    Regards,

    Erik
  2. Viktor Zhivkov
    Admin
    Viktor Zhivkov avatar
    291 posts

    Posted 27 Sep 2012 Link to this post

    Hi Erik,

    If you add any additional column to a many-to-many join table it is automatically promoted to entity and a new class is generated and mapped to it. This is necessary in order to give you access to the additional attributes in the table.
    Unfortunately this means that you have to do one additional hop when traversing the graph as opposed to the normal many-to-many mapping.
    Getting back to you question - no there is no way to combine the join table and the new entity.

    If you need assistance implementing navigation between graph of entities connected that way do not hesitate to contact us.

    Greetings,
    Viktor Zhivkov
    the Telerik team
    Follow @OpenAccessORM Twitter channel to be the first one to get the latest updates on new releases, tips and tricks and sneak peeks at our product labs!
  3. DevCraft banner
  4. Erik
    Erik avatar
    9 posts
    Member since:
    Jul 2012

    Posted 05 Oct 2012 Link to this post

    Makes sense.
    It's against the definition of join tables in the first place.
Back to Top