Specifies a static limit on the number of results retrieved by a repository method. The results of a single invocation of a repository method may be limited to a given maximum number of results. For example,
@Find @First
@OrderBy(value = _Employee.SALARY, descending = true)
Employee highestPaid(String jobTitle);
@First(10)
@Query("order by playCount desc")
List<Song> topTen();
A repository method may not be declared with:
- a
@Firstannotation and a parameter of typePageRequestorLimit, or - a
@Firstannotation in combination with theFirstkeyword.
- Since:
- 1.1
- See Also:
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionintThe limit on the number of results returned by the repository method.
-
Element Details
-
value
int valueThe limit on the number of results returned by the repository method. Must be strictly positive.- Default:
1
-