Class CouchbaseQueryMethod
java.lang.Object
org.springframework.data.repository.query.QueryMethod
org.springframework.data.couchbase.repository.query.CouchbaseQueryMethod
- Direct Known Subclasses:
ReactiveCouchbaseQueryMethod
Represents a query method with couchbase extensions, allowing to discover if View-based query or N1QL-based query
must be used.
- Author:
- Michael Nitschinger, Simon Baslé, Oliver Gierke, Michael Reiche
-
Constructor Summary
ConstructorDescriptionCouchbaseQueryMethod
(Method method, RepositoryMetadata metadata, ProjectionFactory factory, MappingContext<? extends CouchbasePersistentEntity<?>, CouchbasePersistentProperty> mappingContext) -
Method Summary
Modifier and TypeMethodDescription<A extends Annotation>
AgetAnnotation
(Class<A> annotationClass) Caution: findMergedAnnotation() will return the default if there are any annotations but not this annotationReturns the query string declared in aQuery
annotation or null if neither the annotation found nor the attribute was specified.Returns the @Query annotation if set, null otherwise.ScanConsistency annotationgetScope()
boolean
boolean
If the method has a @Query annotation with an inline Query statement inside.boolean
If the method has a @Query annotation.boolean
boolean
If the method has a @ScanConsistency annotationboolean
indicates if the method begins with "count"boolean
is this a 'delete'?boolean
is this an 'exists' query?toString()
Methods inherited from class org.springframework.data.repository.query.QueryMethod
createParameters, createParameters, getDomainClass, getEntityInformation, getName, getNamedQueryName, getParameters, getResultProcessor, getReturnedObjectType, isCollectionQuery, isModifyingQuery, isPageQuery, isQueryForEntity, isScrollQuery, isSliceQuery, isStreamQuery
-
Constructor Details
-
CouchbaseQueryMethod
public CouchbaseQueryMethod(Method method, RepositoryMetadata metadata, ProjectionFactory factory, MappingContext<? extends CouchbasePersistentEntity<?>, CouchbasePersistentProperty> mappingContext)
-
-
Method Details
-
hasN1qlAnnotation
public boolean hasN1qlAnnotation()If the method has a @Query annotation.- Returns:
- true if it has the annotation, false otherwise.
-
getN1qlAnnotation
Returns the @Query annotation if set, null otherwise.- Returns:
- the n1ql annotation if present.
-
hasInlineN1qlQuery
public boolean hasInlineN1qlQuery()If the method has a @Query annotation with an inline Query statement inside.- Returns:
- true if this has the annotation and N1QL inline statement, false otherwise.
-
hasConsistencyAnnotation
public boolean hasConsistencyAnnotation() -
getConsistencyAnnotation
-
hasScanConsistencyAnnotation
public boolean hasScanConsistencyAnnotation()If the method has a @ScanConsistency annotation- Returns:
- true if this has the @ScanConsistency annotation
-
getScanConsistencyAnnotation
ScanConsistency annotation- Returns:
- the @ScanConsistency annotation
-
getAnnotation
Caution: findMergedAnnotation() will return the default if there are any annotations but not this annotation- Returns:
- annotation
-
getInlineN1qlQuery
Returns the query string declared in aQuery
annotation or null if neither the annotation found nor the attribute was specified.- Returns:
- the query statement if present.
-
isDeleteQuery
public boolean isDeleteQuery()is this a 'delete'?- Returns:
- is this a 'delete'?
-
isExistsQuery
public boolean isExistsQuery()is this an 'exists' query?- Returns:
- is this an 'exists' query?
-
isCountQuery
public boolean isCountQuery()indicates if the method begins with "count"- Returns:
- true if the method begins with "count", indicating that .count() should be called instead of one() or all().
-
toString
- Overrides:
toString
in classQueryMethod
-
hasReactiveWrapperParameter
public boolean hasReactiveWrapperParameter() -
getCollection
-
getScope
-