I've got a many-to-many relationship which I try to fetch eager:
*.CreateCriteria(typeof(Class1))
.SetFetchMode("Class2", FetchMode.Eager)
.SetResultTransformer(new DistinctRootEntityResultTransformer())
.SetFirstResult(20)
.SetMaxResult(10)
.List<Class1>();
I'd like to have rows 20-30 returned, but instead I've got 12-18. Why? Because the SetResultTransformer is executed AFTER the SetMaxResult. It returns 10 rows starting from row 20, but then it is distincted (is that a word?) resulting in rows 12-18. I totally understand what's happening, but can't think of a solution using criteria...
Does anyone have a solution to that?