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

    • 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

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

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

      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
    • getClassAnnotation

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

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

      public <A extends Annotation> A getRepositoryAnnotation(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()