Loading multi-level child entities eagerly in NHibernate cause duplication problem?

I would split the query into two parts: item = session.CreateCriteria() . Add(NCriterion.Expression. Where(o => o.

ModelId == id)) . SetFetchMode("ModelFeatures", NFetchMode. Eager) .UniqueResult(); session.CreateCriteria() .

Add(NCriterion.Expression. Where(o => o. ModelId == id)) .

SetFetchMode("ModelImages", NFetchMode. Eager) . SetFetchMode("ModelImages.

Image", NFetchMode. Eager) .UniqueResult(); The second query just continues to populate the collections of the "item" object returned from the first query, so there is no need to use the return value from the second query. If you want those two queries to be executed in a single round trip you can use Future() instead of UniqueResult() and then use item.

Value to actually execute the queries.

Anyway I also remembered that to avoid duplicate entities we could use a Set instead of using a Bag in our mapping. So I changed : to.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions