NHibernate returning duplicate object in child collections when using Fetch

后端 未结 5 1860
轮回少年
轮回少年 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:42

    You can select single distinct results by specifying SetResultsTransformer(Transformers.DistinctRootEntity);

提交回复
热议问题