Annotation Interface Query
-
Required Element Summary
-
Optional Element Summary
-
Element Details
-
value
String valueDefines the query to be executed when the annotated method is called.
If an application defines a repository method with
@Query
and supplies other forms of sorting (such asSort
) to that method, then it is the responsibility of the application to compose the query in such a way that anORDER BY
clause (or query language equivalent) can be validly appended. The Jakarta Data provider is not expected to parse query language that is provided by the application.- Returns:
- the query to be executed when the annotated method is called.
-
count
String countDefines an additional query that counts the number of elements that are returned by the
primary
query. This is used to compute thetotal elements
andtotal pages
for paginated repository queries that are annotated with@Query
and return aPage
orKeysetAwarePage
. Slices do not use a counting query.The default value of empty string indicates that no counting query is provided. A counting query is unnecessary when pagination is performed with slices instead of pages and when pagination is not used at all.
- Returns:
- a query for counting the number of elements across all pages. Empty string indicates that no counting query is provided.
- Default:
""
-