Class CouchbaseQueryMethod

java.lang.Object
org.springframework.data.repository.query.QueryMethod
org.springframework.data.couchbase.repository.query.CouchbaseQueryMethod
Direct Known Subclasses:
ReactiveCouchbaseQueryMethod

public class CouchbaseQueryMethod extends QueryMethod
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 Details

  • Method Details

    • hasN1qlAnnotation

      public boolean hasN1qlAnnotation()
      If the method has a @Query annotation.
      Returns:
      true if it has the annotation, false otherwise.
    • getN1qlAnnotation

      public Query 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

      public WithConsistency getConsistencyAnnotation()
    • hasScanConsistencyAnnotation

      public boolean hasScanConsistencyAnnotation()
      If the method has a @ScanConsistency annotation
      Returns:
      true if this has the @ScanConsistency annotation
    • getScanConsistencyAnnotation

      public ScanConsistency getScanConsistencyAnnotation()
      ScanConsistency annotation
      Returns:
      the @ScanConsistency annotation
    • getAnnotation

      public <A extends Annotation> A getAnnotation(Class<A> annotationClass)
      Caution: findMergedAnnotation() will return the default if there are any annotations but not this annotation
      Returns:
      annotation
    • getInlineN1qlQuery

      public String getInlineN1qlQuery()
      Returns the query string declared in a Query 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

      public String toString()
      Overrides:
      toString in class QueryMethod
    • hasReactiveWrapperParameter

      public boolean hasReactiveWrapperParameter()
    • getCollection

      public String getCollection()
    • getScope

      public String getScope()