The javax.persistence.Query.setMaxResults(int) method's javadoc says
Set the maximum number of results to retrieve.
Parameters: maxResult - maximum number of results to retrieve
Throws: IllegalArgumentException - if the argument is negative
there seems nothing in the javadoc suggesting 0 is a special value, equivalent to "no limits". Yet, Hibernate (in org.hibernate.internal.AbstractQueryImpl.setMaxResults(int)) seems to disregard 0 value.
|