nhibernate: using parts of the compositeId in a ManyToOne Property

后端 未结 2 1490
时光取名叫无心
时光取名叫无心 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:37

    I still haven't found a solution and mapped changed my model to:

    public class Entity
    {
        public OtherEntity Other { get; set; }
        // simple int to discriminate different Entity for the same OtherEntity
        public int Id { get; set; }
    
        public int ParentId { get; set; }
    }
    

提交回复
热议问题