Annotation Interface Query
Annotation to declare finder queries directly on repository methods.
- Author:
- Oliver Gierke, Thomas Darimont, Christoph Strobl
- See Also:
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionReturns the name of theNamedQuery
to be used to execute count queries when pagination is used.Defines the projection part of the count query that is generated for pagination.Defines a special count query that shall be used for pagination queries to lookup the total number of elements for a page.The named query to be used.boolean
Configures whether the given query is a native one.Defines the JPA query to be executed when the annotated method is called.
-
Element Details
-
value
String valueDefines the JPA query to be executed when the annotated method is called.- Default:
- ""
-
countQuery
String countQueryDefines a special count query that shall be used for pagination queries to lookup the total number of elements for a page. If none is configured we will derive the count query from the original query orcountProjection()
query if any.- Default:
- ""
-
countProjection
String countProjectionDefines the projection part of the count query that is generated for pagination. If neithercountQuery()
norcountProjection()
is configured we will derive the count query from the original query.- Returns:
- Since:
- 1.6
- Default:
- ""
-
nativeQuery
boolean nativeQueryConfigures whether the given query is a native one. Defaults to false.- Default:
- false
-
name
String nameThe named query to be used. If not defined, aNamedQuery
with name of$ domainClass
.${queryMethodName}} will be used.- Default:
- ""
-
countName
String countNameReturns the name of theNamedQuery
to be used to execute count queries when pagination is used. Will default to the named query name configured suffixed by.count
.- Returns:
- See Also:
- Default:
- ""
-