About setMaxResults

1-10 of 28Refresh
JPA Doc
95

setMaxResults(maxResult)

Method javax.persistence.Query Query setMaxResults(   int maxResult ) Set the maximum number of results to retrieve. Parameters: maxResult - maximum number of results to retrieve Returns: the same query instance Throws: IllegalArgumentException - if the argument is negative Since: JPA 1.0
JPA Doc
95

setMaxResults(maxResult)

Method javax.persistence.TypedQuery TypedQuery setMaxResults(   int maxResult ) Set the maximum number of results to retrieve. Parameters: maxResult - maximum number of results to retrieve Returns: the same query instance Throws: IllegalArgumentException - if the argument is negative Since: JPA 2.0
Manual
42

Setting and Tuning of JPA Queries

(setFirstResult, setMaxResults) The setFirstResult and setMaxResults methods enable defining a result ... at the beginning of the complete result list should be skipped and ignored. The setMaxResults method ... > results = query.setFirstResult(pageIx * pageSize) .setMaxResults(pageSize
JPA Doc
10

javax.persistence.TypedQuery

to retrieve. Returns Integer.MAX_VALUE if setMaxResults was not applied to the query object. Returns ... query Since: JPA 2.0 Query setMaxResults(int maxResult) Set the maximum number of results to retrieve ... is negative Since: JPA 1.0 TypedQuery setMaxResults(int maxResult) Set the maximum number of results
JPA Doc
8

javax.persistence.Query

Integer.MAX_VALUE if setMaxResults was not applied to the query object. Returns: maximum number ... Persistence query language SELECT query or a Criteria API query Since: JPA 2.0 Query setMaxResults(int
JPA Doc
6

getMaxResults()

Method javax.persistence.Query int getMaxResults() The maximum number of results the query object was set to retrieve. Returns Integer.MAX_VALUE if setMaxResults was not applied to the query object. Returns: maximum number of results Since: JPA 2.0
Forum
3

JPA and handling large data sets

by step during the export with the  query/setFirstResult() & setMaxResults(). But for large data ... to traverse all objects of an entity? Peter     Using query result range (setFirstResult, setMaxResults ... the next set of objects. Usually the problem is only with setFirstResult and using setMaxResults
Forum
3

Listing large number of complicated objects with paging.

.setFirstResult(start).setMaxResults(count).getResultList(); is quite slow. Well, after first request ... every query execution (setMaxResults). Does that number affect? You may try running the query ... .setFirstResult(20).setMaxResults(10).getResultList();         System.out.println("Results
Forum
2

Caching/Paging Questions...

via setFirstResult and setMaxResult speed up the query execution since there are fewer result objects to bring into ... and setMaxResults could improve performance, but the effect is highly dependent on the specific query. geekox86
Issue
2

NPE at com.objectdb.jpa.JpaQuery.getResultList

); if (!all) { q.setMaxResults(maxResults); q.setFirstResult(firstResult ... );             if (!all) {                 q.setMaxResults(maxResults);                 q.setFirstResult(firstResult