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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionElasticsearchQueryMethod(Method method, RepositoryMetadata repositoryMetadata, ProjectionFactory factory, MappingContext<? extends ElasticsearchPersistentEntity<?>, ElasticsearchPersistentProperty> mappingContext) -
Method Summary
Modifier and TypeMethodDescriptionprotected MappingContext<? extends ElasticsearchPersistentEntity<?>,ElasticsearchPersistentProperty> booleanbooleanbooleanprotected booleanisAllowedGenericType(ParameterizedType methodGenericReturnType) booleanchecks whether the return type of the underlying method nether aSearchHitsnor a collection ofSearchHit.booleanchecks if the return type is notSearchPage.booleanchecks whether the return type of the underlying method is aSearchHitsor a collection ofSearchHit.booleanchecks if the return type isSearchPage.Class<?>returns the declared return type for this method.protected voidMethods 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
Highlightannotation present. - Since:
- 4.0
-
getAnnotatedHighlightQuery
- Returns:
- a
HighlightQuerybuilt from theHighlightannotation. - Throws:
IllegalArgumentException- if noHighlightannotation is present on the method- See Also:
-
getEntityInformation
- Overrides:
getEntityInformationin classQueryMethod- Returns:
- the
ElasticsearchEntityMetadatafor 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 aSearchHitsor a collection ofSearchHit.- Returns:
- true if the method has a
SearchHitrelated 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 aSearchHitsnor a collection ofSearchHit.- Returns:
- true if the method has not a
SearchHitt 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
CountQueryor withQuery(count =true) - Since:
- 4.2
-