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
ConstructorsModifierConstructorDescriptionprotectedJpaQueryMethod(Method method, org.springframework.data.repository.core.RepositoryMetadata metadata, org.springframework.data.projection.ProjectionFactory factory, QueryExtractor extractor) Creates aJpaQueryMethod. -
Method Summary
Modifier and TypeMethodDescriptionprotected JpaParameterscreateParameters(Method method) Returns the query string declared in aQueryannotation or null if neither the annotation found nor the attribute was specified.Returns the countQuery string declared in aQueryannotation or null if neither the annotation found nor the attribute was specified.Returns theMetaattributes to be applied.Class<? extends QueryRewriter>Returns theQueryRewritertype.Returns the required query string declared in aQueryannotation or throwsIllegalStateExceptionif neither the annotation found nor the attribute was specified.booleanbooleanbooleanReturns whether the finder is a modifying one.booleanReturn true if the method contains aProcedureannotation.Methods inherited from class org.springframework.data.repository.query.QueryMethod
createParameters, getDomainClass, getName, getResultProcessor, getReturnedObjectType, isPageQuery, isQueryForEntity, 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:
getEntityInformationin classorg.springframework.data.repository.query.QueryMethod
-
isModifyingQuery
public boolean isModifyingQuery()Returns whether the finder is a modifying one.- Overrides:
isModifyingQueryin classorg.springframework.data.repository.query.QueryMethod- Returns:
-
hasQueryMetaAttributes
public boolean hasQueryMetaAttributes()- Returns:
- return true if
Metaannotation is available. - Since:
- 3.0
-
getQueryMetaAttributes
Returns theMetaattributes to be applied.- Returns:
- never null.
- Since:
- 1.6
-
getAnnotatedQuery
Returns the query string declared in aQueryannotation or null if neither the annotation found nor the attribute was specified.- Returns:
-
getRequiredAnnotatedQuery
Returns the required query string declared in aQueryannotation or throwsIllegalStateExceptionif neither the annotation found nor the attribute was specified.- Returns:
- Throws:
IllegalStateException- if noQueryannotation is present or the query is empty.- Since:
- 2.0
-
getCountQuery
Returns the countQuery string declared in aQueryannotation or null if neither the annotation found nor the attribute was specified.- Returns:
-
getNamedQueryName
- Overrides:
getNamedQueryNamein classorg.springframework.data.repository.query.QueryMethod
-
createParameters
- Overrides:
createParametersin classorg.springframework.data.repository.query.QueryMethod
-
getParameters
- Overrides:
getParametersin classorg.springframework.data.repository.query.QueryMethod
-
isCollectionQuery
public boolean isCollectionQuery()- Overrides:
isCollectionQueryin classorg.springframework.data.repository.query.QueryMethod
-
isProcedureQuery
public boolean isProcedureQuery()Return true if the method contains aProcedureannotation.- Returns:
-
getQueryRewriter
Returns theQueryRewritertype.- Returns:
- type of the
QueryRewriter - Since:
- 3.0
-