additional fields in NHibernate many-to-many relation tables

前端 未结 3 1134
轮回少年
轮回少年 2020-12-04 02:48

when i have a many-to.many relation with nhibernate and let nhibernate generate my db schema, it adds an aditional table that contains the primary keys of the related entiti

3条回答
  •  失恋的感觉
    2020-12-04 03:12

    In this case, how would you build the in the mapping file for the new entity (that acts as the bridge between the two initial tables) ? In my case this link table has two foreign keys (int), one for each initial table, plus some other fields (startDate, endDate)

    The thing is, in my new entity, I do not have properties for these two foreign keys. I only have one property that is of the type of the entity the foreign key is pointing to.

提交回复
热议问题