# Fetch grand chidrens have duplicate rows

**URL:** <https://discourse.hibernate.org/t/fetch-grand-chidrens-have-duplicate-rows/1957>\
**Category:** Hibernate ORM\
**Created:** [January 3, 2019, 11:37am UTC](https://discourse.hibernate.org/t/fetch-grand-chidrens-have-duplicate-rows/1957 "2019-01-03T11:37:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kavitha](https://avatars.discourse-cdn.com/v4/letter/k/edb3f5/32.png) [@Kavitha](https://discourse.hibernate.org/u/Kavitha)\
**Post date:** [January 3, 2019, 11:37am UTC](https://discourse.hibernate.org/t/fetch-grand-chidrens-have-duplicate-rows/1957/1 "2019-01-03T11:37:16Z")

</div>

Hello,

I am using the following code to fetch chidren & grandchildren collections of parent.  
IList parentList = (from mod in Session.Query()  
select mod).FetchMany(o =\> o.Children).ThenFetchMany(o =\> o.GrandChildren).ToList();

I have set Children & GrandChildren as Bag.  
But the Children collection have duplicate data. The Children collection is duplicated as many number of grandchildren.

If I have 1 children and 3 grandchildren. The result of the above code is having 3 children, each children having 3 grandchildren.

Is there any solution to avoid the duplicate children in NHiberate.Linq? How can I get correct children & grandChildren collections?  
Thanking you

---

<div class="post-metadata">

**Author:** ![vlad](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/vlad/32/658_2.png) [@vlad](https://discourse.hibernate.org/u/vlad)\
**Post date:** [January 3, 2019, 8:59pm UTC](https://discourse.hibernate.org/t/fetch-grand-chidrens-have-duplicate-rows/1957/2 "2019-01-03T20:59:24Z")

</div>

> [@NHibernate One-to-many between View and Table](https://discourse.hibernate.org/t/nhibernate-one-to-many-between-view-and-table/198/4):
>
> This forum is just for Hibernate projects you will find on hibernate.org. NHibernate is a separate project, and we don’t maintain it. Here’s a post from the old forum which tells you how to reach the [NHibernate forums](https://forum.hibernate.org/viewtopic.php?f=25&t=994308).
