error de espacio de almacenamiento dinámico al ejecutar una consulta que devuelve una gran cantidad de datos

I have a query which returns a lot of data is there a way how can I avoid heap space error

How can I add paging on it or some other sort of mechanism for the same.

preguntado el 28 de mayo de 14 a las 12:05

1 Respuestas

You can do it by this way (assuming you want to create criteria for the class Cat:

Session sessione = sf.getCurrentSession();
Criteria crit = sessione.createCriteria(Cat.class);
crit.setFirstResult(currentPage);
crit.setMaxResults(maxNumber);
return crit.list();

ángel

contestado el 28 de mayo de 14 a las 12:05

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.