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 annotation<A extends Annotation>
AgetClassAnnotation
(Class<A> annotationClass) Caution: findMergedAnnotation() will return the default if there are any annotations but not this annotation<A extends Annotation>
AgetEntityAnnotation
(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.<A extends Annotation>
AgetRepositoryAnnotation
(Class<A> annotationClass) Caution: findMergedAnnotation() will return the default if there are any annotations but not this annotationScanConsistency annotationgetScope()
Returns the @View annotation if set, null otherwise.boolean
boolean
If the method has a @View annotation with the designDocument specified.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
If the method has a @View annotation.boolean
If the method has a @View annotation with the viewName specified.boolean
If the method has a @View annotation with the designDocument and viewName specified.boolean
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, getDomainClass, getEntityInformation, getName, getNamedQueryName, getParameters, getResultProcessor, getReturnedObjectType, isCollectionQuery, isModifyingQuery, isPageQuery, isQueryForEntity, isSliceQuery, isStreamQuery
-
Constructor Details
-
CouchbaseQueryMethod
public CouchbaseQueryMethod(Method method, RepositoryMetadata metadata, ProjectionFactory factory, MappingContext<? extends CouchbasePersistentEntity<?>, CouchbasePersistentProperty> mappingContext)
-
-
Method Details
-
hasViewAnnotation
public boolean hasViewAnnotation()If the method has a @View annotation.- Returns:
- true if it has the annotation, false otherwise.
-
hasViewSpecification
public boolean hasViewSpecification()If the method has a @View annotation with the designDocument and viewName specified.- Returns:
- true if it has the annotation and full view specified.
-
hasDesignDoc
public boolean hasDesignDoc()If the method has a @View annotation with the designDocument specified.- Returns:
- true if it has the design document specified.
-
hasViewName
public boolean hasViewName()If the method has a @View annotation with the viewName specified.- Returns:
- true if it has the view name specified.
-
getViewAnnotation
Returns the @View annotation if set, null otherwise.- Returns:
- the view annotation of present.
-
hasDimensionalAnnotation
public boolean hasDimensionalAnnotation()- Returns:
- true if the method has a @Dimensional annotation, false otherwise.
-
getDimensionalAnnotation
- Returns:
- the @Dimensional annotation if set, null otherwise.
-
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
-
getClassAnnotation
Caution: findMergedAnnotation() will return the default if there are any annotations but not this annotation- Returns:
- annotation
-
getEntityAnnotation
Caution: findMergedAnnotation() will return the default if there are any annotations but not this annotation- Returns:
- annotation
-
getRepositoryAnnotation
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
-