nhibernate: using parts of the compositeId in a ManyToOne Property

后端 未结 2 1481
时光取名叫无心
时光取名叫无心 2020-12-12 07:10

I have a tablestructure like this:

Table entity
(
    otherEntity_id  int  // primarykey
    id              int  // primarykey

    parent_id       int
)
         


        
2条回答
  •  醉梦人生
    2020-12-12 07:49

    If you are referencing the same column above twice (otherEntity_id) I've seen mappings like this to avoid this sort of error:

    References(e => e.Parent).Columns("otherEntity_id", "parent_id")
        .Not.Update()
        .Not.Insert();
    

    Also when you are running into a problem it is always helpful to show the full error message you are running into.

提交回复
热议问题