You can try like this to get 10 results that will be selected explicitly.
entityManager.createQuery(JPQL_QUERY) .setParameter(arg0, arg1) .setMaxResults(10) .getResultList();
It will automatically create its own query in the background to get a certain amount of results if the backend supports it, and otherwise will make a memory limit after receiving all the results.
Nayan Wadekar Aug 16 2018-10-16 16:43
source share