Interface CouchbaseOperations
- All Superinterfaces:
ExecutableExistsByIdOperation, ExecutableFindByAnalyticsOperation, ExecutableFindByIdOperation, ExecutableFindByQueryOperation, ExecutableFindFromReplicasByIdOperation, ExecutableInsertByIdOperation, ExecutableMutateInByIdOperation, ExecutableRangeScanOperation, ExecutableRemoveByIdOperation, ExecutableRemoveByQueryOperation, ExecutableReplaceByIdOperation, ExecutableUpsertByIdOperation, FluentCouchbaseOperations
- All Known Implementing Classes:
CouchbaseTemplate
Defines common operations on the Couchbase data source, most commonly implemented by
CouchbaseTemplate.- Author:
- Michael Reiche
-
Nested Class Summary
Nested classes/interfaces inherited from interface ExecutableExistsByIdOperation
ExecutableExistsByIdOperation.ExecutableExistsById, ExecutableExistsByIdOperation.ExistsByIdInCollection<T>, ExecutableExistsByIdOperation.ExistsByIdInScope<T>, ExecutableExistsByIdOperation.ExistsByIdWithOptions<T>, ExecutableExistsByIdOperation.TerminatingExistsByIdNested classes/interfaces inherited from interface ExecutableFindByAnalyticsOperation
ExecutableFindByAnalyticsOperation.ExecutableFindByAnalytics<T>, ExecutableFindByAnalyticsOperation.FindByAnalyticsConsistentWith<T>, ExecutableFindByAnalyticsOperation.FindByAnalyticsInCollection<T>, ExecutableFindByAnalyticsOperation.FindByAnalyticsInScope<T>, ExecutableFindByAnalyticsOperation.FindByAnalyticsWithConsistency<T>, ExecutableFindByAnalyticsOperation.FindByAnalyticsWithOptions<T>, ExecutableFindByAnalyticsOperation.FindByAnalyticsWithProjection<T>, ExecutableFindByAnalyticsOperation.FindByAnalyticsWithQuery<T>, ExecutableFindByAnalyticsOperation.TerminatingFindByAnalytics<T>Nested classes/interfaces inherited from interface ExecutableFindByIdOperation
ExecutableFindByIdOperation.ExecutableFindById<T>, ExecutableFindByIdOperation.FindByIdInCollection<T>, ExecutableFindByIdOperation.FindByIdInScope<T>, ExecutableFindByIdOperation.FindByIdWithExpiry<T>, ExecutableFindByIdOperation.FindByIdWithLock<T>, ExecutableFindByIdOperation.FindByIdWithOptions<T>, ExecutableFindByIdOperation.FindByIdWithProjection<T>, ExecutableFindByIdOperation.TerminatingFindById<T>Nested classes/interfaces inherited from interface ExecutableFindByQueryOperation
ExecutableFindByQueryOperation.ExecutableFindByQuery<T>, ExecutableFindByQueryOperation.FindByQueryConsistentWith<T>, ExecutableFindByQueryOperation.FindByQueryInCollection<T>, ExecutableFindByQueryOperation.FindByQueryInScope<T>, ExecutableFindByQueryOperation.FindByQueryWithConsistency<T>, ExecutableFindByQueryOperation.FindByQueryWithDistinct<T>, ExecutableFindByQueryOperation.FindByQueryWithOptions<T>, ExecutableFindByQueryOperation.FindByQueryWithProjecting<T>, ExecutableFindByQueryOperation.FindByQueryWithProjection<T>, ExecutableFindByQueryOperation.FindByQueryWithQuery<T>, ExecutableFindByQueryOperation.TerminatingFindByQuery<T>Nested classes/interfaces inherited from interface ExecutableFindFromReplicasByIdOperation
ExecutableFindFromReplicasByIdOperation.ExecutableFindFromReplicasById<T>, ExecutableFindFromReplicasByIdOperation.FindFromReplicasByIdInCollection<T>, ExecutableFindFromReplicasByIdOperation.FindFromReplicasByIdInScope<T>, ExecutableFindFromReplicasByIdOperation.FindFromReplicasByIdWithOptions<T>, ExecutableFindFromReplicasByIdOperation.TerminatingFindFromReplicasById<T>Nested classes/interfaces inherited from interface ExecutableInsertByIdOperation
ExecutableInsertByIdOperation.ExecutableInsertById<T>, ExecutableInsertByIdOperation.InsertByIdInCollection<T>, ExecutableInsertByIdOperation.InsertByIdInScope<T>, ExecutableInsertByIdOperation.InsertByIdWithDurability<T>, ExecutableInsertByIdOperation.InsertByIdWithExpiry<T>, ExecutableInsertByIdOperation.InsertByIdWithOptions<T>, ExecutableInsertByIdOperation.TerminatingInsertById<T>Nested classes/interfaces inherited from interface ExecutableMutateInByIdOperation
ExecutableMutateInByIdOperation.ExecutableMutateInById<T>, ExecutableMutateInByIdOperation.MutateInByIdInCollection<T>, ExecutableMutateInByIdOperation.MutateInByIdInScope<T>, ExecutableMutateInByIdOperation.MutateInByIdWithDurability<T>, ExecutableMutateInByIdOperation.MutateInByIdWithExpiry<T>, ExecutableMutateInByIdOperation.MutateInByIdWithOptions<T>, ExecutableMutateInByIdOperation.MutateInByIdWithPaths<T>, ExecutableMutateInByIdOperation.TerminatingMutateInById<T>Nested classes/interfaces inherited from interface ExecutableRangeScanOperation
ExecutableRangeScanOperation.ExecutableRangeScan<T>, ExecutableRangeScanOperation.RangeScanConsistentWith<T>, ExecutableRangeScanOperation.RangeScanInCollection<T>, ExecutableRangeScanOperation.RangeScanInScope<T>, ExecutableRangeScanOperation.RangeScanWithBatchByteLimit<T>, ExecutableRangeScanOperation.RangeScanWithBatchItemLimit<T>, ExecutableRangeScanOperation.RangeScanWithOptions<T>, ExecutableRangeScanOperation.RangeScanWithProjection<T>, ExecutableRangeScanOperation.RangeScanWithSort<T>, ExecutableRangeScanOperation.TerminatingRangeScan<T>Nested classes/interfaces inherited from interface ExecutableRemoveByIdOperation
ExecutableRemoveByIdOperation.ExecutableRemoveById, ExecutableRemoveByIdOperation.RemoveByIdInCollection, ExecutableRemoveByIdOperation.RemoveByIdInScope, ExecutableRemoveByIdOperation.RemoveByIdWithCas, ExecutableRemoveByIdOperation.RemoveByIdWithDurability, ExecutableRemoveByIdOperation.RemoveByIdWithOptions, ExecutableRemoveByIdOperation.TerminatingRemoveByIdNested classes/interfaces inherited from interface ExecutableRemoveByQueryOperation
ExecutableRemoveByQueryOperation.ExecutableRemoveByQuery<T>, ExecutableRemoveByQueryOperation.RemoveByQueryConsistentWith<T>, ExecutableRemoveByQueryOperation.RemoveByQueryInCollection<T>, ExecutableRemoveByQueryOperation.RemoveByQueryInScope<T>, ExecutableRemoveByQueryOperation.RemoveByQueryWithConsistency<T>, ExecutableRemoveByQueryOperation.RemoveByQueryWithOptions<T>, ExecutableRemoveByQueryOperation.RemoveByQueryWithQuery<T>, ExecutableRemoveByQueryOperation.TerminatingRemoveByQuery<T>Nested classes/interfaces inherited from interface ExecutableReplaceByIdOperation
ExecutableReplaceByIdOperation.ExecutableReplaceById<T>, ExecutableReplaceByIdOperation.ReplaceByIdInCollection<T>, ExecutableReplaceByIdOperation.ReplaceByIdInScope<T>, ExecutableReplaceByIdOperation.ReplaceByIdWithDurability<T>, ExecutableReplaceByIdOperation.ReplaceByIdWithExpiry<T>, ExecutableReplaceByIdOperation.ReplaceByIdWithOptions<T>, ExecutableReplaceByIdOperation.TerminatingReplaceById<T>Nested classes/interfaces inherited from interface ExecutableUpsertByIdOperation
ExecutableUpsertByIdOperation.ExecutableUpsertById<T>, ExecutableUpsertByIdOperation.TerminatingUpsertById<T>, ExecutableUpsertByIdOperation.UpsertByIdInCollection<T>, ExecutableUpsertByIdOperation.UpsertByIdInScope<T>, ExecutableUpsertByIdOperation.UpsertByIdWithDurability<T>, ExecutableUpsertByIdOperation.UpsertByIdWithExpiry<T>, ExecutableUpsertByIdOperation.UpsertByIdWithOptions<T> -
Method Summary
Modifier and TypeMethodDescription<T> LongReturns the count of documents found by the query.The name of the bucket used.com.couchbase.client.java.query.QueryScanConsistencyReturns the default consistency to use for queriesReturns the converter used for this template/operations.Returns the underlying client factory.The name of the scope used, null if the default scope is used.<T> TSave the entity to couchbase.
If there is no version property on the entity class, and this is in a transaction, use insert.<T> TSave the entity to couchbase.
If there is no version property on the entity class, and this is in a transaction, use insert.Methods inherited from interface ExecutableExistsByIdOperation
existsById, existsByIdMethods inherited from interface ExecutableFindByAnalyticsOperation
findByAnalyticsMethods inherited from interface ExecutableFindByIdOperation
findByIdMethods inherited from interface ExecutableFindByQueryOperation
findByQueryMethods inherited from interface ExecutableFindFromReplicasByIdOperation
findFromReplicasByIdMethods inherited from interface ExecutableInsertByIdOperation
insertByIdMethods inherited from interface ExecutableMutateInByIdOperation
mutateInByIdMethods inherited from interface ExecutableRangeScanOperation
rangeScanMethods inherited from interface ExecutableRemoveByIdOperation
removeById, removeByIdMethods inherited from interface ExecutableRemoveByQueryOperation
removeByQueryMethods inherited from interface ExecutableReplaceByIdOperation
replaceByIdMethods inherited from interface ExecutableUpsertByIdOperation
upsertById
-
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, com.couchbase.client.java.CommonOptions<?> options, 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 couchbaseoptions- optionsscopeAndCollection- for use by repositories only. these are varargs for the scope and collection.- Returns:
-
save
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 couchbasescopeAndCollection- for use by repositories only. these are varargs for the scope and collection.- Returns:
-
count
-