Interface CouchbaseOperations

All Superinterfaces:
ExecutableExistsByIdOperation, ExecutableFindByAnalyticsOperation, ExecutableFindByIdOperation, ExecutableFindByQueryOperation, ExecutableFindFromReplicasByIdOperation, ExecutableInsertByIdOperation, ExecutableMutateInByIdOperation, ExecutableRangeScanOperation, ExecutableRemoveByIdOperation, ExecutableRemoveByQueryOperation, ExecutableReplaceByIdOperation, ExecutableUpsertByIdOperation, FluentCouchbaseOperations
All Known Implementing Classes:
CouchbaseTemplate

public interface CouchbaseOperations extends FluentCouchbaseOperations
Defines common operations on the Couchbase data source, most commonly implemented by CouchbaseTemplate.
Author:
Michael Reiche
  • Method Details

    • getConverter

      CouchbaseConverter getConverter()
      Returns the converter used for this template/operations.
    • getBucketName

      String getBucketName()
      The name of the bucket used.
    • getScopeName

      String getScopeName()
      The name of the scope used, null if the default scope is used.
    • getCouchbaseClientFactory

      CouchbaseClientFactory getCouchbaseClientFactory()
      Returns the underlying client factory.
    • getConsistency

      com.couchbase.client.java.query.QueryScanConsistency getConsistency()
      Returns the default consistency to use for queries
    • save

      <T> T save(T entity, String... scopeAndCollection)
      Save the entity to couchbase.
      If there is no version property on the entity class, and this is in a transaction, use insert.
      If there is no version property on the entity class, and this is not in a transaction, use upsert.
      If there is a version property on the entity class, and it is non-zero, then this is an existing document, use replace.
      Otherwise, there is a version property for the entity, but it is zero or null, use insert.
      Type Parameters:
      T - the entity class
      Parameters:
      entity - the entity to save in couchbase
      scopeAndCollection - for use by repositories only. these are varargs for the scope and collection.
      Returns:
    • count

      <T> Long count(Query query, Class<T> domainType)
      Returns the count of documents found by the query.
      Type Parameters:
      T -
      Parameters:
      query -
      domainType -
      Returns: