Annotation Interface Query
Annotation to declare finder queries directly on repository query methods.
 
 When using a native query, a @NativeQuery variant is available.
- Author:
- Oliver Gierke, Thomas Darimont, Christoph Strobl, Greg Turnquist, Danny van den Elshout
- See Also:
- 
Optional Element SummaryOptional ElementsModifier and TypeOptional ElementDescriptionReturns the name of theNamedQueryto 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 look up the total number of elements for a page.The named query to be used.booleanConfigures whether the given query is a native one.Class<? extends QueryRewriter>Define aQueryRewriterthat should be applied to the query string after the query is fully assembled.Defines the JPA query to be executed when the annotated method is called.
- 
Element Details- 
valueString valueDefines the JPA query to be executed when the annotated method is called.- Default:
- ""
 
- 
countQueryString countQueryDefines a special count query that shall be used for pagination queries to look up 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:
- ""
 
- 
countProjectionString 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:
- ""
 
- 
nativeQueryboolean nativeQueryConfigures whether the given query is a native one. Defaults to false.- Default:
- false
 
- 
nameString nameThe named query to be used. If not defined, aNamedQuerywith name of${domainClass}.${queryMethodName}will be used.- Default:
- ""
 
- 
countNameString countNameReturns the name of theNamedQueryto 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:
- ""
 
- 
queryRewriterClass<? extends QueryRewriter> queryRewriterDefine aQueryRewriterthat should be applied to the query string after the query is fully assembled.- Returns:
- Since:
- 3.0
 - Default:
- org.springframework.data.jpa.repository.QueryRewriter.IdentityQueryRewriter.class
 
 
-