What I need is add "pagination" in a List of a Class. Ej:
Class A List B
so I need limit the list of B to certain value
What I'm doing is (Using Criteria, and it's all dynamic):
ICriteria criteria = Session.createCriteria(); ICriteria criteriaParcial = criteria.CreateCriteria("B"); criteriaParcial.SetFirstResult(0).SetMaxResults(10); criteria.list();
This is an example, the realy code is all dynamic and iterative.
This mechanisme works find filtering values, but not for pagination.
Any Idea? Tanks
Updated!!!
This Approach doesn't work becouse this method execution criteria.CreateCriteria("B").setMAxResults(10)
Modifies to root criteria not subCriteria as I thought.
So my cuestion now is. It's possible to restrict or paginate, a list inside a class?
Something like this: I have a class Person with a list of address, so I want to load a Person, but only the two first objects inside the list of address.