Class JpaQueryMethod
java.lang.Object
org.springframework.data.repository.query.QueryMethod
org.springframework.data.jpa.repository.query.JpaQueryMethod
JPA specific extension of
QueryMethod
.- Author:
- Oliver Gierke, Thomas Darimont, Christoph Strobl, Nicolas Cirigliano, Mark Paluch, Сергей Цыпанов, Réda Housni Alaoui, Greg Turnquist, Aleksei Elin
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
JpaQueryMethod
(Method method, RepositoryMetadata metadata, ProjectionFactory factory, QueryExtractor extractor) Creates aJpaQueryMethod
. -
Method Summary
Modifier and TypeMethodDescriptionprotected Parameters<?,
?> createParameters
(ParametersSource parametersSource) 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, RepositoryMetadata metadata, 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 classQueryMethod
-
isModifyingQuery
public boolean isModifyingQuery()Returns whether the finder is a modifying one.- Overrides:
isModifyingQuery
in classQueryMethod
- 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 classQueryMethod
-
createParameters
- Overrides:
createParameters
in classQueryMethod
-
getParameters
- Overrides:
getParameters
in classQueryMethod
-
isCollectionQuery
public boolean isCollectionQuery()- Overrides:
isCollectionQuery
in classQueryMethod
-
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
-