Class ElasticsearchQueryMethod
java.lang.Object
org.springframework.data.repository.query.QueryMethod
org.springframework.data.elasticsearch.repository.query.ElasticsearchQueryMethod
- Direct Known Subclasses:
ReactiveElasticsearchQueryMethod
ElasticsearchQueryMethod
- Author:
- Rizwan Idrees, Mohsin Husen, Oliver Gierke, Mark Paluch, Christoph Strobl, Peter-Josef Meisch, Alexander Torres
-
Field Summary
-
Constructor Summary
ConstructorDescriptionElasticsearchQueryMethod
(Method method, RepositoryMetadata repositoryMetadata, ProjectionFactory factory, MappingContext<? extends ElasticsearchPersistentEntity<?>, ElasticsearchPersistentProperty> mappingContext) -
Method Summary
Modifier and TypeMethodDescriptionprotected MappingContext<? extends ElasticsearchPersistentEntity<?>,
ElasticsearchPersistentProperty> boolean
boolean
boolean
protected boolean
isAllowedGenericType
(ParameterizedType methodGenericReturnType) boolean
checks whether the return type of the underlying method nether aSearchHits
nor a collection ofSearchHit
.boolean
checks if the return type is notSearchPage
.boolean
checks whether the return type of the underlying method is aSearchHits
or a collection ofSearchHit
.boolean
checks if the return type isSearchPage
.Class<?>
returns the declared return type for this method.protected void
Methods inherited from class org.springframework.data.repository.query.QueryMethod
createParameters, createParameters, getDomainClass, getName, getNamedQueryName, getParameters, getResultProcessor, getReturnedObjectType, isCollectionQuery, isModifyingQuery, isPageQuery, isQueryForEntity, isScrollQuery, isSliceQuery, isStreamQuery, toString
-
Field Details
-
method
-
-
Constructor Details
-
ElasticsearchQueryMethod
public ElasticsearchQueryMethod(Method method, RepositoryMetadata repositoryMetadata, ProjectionFactory factory, MappingContext<? extends ElasticsearchPersistentEntity<?>, ElasticsearchPersistentProperty> mappingContext)
-
-
Method Details
-
verifyCountQueryTypes
protected void verifyCountQueryTypes() -
hasAnnotatedQuery
public boolean hasAnnotatedQuery() -
getAnnotatedQuery
- Returns:
- the query String. Must not be null when
hasAnnotatedQuery()
returns true
-
hasAnnotatedHighlight
public boolean hasAnnotatedHighlight()- Returns:
- true if there is a
Highlight
annotation present. - Since:
- 4.0
-
getAnnotatedHighlightQuery
- Returns:
- a
HighlightQuery
built from theHighlight
annotation. - Throws:
IllegalArgumentException
- if noHighlight
annotation is present on the method- See Also:
-
getEntityInformation
- Overrides:
getEntityInformation
in classQueryMethod
- Returns:
- the
ElasticsearchEntityMetadata
for the query methodsreturn type
. - Since:
- 3.2
-
getMappingContext
protected MappingContext<? extends ElasticsearchPersistentEntity<?>,ElasticsearchPersistentProperty> getMappingContext() -
isSearchHitMethod
public boolean isSearchHitMethod()checks whether the return type of the underlying method is aSearchHits
or a collection ofSearchHit
.- Returns:
- true if the method has a
SearchHit
related return type - Since:
- 4.0
-
isSearchPageMethod
public boolean isSearchPageMethod()checks if the return type isSearchPage
.- Since:
- 4.0
-
methodReturnType
returns the declared return type for this method.- Returns:
- the return type
- Since:
- 4.0
-
isAllowedGenericType
-
isNotSearchHitMethod
public boolean isNotSearchHitMethod()checks whether the return type of the underlying method nether aSearchHits
nor a collection ofSearchHit
.- Returns:
- true if the method has not a
SearchHit
t related return type - Since:
- 4.0
-
isNotSearchPageMethod
public boolean isNotSearchPageMethod()checks if the return type is notSearchPage
.- Since:
- 4.2
-
hasCountQueryAnnotation
public boolean hasCountQueryAnnotation()- Returns:
- true if the method is annotated with
CountQuery
or withQuery
(count =true) - Since:
- 4.2
-