Class JpaQueryMethod
java.lang.Object
org.springframework.data.repository.query.QueryMethod
org.springframework.data.jpa.repository.query.JpaQueryMethod
public class JpaQueryMethod
extends org.springframework.data.repository.query.QueryMethod
JPA specific extension of
QueryMethod
.- Author:
- Oliver Gierke, Thomas Darimont, Christoph Strobl, Nicolas Cirigliano, Mark Paluch, Сергей Цыпанов, Réda Housni Alaoui, Greg Turnquist
-
Constructor Summary
ModifierConstructorDescriptionprotected
JpaQueryMethod
(Method method, org.springframework.data.repository.core.RepositoryMetadata metadata, org.springframework.data.projection.ProjectionFactory factory, QueryExtractor extractor) Creates aJpaQueryMethod
. -
Method Summary
Modifier and TypeMethodDescriptionprotected JpaParameters
createParameters
(Method method) Returns the query string declared in aQuery
annotation or null if neither the annotation found nor the attribute was specified.Returns the countQuery string declared in aQuery
annotation or null if neither the annotation found nor the attribute was specified.Returns theMeta
attributes to be applied.Class<? extends QueryRewriter>
Returns theQueryRewriter
type.Returns the required query string declared in aQuery
annotation or throwsIllegalStateException
if neither the annotation found nor the attribute was specified.boolean
boolean
boolean
Returns whether the finder is a modifying one.boolean
Return true if the method contains aProcedure
annotation.Methods inherited from class org.springframework.data.repository.query.QueryMethod
createParameters, getDomainClass, getName, getResultProcessor, getReturnedObjectType, isPageQuery, isQueryForEntity, isScrollQuery, isSliceQuery, isStreamQuery, toString
-
Constructor Details
-
JpaQueryMethod
protected JpaQueryMethod(Method method, org.springframework.data.repository.core.RepositoryMetadata metadata, org.springframework.data.projection.ProjectionFactory factory, QueryExtractor extractor) Creates aJpaQueryMethod
.- Parameters:
method
- must not be nullmetadata
- must not be nullfactory
- must not be nullextractor
- must not be null
-
-
Method Details
-
getEntityInformation
- Overrides:
getEntityInformation
in classorg.springframework.data.repository.query.QueryMethod
-
isModifyingQuery
public boolean isModifyingQuery()Returns whether the finder is a modifying one.- Overrides:
isModifyingQuery
in classorg.springframework.data.repository.query.QueryMethod
- Returns:
-
hasQueryMetaAttributes
public boolean hasQueryMetaAttributes()- Returns:
- return true if
Meta
annotation is available. - Since:
- 3.0
-
getQueryMetaAttributes
Returns theMeta
attributes to be applied.- Returns:
- never null.
- Since:
- 1.6
-
getAnnotatedQuery
Returns the query string declared in aQuery
annotation or null if neither the annotation found nor the attribute was specified.- Returns:
-
getRequiredAnnotatedQuery
Returns the required query string declared in aQuery
annotation or throwsIllegalStateException
if neither the annotation found nor the attribute was specified.- Returns:
- Throws:
IllegalStateException
- if noQuery
annotation is present or the query is empty.- Since:
- 2.0
-
getCountQuery
Returns the countQuery string declared in aQuery
annotation or null if neither the annotation found nor the attribute was specified.- Returns:
-
getNamedQueryName
- Overrides:
getNamedQueryName
in classorg.springframework.data.repository.query.QueryMethod
-
createParameters
- Overrides:
createParameters
in classorg.springframework.data.repository.query.QueryMethod
-
getParameters
- Overrides:
getParameters
in classorg.springframework.data.repository.query.QueryMethod
-
isCollectionQuery
public boolean isCollectionQuery()- Overrides:
isCollectionQuery
in classorg.springframework.data.repository.query.QueryMethod
-
isProcedureQuery
public boolean isProcedureQuery()Return true if the method contains aProcedure
annotation.- Returns:
-
getQueryRewriter
Returns theQueryRewriter
type.- Returns:
- type of the
QueryRewriter
- Since:
- 3.0
-