It looks like nbernate is trying to populate the whole child collection by always doing an outer join on eagerly loaded collections, which results in a nonidentical set of rows with identical left part Id | CollectionId ------------------- 1 | 1 1 | 2 2 | 3 3 | 4 3 | 5 You get the idea. LIMIT on such a row set would have no meaning, as you practically would restrict nbernate's internal data, instead of restricting the result set you are really interested in. I am, however, yet to find a way to do paging with eagerly loading.
I think it might be impossible to do with just one query.
It looks like nbernate is trying to populate the whole child collection by always doing an outer join on eagerly loaded collections, which results in a nonidentical set of rows with identical left part. Id | CollectionId ------------------- 1 | 1 1 | 2 2 | 3 3 | 4 3 | 5 You get the idea. LIMIT on such a row set would have no meaning, as you practically would restrict nbernate's internal data, instead of restricting the result set you are really interested in.
I am, however, yet to find a way to do paging with eagerly loading. I think it might be impossible to do with just one query.
In nHibernate, if you do an HQL query with "join fetch" to eagerly load a child collection, nHibernate will ignore SetMaxResults and SetFirstResult and try to retrieve every single item from the database. This behavior is specific to HQL, as ICriteria supports eager loading (with an outer join, though) and LIMIT. There are more details here http://www.lesnikowski.com/blog/index.php/nhibernate-ignores-setmaxresults-in-sql/.
Further on the topic and regarding other issues with "join fetch" (such as getting a Cartesian product as a result): as pointed out here and here, it is possible to eagerly load child collections with both HQL and ICriteria. However, ICriteria doesn't allow inner joins (resulting in a Cartesian product), and HQL doesn't allow paging the results on the DB side. And what to do if a have to do the same thing but paged?
SetMaxResults, but that might cause issues with the loading. At that point, I might want to execute two totally separate queries, first to get just the entities, then to load the related associations. So what is the issue with paging here and what would be the possible solution?
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.