NHibernate returning duplicate object in child collections when using Fetch

后端 未结 5 2027
轮回少年
轮回少年 2021-02-19 01:35

When doing a query like this (using Nhibernate 2.1.2):

 ICriteria criteria = session.CreateCriteria()
                .SetFetchMode(\"ChildColl         


        
5条回答
  •  没有蜡笔的小新
    2021-02-19 02:26

    What were you mapping your collection as? If your using a bag for example you will get duplicates. You can use a set instead and you won't get duplicates.

提交回复
热议问题