├── .github ├── PULL_REQUEST_TEMPLATE.md ├── dco.yml └── workflows │ └── codeql.yml ├── .gitignore ├── .mvn ├── extensions.xml ├── jvm.config └── wrapper │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── CI.adoc ├── CONTRIBUTING.adoc ├── Jenkinsfile ├── LICENSE.txt ├── README.adoc ├── SECURITY.adoc ├── ci ├── clean.sh ├── pipeline.properties └── test.sh ├── mvnw ├── mvnw.cmd ├── package.json ├── pom.xml ├── settings.xml ├── src ├── main │ ├── antora │ │ ├── .github │ │ │ └── workflows │ │ │ │ └── deploy-docs.yml │ │ ├── antora-playbook.yml │ │ ├── antora.yml │ │ ├── modules │ │ │ └── ROOT │ │ │ │ ├── nav.adoc │ │ │ │ └── pages │ │ │ │ ├── commons │ │ │ │ ├── migrating.adoc │ │ │ │ └── upgrade.adoc │ │ │ │ ├── couchbase.adoc │ │ │ │ ├── couchbase │ │ │ │ ├── ansijoins.adoc │ │ │ │ ├── autokeygeneration.adoc │ │ │ │ ├── caching.adoc │ │ │ │ ├── collections.adoc │ │ │ │ ├── configuration.adoc │ │ │ │ ├── entity.adoc │ │ │ │ ├── fieldlevelencryption.adoc │ │ │ │ ├── reactiverepository.adoc │ │ │ │ ├── repository.adoc │ │ │ │ ├── template.adoc │ │ │ │ └── transactions.adoc │ │ │ │ ├── index.adoc │ │ │ │ ├── repositories.adoc │ │ │ │ └── repositories │ │ │ │ ├── core-concepts.adoc │ │ │ │ ├── core-domain-events.adoc │ │ │ │ ├── core-extensions.adoc │ │ │ │ ├── create-instances.adoc │ │ │ │ ├── custom-implementations.adoc │ │ │ │ ├── definition.adoc │ │ │ │ ├── null-handling.adoc │ │ │ │ ├── projections.adoc │ │ │ │ ├── query-keywords-reference.adoc │ │ │ │ ├── query-methods-details.adoc │ │ │ │ └── query-return-types-reference.adoc │ │ └── resources │ │ │ └── antora-resources │ │ │ └── antora.yml │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── data │ │ │ └── couchbase │ │ │ ├── CouchbaseClientFactory.java │ │ │ ├── SimpleCouchbaseClientFactory.java │ │ │ ├── cache │ │ │ ├── CacheKeyPrefix.java │ │ │ ├── CouchbaseCache.java │ │ │ ├── CouchbaseCacheConfiguration.java │ │ │ ├── CouchbaseCacheManager.java │ │ │ ├── CouchbaseCacheWriter.java │ │ │ └── DefaultCouchbaseCacheWriter.java │ │ │ ├── config │ │ │ ├── AbstractCouchbaseConfiguration.java │ │ │ ├── BeanNames.java │ │ │ └── package-info.java │ │ │ ├── core │ │ │ ├── AbstractTemplateSupport.java │ │ │ ├── CollectionCallback.java │ │ │ ├── CouchbaseDataIntegrityViolationException.java │ │ │ ├── CouchbaseExceptionTranslator.java │ │ │ ├── CouchbaseOperations.java │ │ │ ├── CouchbaseQueryExecutionException.java │ │ │ ├── CouchbaseTemplate.java │ │ │ ├── CouchbaseTemplateSupport.java │ │ │ ├── ExecutableExistsByIdOperation.java │ │ │ ├── ExecutableExistsByIdOperationSupport.java │ │ │ ├── ExecutableFindByAnalyticsOperation.java │ │ │ ├── ExecutableFindByAnalyticsOperationSupport.java │ │ │ ├── ExecutableFindByIdOperation.java │ │ │ ├── ExecutableFindByIdOperationSupport.java │ │ │ ├── ExecutableFindByQueryOperation.java │ │ │ ├── ExecutableFindByQueryOperationSupport.java │ │ │ ├── ExecutableFindFromReplicasByIdOperation.java │ │ │ ├── ExecutableFindFromReplicasByIdOperationSupport.java │ │ │ ├── ExecutableInsertByIdOperation.java │ │ │ ├── ExecutableInsertByIdOperationSupport.java │ │ │ ├── ExecutableMutateInByIdOperation.java │ │ │ ├── ExecutableMutateInByIdOperationSupport.java │ │ │ ├── ExecutableRangeScanOperation.java │ │ │ ├── ExecutableRangeScanOperationSupport.java │ │ │ ├── ExecutableRemoveByIdOperation.java │ │ │ ├── ExecutableRemoveByIdOperationSupport.java │ │ │ ├── ExecutableRemoveByQueryOperation.java │ │ │ ├── ExecutableRemoveByQueryOperationSupport.java │ │ │ ├── ExecutableReplaceByIdOperation.java │ │ │ ├── ExecutableReplaceByIdOperationSupport.java │ │ │ ├── ExecutableUpsertByIdOperation.java │ │ │ ├── ExecutableUpsertByIdOperationSupport.java │ │ │ ├── FluentCouchbaseOperations.java │ │ │ ├── NonReactiveSupportWrapper.java │ │ │ ├── OperationCancellationException.java │ │ │ ├── OperationInterruptedException.java │ │ │ ├── ReactiveCouchbaseOperations.java │ │ │ ├── ReactiveCouchbaseTemplate.java │ │ │ ├── ReactiveCouchbaseTemplateSupport.java │ │ │ ├── ReactiveExistsByIdOperation.java │ │ │ ├── ReactiveExistsByIdOperationSupport.java │ │ │ ├── ReactiveFindByAnalyticsOperation.java │ │ │ ├── ReactiveFindByAnalyticsOperationSupport.java │ │ │ ├── ReactiveFindByIdOperation.java │ │ │ ├── ReactiveFindByIdOperationSupport.java │ │ │ ├── ReactiveFindByQueryOperation.java │ │ │ ├── ReactiveFindByQueryOperationSupport.java │ │ │ ├── ReactiveFindFromReplicasByIdOperation.java │ │ │ ├── ReactiveFindFromReplicasByIdOperationSupport.java │ │ │ ├── ReactiveFluentCouchbaseOperations.java │ │ │ ├── ReactiveInsertByIdOperation.java │ │ │ ├── ReactiveInsertByIdOperationSupport.java │ │ │ ├── ReactiveMutateInByIdOperation.java │ │ │ ├── ReactiveMutateInByIdOperationSupport.java │ │ │ ├── ReactiveRangeScanOperation.java │ │ │ ├── ReactiveRangeScanOperationSupport.java │ │ │ ├── ReactiveRemoveByIdOperation.java │ │ │ ├── ReactiveRemoveByIdOperationSupport.java │ │ │ ├── ReactiveRemoveByQueryOperation.java │ │ │ ├── ReactiveRemoveByQueryOperationSupport.java │ │ │ ├── ReactiveReplaceByIdOperation.java │ │ │ ├── ReactiveReplaceByIdOperationSupport.java │ │ │ ├── ReactiveTemplateSupport.java │ │ │ ├── ReactiveUpsertByIdOperation.java │ │ │ ├── ReactiveUpsertByIdOperationSupport.java │ │ │ ├── RemoveResult.java │ │ │ ├── TemplateSupport.java │ │ │ ├── TransactionalSupport.java │ │ │ ├── UnsupportedCouchbaseFeatureException.java │ │ │ ├── convert │ │ │ │ ├── AbstractCouchbaseConverter.java │ │ │ │ ├── BooleanToEnumConverterFactory.java │ │ │ │ ├── ConverterHasNoConversion.java │ │ │ │ ├── ConverterRegistration.java │ │ │ │ ├── CouchbaseConversionContext.java │ │ │ │ ├── CouchbaseConverter.java │ │ │ │ ├── CouchbaseCustomConversions.java │ │ │ │ ├── CouchbaseDocumentPropertyAccessor.java │ │ │ │ ├── CouchbaseJsr310Converters.java │ │ │ │ ├── CouchbasePropertyValueConverterFactory.java │ │ │ │ ├── CouchbaseTypeMapper.java │ │ │ │ ├── CouchbaseWriter.java │ │ │ │ ├── CryptoConverter.java │ │ │ │ ├── CustomConversions.java │ │ │ │ ├── DateConverters.java │ │ │ │ ├── DefaultCouchbaseTypeMapper.java │ │ │ │ ├── IntegerToEnumConverterFactory.java │ │ │ │ ├── JsonValueConverter.java │ │ │ │ ├── MappingCouchbaseConverter.java │ │ │ │ ├── OtherConverters.java │ │ │ │ ├── StringToEnumConverterFactory.java │ │ │ │ ├── TypeAwareTypeInformationMapper.java │ │ │ │ ├── join │ │ │ │ │ └── N1qlJoinResolver.java │ │ │ │ ├── package-info.java │ │ │ │ └── translation │ │ │ │ │ ├── JacksonTranslationService.java │ │ │ │ │ ├── TranslationService.java │ │ │ │ │ └── package-info.java │ │ │ ├── index │ │ │ │ ├── CompositeQueryIndex.java │ │ │ │ ├── CompositeQueryIndexes.java │ │ │ │ ├── CouchbasePersistentEntityIndexCreator.java │ │ │ │ ├── CouchbasePersistentEntityIndexResolver.java │ │ │ │ ├── IndexDefinition.java │ │ │ │ ├── QueryIndexDirection.java │ │ │ │ ├── QueryIndexResolver.java │ │ │ │ └── QueryIndexed.java │ │ │ ├── mapping │ │ │ │ ├── BasicCouchbasePersistentEntity.java │ │ │ │ ├── BasicCouchbasePersistentProperty.java │ │ │ │ ├── CouchbaseDocument.java │ │ │ │ ├── CouchbaseList.java │ │ │ │ ├── CouchbaseMappingContext.java │ │ │ │ ├── CouchbasePersistentEntity.java │ │ │ │ ├── CouchbasePersistentProperty.java │ │ │ │ ├── CouchbaseSimpleTypes.java │ │ │ │ ├── CouchbaseStorable.java │ │ │ │ ├── Document.java │ │ │ │ ├── Durability.java │ │ │ │ ├── Expiration.java │ │ │ │ ├── Expiry.java │ │ │ │ ├── Field.java │ │ │ │ ├── KeySettings.java │ │ │ │ ├── event │ │ │ │ │ ├── AbstractCouchbaseEventListener.java │ │ │ │ │ ├── AfterConvertCallback.java │ │ │ │ │ ├── AfterDeleteEvent.java │ │ │ │ │ ├── AfterSaveEvent.java │ │ │ │ │ ├── AuditingEntityCallback.java │ │ │ │ │ ├── AuditingEventListener.java │ │ │ │ │ ├── BeforeConvertCallback.java │ │ │ │ │ ├── BeforeConvertEvent.java │ │ │ │ │ ├── BeforeDeleteEvent.java │ │ │ │ │ ├── BeforeSaveEvent.java │ │ │ │ │ ├── CouchbaseMappingEvent.java │ │ │ │ │ ├── LoggingEventListener.java │ │ │ │ │ ├── ReactiveAfterConvertCallback.java │ │ │ │ │ ├── ReactiveAuditingEntityCallback.java │ │ │ │ │ ├── ReactiveBeforeConvertCallback.java │ │ │ │ │ ├── ValidatingCouchbaseEventListener.java │ │ │ │ │ └── package-info.java │ │ │ │ ├── id │ │ │ │ │ ├── GeneratedValue.java │ │ │ │ │ ├── GenerationStrategy.java │ │ │ │ │ ├── IdAttribute.java │ │ │ │ │ ├── IdPrefix.java │ │ │ │ │ └── IdSuffix.java │ │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ ├── query │ │ │ │ ├── AnalyticsQuery.java │ │ │ │ ├── Consistency.java │ │ │ │ ├── Dimensional.java │ │ │ │ ├── FetchType.java │ │ │ │ ├── HashSide.java │ │ │ │ ├── Meta.java │ │ │ │ ├── N1QLExpression.java │ │ │ │ ├── N1QLQuery.java │ │ │ │ ├── N1qlJoin.java │ │ │ │ ├── N1qlPrimaryIndexed.java │ │ │ │ ├── N1qlSecondaryIndexed.java │ │ │ │ ├── OptionsBuilder.java │ │ │ │ ├── Query.java │ │ │ │ ├── QueryCriteria.java │ │ │ │ ├── QueryCriteriaDefinition.java │ │ │ │ ├── StringQuery.java │ │ │ │ ├── View.java │ │ │ │ ├── ViewIndexed.java │ │ │ │ ├── WithConsistency.java │ │ │ │ └── package-info.java │ │ │ └── support │ │ │ │ ├── AnyId.java │ │ │ │ ├── AnyIdReactive.java │ │ │ │ ├── ConsistentWith.java │ │ │ │ ├── InCollection.java │ │ │ │ ├── InScope.java │ │ │ │ ├── OneAndAll.java │ │ │ │ ├── OneAndAllEntity.java │ │ │ │ ├── OneAndAllEntityReactive.java │ │ │ │ ├── OneAndAllExists.java │ │ │ │ ├── OneAndAllExistsReactive.java │ │ │ │ ├── OneAndAllId.java │ │ │ │ ├── OneAndAllIdReactive.java │ │ │ │ ├── OneAndAllReactive.java │ │ │ │ ├── PseudoArgs.java │ │ │ │ ├── TemplateUtils.java │ │ │ │ ├── WithAnalyticsConsistency.java │ │ │ │ ├── WithAnalyticsOptions.java │ │ │ │ ├── WithAnalyticsQuery.java │ │ │ │ ├── WithBatchByteLimit.java │ │ │ │ ├── WithBatchItemLimit.java │ │ │ │ ├── WithConsistency.java │ │ │ │ ├── WithDistinct.java │ │ │ │ ├── WithDurability.java │ │ │ │ ├── WithExistsOptions.java │ │ │ │ ├── WithExpiry.java │ │ │ │ ├── WithGetAnyReplicaOptions.java │ │ │ │ ├── WithGetOptions.java │ │ │ │ ├── WithInsertOptions.java │ │ │ │ ├── WithLock.java │ │ │ │ ├── WithMutateInOptions.java │ │ │ │ ├── WithMutateInPaths.java │ │ │ │ ├── WithProjecting.java │ │ │ │ ├── WithProjection.java │ │ │ │ ├── WithProjectionId.java │ │ │ │ ├── WithQuery.java │ │ │ │ ├── WithQueryOptions.java │ │ │ │ ├── WithRemoveOptions.java │ │ │ │ ├── WithReplaceOptions.java │ │ │ │ ├── WithScanOptions.java │ │ │ │ ├── WithScanSort.java │ │ │ │ └── WithUpsertOptions.java │ │ │ ├── querydsl │ │ │ └── document │ │ │ │ ├── AbstractCouchbaseQueryDSL.java │ │ │ │ └── CouchbaseDocumentSerializer.java │ │ │ ├── repository │ │ │ ├── Collection.java │ │ │ ├── CouchbaseRepository.java │ │ │ ├── DynamicProxyable.java │ │ │ ├── Options.java │ │ │ ├── Query.java │ │ │ ├── ReactiveCouchbaseRepository.java │ │ │ ├── ScanConsistency.java │ │ │ ├── Scope.java │ │ │ ├── auditing │ │ │ │ ├── CouchbaseAuditingRegistrar.java │ │ │ │ ├── EnableCouchbaseAuditing.java │ │ │ │ ├── EnableReactiveCouchbaseAuditing.java │ │ │ │ ├── PersistentEntitiesFactoryBean.java │ │ │ │ └── ReactiveCouchbaseAuditingRegistrar.java │ │ │ ├── cdi │ │ │ │ ├── CouchbaseRepositoryBean.java │ │ │ │ └── CouchbaseRepositoryExtension.java │ │ │ ├── config │ │ │ │ ├── CouchbaseRepositoriesRegistrar.java │ │ │ │ ├── CouchbaseRepositoryConfigurationExtension.java │ │ │ │ ├── EnableCouchbaseRepositories.java │ │ │ │ ├── EnableReactiveCouchbaseRepositories.java │ │ │ │ ├── ReactiveCouchbaseRepositoriesRegistrar.java │ │ │ │ ├── ReactiveCouchbaseRepositoryConfigurationExtension.java │ │ │ │ ├── ReactiveRepositoryOperationsMapping.java │ │ │ │ ├── RepositoryOperationsMapping.java │ │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ ├── query │ │ │ │ ├── AbstractCouchbaseQuery.java │ │ │ │ ├── AbstractCouchbaseQueryBase.java │ │ │ │ ├── AbstractN1qlBasedQuery.java │ │ │ │ ├── AbstractReactiveCouchbaseQuery.java │ │ │ │ ├── ConvertingIterator.java │ │ │ │ ├── CouchbaseEntityInformation.java │ │ │ │ ├── CouchbasePartTree.java │ │ │ │ ├── CouchbaseQueryExecution.java │ │ │ │ ├── CouchbaseQueryMethod.java │ │ │ │ ├── CouchbaseRepositoryQuery.java │ │ │ │ ├── CountFragment.java │ │ │ │ ├── N1qlCountQueryCreator.java │ │ │ │ ├── N1qlMutateQueryCreator.java │ │ │ │ ├── N1qlQueryCreator.java │ │ │ │ ├── N1qlRepositoryQueryExecutor.java │ │ │ │ ├── OldN1qlQueryCreator.java │ │ │ │ ├── PartTreeCouchbaseQuery.java │ │ │ │ ├── PartTreeN1qlBasedQuery.java │ │ │ │ ├── PartTreeN1qlQueryCreator.java │ │ │ │ ├── ReactiveAbstractN1qlBasedQuery.java │ │ │ │ ├── ReactiveCouchbaseParameterAccessor.java │ │ │ │ ├── ReactiveCouchbaseQueryExecution.java │ │ │ │ ├── ReactiveCouchbaseQueryMethod.java │ │ │ │ ├── ReactiveCouchbaseRepositoryQuery.java │ │ │ │ ├── ReactiveN1qlRepositoryQueryExecutor.java │ │ │ │ ├── ReactivePartTreeCouchbaseQuery.java │ │ │ │ ├── ReactivePartTreeN1qlBasedQuery.java │ │ │ │ ├── ReactiveStringBasedCouchbaseQuery.java │ │ │ │ ├── ResultProcessingConverter.java │ │ │ │ ├── StringBasedCouchbaseQuery.java │ │ │ │ ├── StringBasedN1qlQueryParser.java │ │ │ │ ├── StringN1qlQueryCreator.java │ │ │ │ ├── package-info.java │ │ │ │ └── support │ │ │ │ │ ├── AwtPointInShapeEvaluator.java │ │ │ │ │ ├── GeoUtils.java │ │ │ │ │ ├── N1qlQueryCreatorUtils.java │ │ │ │ │ ├── N1qlUtils.java │ │ │ │ │ ├── PointInShapeEvaluator.java │ │ │ │ │ └── package-info.java │ │ │ └── support │ │ │ │ ├── BasicQuery.java │ │ │ │ ├── CouchbaseAnnotationProcessor.java │ │ │ │ ├── CouchbaseRepositoryBase.java │ │ │ │ ├── CouchbaseRepositoryFactory.java │ │ │ │ ├── CouchbaseRepositoryFactoryBean.java │ │ │ │ ├── CrudMethodMetadata.java │ │ │ │ ├── CrudMethodMetadataPostProcessor.java │ │ │ │ ├── DBRef.java │ │ │ │ ├── DynamicInvocationHandler.java │ │ │ │ ├── FetchableFluentQuerySupport.java │ │ │ │ ├── FindMethod.java │ │ │ │ ├── MappingCouchbaseEntityInformation.java │ │ │ │ ├── QuerydslCouchbasePredicateExecutor.java │ │ │ │ ├── QuerydslPredicateExecutorSupport.java │ │ │ │ ├── ReactiveCouchbaseRepositoryFactory.java │ │ │ │ ├── ReactiveCouchbaseRepositoryFactoryBean.java │ │ │ │ ├── SimpleCouchbaseRepository.java │ │ │ │ ├── SimpleReactiveCouchbaseRepository.java │ │ │ │ ├── SpringDataCouchbaseQuery.java │ │ │ │ ├── SpringDataCouchbaseQuerySupport.java │ │ │ │ ├── SpringDataCouchbaseSerializer.java │ │ │ │ ├── Util.java │ │ │ │ ├── ViewMetadataProvider.java │ │ │ │ ├── ViewPostProcessor.java │ │ │ │ └── package-info.java │ │ │ └── transaction │ │ │ ├── CouchbaseCallbackTransactionManager.java │ │ │ ├── CouchbaseResourceHolder.java │ │ │ ├── CouchbaseResourceOwner.java │ │ │ ├── CouchbaseTransactionDefinition.java │ │ │ ├── CouchbaseTransactionInterceptor.java │ │ │ ├── CouchbaseTransactionStatus.java │ │ │ ├── CouchbaseTransactionalOperator.java │ │ │ └── error │ │ │ ├── TransactionRollbackRequestedException.java │ │ │ ├── TransactionSystemAmbiguousException.java │ │ │ ├── TransactionSystemCouchbaseException.java │ │ │ ├── TransactionSystemUnambiguousException.java │ │ │ └── UncategorizedTransactionDataAccessException.java │ └── resources │ │ ├── META-INF │ │ ├── services │ │ │ └── jakarta.enterprise.inject.spi.Extension │ │ ├── spring.factories │ │ ├── spring.handlers │ │ ├── spring.schemas │ │ └── spring.tooling │ │ ├── changelog.txt │ │ ├── license.txt │ │ └── notice.txt └── test │ ├── java │ └── org │ │ └── springframework │ │ └── data │ │ └── couchbase │ │ ├── cache │ │ ├── CacheUser.java │ │ ├── CouchbaseCacheCollectionIntegrationTests.java │ │ ├── CouchbaseCacheCollectionTranscoderIntegrationTests.java │ │ └── CouchbaseCacheIntegrationTests.java │ │ ├── core │ │ ├── CouchbaseTemplateKeyValueIntegrationTests.java │ │ ├── CouchbaseTemplateQueryCollectionIntegrationTests.java │ │ ├── CouchbaseTemplateQueryIntegrationTests.java │ │ ├── CustomTypeKeyIntegrationTests.java │ │ ├── ReactiveCouchbaseTemplateConcurrencyTests.java │ │ ├── ReactiveCouchbaseTemplateKeyValueIntegrationTests.java │ │ ├── convert │ │ │ └── translation │ │ │ │ └── JacksonTranslationServiceTests.java │ │ ├── mapping │ │ │ ├── BasicCouchbasePersistentEntityTests.java │ │ │ ├── BasicCouchbasePersistentPropertyTests.java │ │ │ ├── CustomConvertersTests.java │ │ │ └── MappingCouchbaseConverterTests.java │ │ └── query │ │ │ ├── QueryCriteriaTests.java │ │ │ └── ReactiveCouchbaseTemplateQueryCollectionIntegrationTests.java │ │ ├── domain │ │ ├── AbstractEntity.java │ │ ├── AbstractUser.java │ │ ├── AbstractUserRepository.java │ │ ├── AbstractingMappingCouchbaseConverter.java │ │ ├── AbstractingTypeMapper.java │ │ ├── Address.java │ │ ├── AddressAnnotated.java │ │ ├── AddressWithEncStreet.java │ │ ├── Airline.java │ │ ├── AirlineCollectioned.java │ │ ├── AirlineCollectionedRepository.java │ │ ├── AirlineRepository.java │ │ ├── Airport.java │ │ ├── AirportJsonValue.java │ │ ├── AirportJsonValueRepository.java │ │ ├── AirportJsonValuedObject.java │ │ ├── AirportMini.java │ │ ├── AirportRepository.java │ │ ├── AirportRepositoryAnnotated.java │ │ ├── AirportRepositoryScanConsistencyTest.java │ │ ├── AssessmentDO.java │ │ ├── BigAirline.java │ │ ├── BigAirlineRepository.java │ │ ├── CapellaConnectSample.java │ │ ├── ComparableEntity.java │ │ ├── Config.java │ │ ├── ConfigScoped.java │ │ ├── Course.java │ │ ├── CustomMappingCouchbaseConverter.java │ │ ├── EBTurbulenceCategory.java │ │ ├── EITurbulenceCategory.java │ │ ├── EJsonCreatorTurbulenceCategory.java │ │ ├── ETurbulenceCategory.java │ │ ├── FluxIntegrationTests.java │ │ ├── Iata.java │ │ ├── Library.java │ │ ├── LibraryRepository.java │ │ ├── MutableUser.java │ │ ├── MyPerson.java │ │ ├── MyPersonRepository.java │ │ ├── NaiveAuditorAware.java │ │ ├── OtherUser.java │ │ ├── Person.java │ │ ├── PersonRepository.java │ │ ├── PersonValue.java │ │ ├── PersonValueRepository.java │ │ ├── PersonWithDurability.java │ │ ├── PersonWithDurability2.java │ │ ├── PersonWithMaps.java │ │ ├── PersonWithoutVersion.java │ │ ├── ReactiveAirlineRepository.java │ │ ├── ReactiveAirportMustScopeRepository.java │ │ ├── ReactiveAirportRepository.java │ │ ├── ReactiveAirportRepositoryAnnotated.java │ │ ├── ReactiveNaiveAuditorAware.java │ │ ├── ReactivePersonRepository.java │ │ ├── ReactiveUserColRepository.java │ │ ├── ReactiveUserRepository.java │ │ ├── Submission.java │ │ ├── SubscriptionToken.java │ │ ├── SubscriptionTokenRepository.java │ │ ├── TestEncrypted.java │ │ ├── TypeAwareTypeInformationMapper.java │ │ ├── TypeBasedCouchbaseTypeMapper.java │ │ ├── User.java │ │ ├── UserAnnotated.java │ │ ├── UserAnnotated2.java │ │ ├── UserAnnotated3.java │ │ ├── UserAnnotatedDurability.java │ │ ├── UserAnnotatedDurabilityExpression.java │ │ ├── UserAnnotatedPersistTo.java │ │ ├── UserAnnotatedReplicateTo.java │ │ ├── UserAnnotatedTouchOnRead.java │ │ ├── UserCol.java │ │ ├── UserColRepository.java │ │ ├── UserEncrypted.java │ │ ├── UserEncryptedRepository.java │ │ ├── UserJustLastName.java │ │ ├── UserNoAlias.java │ │ ├── UserRepository.java │ │ ├── UserSubmission.java │ │ ├── UserSubmissionAnnotated.java │ │ ├── UserSubmissionAnnotatedRepository.java │ │ ├── UserSubmissionProjected.java │ │ ├── UserSubmissionRepository.java │ │ ├── UserSubmissionUnannotated.java │ │ ├── UserSubmissionUnannotatedRepository.java │ │ └── time │ │ │ ├── AuditingDateTimeProvider.java │ │ │ ├── CurrentDateTimeService.java │ │ │ ├── DateTimeService.java │ │ │ └── FixedDateTimeService.java │ │ ├── repository │ │ ├── CouchbaseAbstractRepositoryIntegrationTests.java │ │ ├── CouchbaseRepositoryAutoQueryIndexIntegrationTests.java │ │ ├── CouchbaseRepositoryFieldLevelEncryptionIntegrationTests.java │ │ ├── CouchbaseRepositoryKeyValueIntegrationTests.java │ │ ├── CouchbaseRepositoryQueryIntegrationTests.java │ │ ├── ReactiveCouchbaseRepositoryKeyValueIntegrationTests.java │ │ ├── ReactiveCouchbaseRepositoryQueryIntegrationTests.java │ │ └── query │ │ │ ├── CouchbaseRepositoryCollectionQuerydslIntegrationTests.java │ │ │ ├── CouchbaseRepositoryQueryCollectionIntegrationTests.java │ │ │ ├── CouchbaseRepositoryQuerydslIntegrationTests.java │ │ │ ├── N1qlQueryCreatorTests.java │ │ │ ├── ReactiveCouchbaseRepositoryQueryCollectionIntegrationTests.java │ │ │ ├── StringN1qlQueryCreatorIntegrationTests.java │ │ │ └── StringN1qlQueryCreatorTests.java │ │ ├── transactions │ │ ├── AfterTransactionAssertion.java │ │ ├── CouchbasePersonTransactionIntegrationTests.java │ │ ├── CouchbasePersonTransactionReactiveIntegrationTests.java │ │ ├── CouchbaseReactiveTransactionNativeIntegrationTests.java │ │ ├── CouchbaseTransactionNativeIntegrationTests.java │ │ ├── CouchbaseTransactionalNonAllowableOperationsIntegrationTests.java │ │ ├── CouchbaseTransactionalOperatorTemplateIntegrationTests.java │ │ ├── CouchbaseTransactionalOptionsIntegrationTests.java │ │ ├── CouchbaseTransactionalPropagationIntegrationTests.java │ │ ├── CouchbaseTransactionalRepositoryCollectionIntegrationTests.java │ │ ├── CouchbaseTransactionalRepositoryIntegrationTests.java │ │ ├── CouchbaseTransactionalTemplateCollectionDefaultScopeIntegrationTests.java │ │ ├── CouchbaseTransactionalTemplateCollectionIntegrationTests.java │ │ ├── CouchbaseTransactionalTemplateIntegrationTests.java │ │ ├── CouchbaseTransactionalUnsettableParametersIntegrationTests.java │ │ ├── DirectPlatformTransactionManagerIntegrationTests.java │ │ ├── ObjectId.java │ │ ├── PersonService.java │ │ ├── PersonServiceReactive.java │ │ ├── ReactiveTransactionalTemplateIntegrationTests.java │ │ ├── ReplaceLoopThread.java │ │ ├── SimulateFailureException.java │ │ ├── TransactionTemplateIntegrationTests.java │ │ ├── TransactionsConfig.java │ │ ├── sdk │ │ │ ├── SDKReactiveTransactionsNonAllowableOperationsIntegrationTests.java │ │ │ ├── SDKReactiveTransactionsPersonIntegrationTests.java │ │ │ ├── SDKReactiveTransactionsTemplateIntegrationTests.java │ │ │ ├── SDKTransactionsNonAllowableOperationsIntegrationTests.java │ │ │ ├── SDKTransactionsNonBlockingThreadIntegrationTests.java │ │ │ ├── SDKTransactionsSaveIntegrationTests.java │ │ │ └── SDKTransactionsTemplateIntegrationTests.java │ │ └── util │ │ │ └── TransactionTestUtil.java │ │ └── util │ │ ├── Capabilities.java │ │ ├── ClusterAwareIntegrationTests.java │ │ ├── ClusterInvocationProvider.java │ │ ├── ClusterType.java │ │ ├── CollectionAwareDefaultScopeIntegrationTests.java │ │ ├── CollectionAwareIntegrationTests.java │ │ ├── IgnoreWhen.java │ │ ├── JavaIntegrationTests.java │ │ ├── MockTestCluster.java │ │ ├── Services.java │ │ ├── TestCluster.java │ │ ├── TestClusterConfig.java │ │ ├── TestNodeConfig.java │ │ ├── UnmanagedTestCluster.java │ │ └── Util.java │ └── resources │ ├── META-INF │ └── beans.xml │ ├── configurations │ ├── couchbase-consistency.xml │ ├── couchbase-multi-bucket-bean.xml │ ├── couchbase-repository-bean.xml │ ├── couchbase-template-bean.xml │ ├── couchbase-template-with-translation-service-bean.xml │ ├── couchbase-typekey.xml │ ├── couchbaseBucket-bean.xml │ ├── couchbaseCluster-bean.xml │ ├── couchbaseEnv-bean.xml │ └── couchbaseSingleEnv-bean.xml │ ├── integration.properties │ ├── logback.xml │ └── server.properties └── template.mf /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 7 | 8 | - [ ] You have read the [Spring Data contribution guidelines](https://github.com/spring-projects/spring-data-build/blob/master/CONTRIBUTING.adoc). 9 | - [ ] There is a ticket in the bug tracker for the project in our [JIRA](https://jira.spring.io/browse/DATACOUCH). 10 | - [ ] You use the code formatters provided [here](https://github.com/spring-projects/spring-data-build/tree/master/etc/ide) and have them applied to your changes. Don’t submit any formatting related changes. 11 | - [ ] You submit test cases (unit or integration tests) that back your changes. 12 | - [ ] You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only). 13 | -------------------------------------------------------------------------------- /.github/dco.yml: -------------------------------------------------------------------------------- 1 | require: 2 | members: false 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | .DS_Store 3 | 4 | .classpath 5 | .project 6 | .settings 7 | 8 | *.iml 9 | .idea 10 | 11 | build/ 12 | node_modules 13 | node 14 | package-lock.json 15 | 16 | .mvn/.develocity 17 | -------------------------------------------------------------------------------- /.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | io.spring.develocity.conventions 5 | develocity-conventions-maven-extension 6 | 0.0.22 7 | 8 | 9 | -------------------------------------------------------------------------------- /.mvn/jvm.config: -------------------------------------------------------------------------------- 1 | --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED 2 | --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED 3 | --add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED 4 | --add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED 5 | --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED 6 | --add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED 7 | --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED 8 | --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED 9 | --add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED 10 | --add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED 11 | --add-opens=java.base/java.util=ALL-UNNAMED 12 | --add-opens=java.base/java.lang.reflect=ALL-UNNAMED 13 | --add-opens=java.base/java.text=ALL-UNNAMED 14 | --add-opens=java.desktop/java.awt.font=ALL-UNNAMED 15 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-projects/spring-data-couchbase/5b5a8f6ede9279c8d1620763929804787b4886ed/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Nov 07 09:47:28 CET 2024 2 | distributionUrl=https\://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip 3 | -------------------------------------------------------------------------------- /CONTRIBUTING.adoc: -------------------------------------------------------------------------------- 1 | = Spring Data contribution guidelines 2 | 3 | You find the contribution guidelines for Spring Data projects https://github.com/spring-projects/spring-data-build/blob/main/CONTRIBUTING.adoc[here]. 4 | -------------------------------------------------------------------------------- /SECURITY.adoc: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | Please see the https://spring.io/projects/spring-data-couchbase[Spring Data Couchbase] project page for supported versions. 6 | 7 | ## Reporting a Vulnerability 8 | 9 | Please don't raise security vulnerabilities here. Head over to https://pivotal.io/security to learn how to disclose them responsibly. 10 | -------------------------------------------------------------------------------- /ci/clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | set -euo pipefail 4 | 5 | export JENKINS_USER=${JENKINS_USER_NAME} 6 | 7 | MAVEN_OPTS="-Duser.name=${JENKINS_USER} -Duser.home=/tmp/jenkins-home" \ 8 | ./mvnw -s settings.xml clean -Dscan=false -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-couchbase -Ddevelocity.storage.directory=/tmp/jenkins-home/.develocity-root 9 | -------------------------------------------------------------------------------- /ci/pipeline.properties: -------------------------------------------------------------------------------- 1 | # Java versions 2 | java.main.tag=24.0.1_9-jdk-noble 3 | java.next.tag=24.0.1_9-jdk-noble 4 | 5 | # Docker container images - standard 6 | docker.java.main.image=library/eclipse-temurin:${java.main.tag} 7 | docker.java.next.image=library/eclipse-temurin:${java.next.tag} 8 | 9 | # Supported versions of MongoDB 10 | docker.mongodb.6.0.version=6.0.23 11 | docker.mongodb.7.0.version=7.0.20 12 | docker.mongodb.8.0.version=8.0.9 13 | 14 | # Supported versions of Redis 15 | docker.redis.6.version=6.2.13 16 | docker.redis.7.version=7.2.4 17 | docker.valkey.8.version=8.1.1 18 | 19 | # Docker environment settings 20 | docker.java.inside.basic=-v $HOME:/tmp/jenkins-home 21 | docker.java.inside.docker=-u root -v /var/run/docker.sock:/var/run/docker.sock -v /usr/bin/docker:/usr/bin/docker -v $HOME:/tmp/jenkins-home 22 | 23 | # Credentials 24 | docker.registry= 25 | docker.credentials=hub.docker.com-springbuildmaster 26 | docker.proxy.registry=https://docker-hub.usw1.packages.broadcom.com 27 | docker.proxy.credentials=usw1_packages_broadcom_com-jenkins-token 28 | artifactory.credentials=02bd1690-b54f-4c9f-819d-a77cb7a9822c 29 | artifactory.url=https://repo.spring.io 30 | artifactory.repository.snapshot=libs-snapshot-local 31 | develocity.access-key=gradle_enterprise_secret_access_key 32 | jenkins.user.name=spring-builds+jenkins 33 | -------------------------------------------------------------------------------- /ci/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -x 2 | 3 | set -euo pipefail 4 | 5 | mkdir -p /tmp/jenkins-home/.m2/spring-data-couchbase 6 | 7 | export JENKINS_USER=${JENKINS_USER_NAME} 8 | 9 | MAVEN_OPTS="-Duser.name=${JENKINS_USER} -Duser.home=/tmp/jenkins-home" \ 10 | ./mvnw -s settings.xml \ 11 | -P${PROFILE} clean dependency:list test -Dsort -U -B -Dmaven.repo.local=/tmp/jenkins-home/.m2/spring-data-couchbase -Ddevelocity.storage.directory=/tmp/jenkins-home/.develocity-root 12 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "antora": "3.2.0-alpha.6", 4 | "@antora/atlas-extension": "1.0.0-alpha.2", 5 | "@antora/collector-extension": "1.0.0-alpha.7", 6 | "@asciidoctor/tabs": "1.0.0-beta.6", 7 | "@springio/antora-extensions": "1.13.0", 8 | "@springio/asciidoctor-extensions": "1.0.0-alpha.11" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /settings.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | spring-plugins-release 9 | ${env.ARTIFACTORY_USR} 10 | ${env.ARTIFACTORY_PSW} 11 | 12 | 13 | spring-libs-snapshot 14 | ${env.ARTIFACTORY_USR} 15 | ${env.ARTIFACTORY_PSW} 16 | 17 | 18 | spring-libs-milestone 19 | ${env.ARTIFACTORY_USR} 20 | ${env.ARTIFACTORY_PSW} 21 | 22 | 23 | spring-libs-release 24 | ${env.ARTIFACTORY_USR} 25 | ${env.ARTIFACTORY_PSW} 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/main/antora/.github/workflows/deploy-docs.yml: -------------------------------------------------------------------------------- 1 | name: Deploy Docs 2 | on: 3 | push: 4 | branches-ignore: [ gh-pages ] 5 | tags: '**' 6 | repository_dispatch: 7 | types: request-build-reference # legacy 8 | #schedule: 9 | #- cron: '0 10 * * *' # Once per day at 10am UTC 10 | workflow_dispatch: 11 | permissions: 12 | actions: write 13 | jobs: 14 | build: 15 | runs-on: ubuntu-latest 16 | # FIXME: enable when pushed to spring-projects 17 | # if: github.repository_owner == 'spring-projects' 18 | steps: 19 | - name: Checkout 20 | uses: actions/checkout@v3 21 | with: 22 | ref: docs-build 23 | fetch-depth: 1 24 | - name: Dispatch (partial build) 25 | if: github.ref_type == 'branch' 26 | env: 27 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 28 | run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD) -f build-refname=${{ github.ref_name }} 29 | - name: Dispatch (full build) 30 | if: github.ref_type == 'tag' 31 | env: 32 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 33 | run: gh workflow run deploy-docs.yml -r $(git rev-parse --abbrev-ref HEAD) 34 | -------------------------------------------------------------------------------- /src/main/antora/antora-playbook.yml: -------------------------------------------------------------------------------- 1 | # PACKAGES antora@3.2.0-alpha.2 @antora/atlas-extension:1.0.0-alpha.1 @antora/collector-extension@1.0.0-alpha.3 @springio/antora-extensions@1.1.0-alpha.2 @asciidoctor/tabs@1.0.0-alpha.12 @opendevise/antora-release-line-extension@1.0.0-alpha.2 2 | # 3 | # The purpose of this Antora playbook is to build the docs in the current branch. 4 | antora: 5 | extensions: 6 | - require: '@springio/antora-extensions' 7 | root_component_name: 'data-couchbase' 8 | site: 9 | title: Spring Data Couchbase 10 | url: https://docs.spring.io/spring-data-couchbase/reference/ 11 | content: 12 | sources: 13 | - url: ./../../.. 14 | branches: HEAD 15 | start_path: src/main/antora 16 | worktrees: true 17 | - url: https://github.com/spring-projects/spring-data-commons 18 | # Refname matching: 19 | # https://docs.antora.org/antora/latest/playbook/content-refname-matching/ 20 | branches: [ main, 3.2.x ] 21 | start_path: src/main/antora 22 | asciidoc: 23 | attributes: 24 | hide-uri-scheme: '@' 25 | tabs-sync-option: '@' 26 | extensions: 27 | - '@asciidoctor/tabs' 28 | - '@springio/asciidoctor-extensions' 29 | - '@springio/asciidoctor-extensions/javadoc-extension' 30 | sourcemap: true 31 | urls: 32 | latest_version_segment: '' 33 | runtime: 34 | log: 35 | failure_level: warn 36 | format: pretty 37 | ui: 38 | bundle: 39 | url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.4.16/ui-bundle.zip 40 | snapshot: true 41 | -------------------------------------------------------------------------------- /src/main/antora/antora.yml: -------------------------------------------------------------------------------- 1 | name: data-couchbase 2 | version: true 3 | title: Spring Data Couchbase 4 | nav: 5 | - modules/ROOT/nav.adoc 6 | ext: 7 | collector: 8 | - run: 9 | command: ./mvnw validate process-resources -am -Pantora-process-resources 10 | local: true 11 | scan: 12 | dir: target/classes/ 13 | - run: 14 | command: ./mvnw package -Pdistribute 15 | local: true 16 | scan: 17 | dir: target/antora 18 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/nav.adoc: -------------------------------------------------------------------------------- 1 | * xref:index.adoc[Overview] 2 | ** xref:commons/upgrade.adoc[] 3 | ** xref:commons/migrating.adoc[] 4 | 5 | * xref:couchbase.adoc[] 6 | ** xref:couchbase/configuration.adoc[] 7 | ** xref:couchbase/entity.adoc[] 8 | ** xref:couchbase/autokeygeneration.adoc[] 9 | ** xref:couchbase/template.adoc[] 10 | ** xref:couchbase/transactions.adoc[] 11 | ** xref:couchbase/collections.adoc[] 12 | ** xref:couchbase/fieldlevelencryption.adoc[] 13 | ** xref:couchbase/ansijoins.adoc[] 14 | ** xref:couchbase/caching.adoc[] 15 | 16 | * xref:repositories.adoc[] 17 | ** xref:repositories/core-concepts.adoc[] 18 | ** xref:repositories/definition.adoc[] 19 | ** xref:couchbase/repository.adoc[] 20 | ** xref:couchbase/reactiverepository.adoc[] 21 | ** xref:repositories/create-instances.adoc[] 22 | ** xref:repositories/query-methods-details.adoc[] 23 | ** xref:repositories/projections.adoc[] 24 | ** xref:repositories/custom-implementations.adoc[] 25 | ** xref:repositories/core-domain-events.adoc[] 26 | ** xref:repositories/core-extensions.adoc[] 27 | ** xref:repositories/null-handling.adoc[] 28 | ** xref:repositories/query-keywords-reference.adoc[] 29 | ** xref:repositories/query-return-types-reference.adoc[] 30 | 31 | * xref:attachment$api/java/index.html[Javadoc,role=link-external,window=_blank] 32 | * https://github.com/spring-projects/spring-data-commons/wiki[Wiki,role=link-external,window=_blank] 33 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/commons/upgrade.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$upgrade.adoc[] 2 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/couchbase.adoc: -------------------------------------------------------------------------------- 1 | [[couchbase.core]] 2 | = Couchbase Support 3 | :page-section-summary-toc: 1 4 | 5 | Spring Data support for Couchbase contains a wide range of features: 6 | 7 | * Spring configuration support with xref:couchbase/configuration.adoc[Java-based `@Configuration` classes]. 8 | * The xref:couchbase/template.adoc[`CouchbaseTemplate` and `ReactiveCouchbaseTemplate`] helper classes that provide object mapping between Couchbase collections and POJOs. 9 | * xref:couchbase/template.adoc#exception-translation[Exception translation] into Spring's portable {spring-data-commons-docs-url}data-access.html#dao-exceptions[Data Access Exception Hierarchy]. 10 | * Feature rich object mapping integrated with _Spring's_ {spring-data-commons-docs-url}core.html#core-convert[Conversion Service]. 11 | * Annotation-based mapping metadata that is extensible to support other metadata formats. 12 | * Automatic implementation of xref:repositories.adoc[imperative and reactive `Repository` interfaces] including support for xref:repositories/custom-implementations.adoc[custom query methods]. 13 | 14 | For most data-oriented tasks, you can use the `[Reactive]CouchbaseTemplate` or the `Repository` support, both of which use the rich object-mapping functionality. 15 | Spring Data Couchbase uses consistent naming conventions on objects in various APIs to those found in the Couchbase Java SDK so that they are familiar and so that you can map your existing knowledge onto the Spring APIs. 16 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/index.adoc: -------------------------------------------------------------------------------- 1 | [[spring-data-couchbase-reference-documentation]] 2 | = Spring Data Couchbase 3 | :revnumber: {version} 4 | :revdate: {localdate} 5 | :feature-scroll: true 6 | 7 | _Spring Data Couchbase provides repository support for the Couchbase database. 8 | It eases development of applications with a consistent programming model that need to access Couchbase data sources._ 9 | 10 | [horizontal] 11 | xref:couchbase.adoc[Couchbase] :: Couchbase support and connectivity 12 | xref:repositories.adoc[Repositories] :: Couchbase Repositories 13 | xref:commons/migrating.adoc[Migration] :: Migration Guides 14 | https://github.com/spring-projects/spring-data-commons/wiki[Wiki] :: What's New, Upgrade Notes, Supported Versions, additional cross-version information. 15 | 16 | Michael Nitschinger, Oliver Gierke, Simon Basle, Michael Reiche, Tigran Babloyan 17 | 18 | (C) 2014-{copyright-year} The original author(s) 19 | 20 | Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically. 21 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/repositories.adoc: -------------------------------------------------------------------------------- 1 | [[couchbase.repositories]] 2 | = Repositories 3 | :page-section-summary-toc: 1 4 | 5 | This chapter explains the basic foundations of Spring Data repositories and Couchbase specifics. 6 | Before continuing to the Couchbase specifics, make sure you have a sound understanding of the basic concepts. 7 | 8 | The goal of the Spring Data repository abstraction is to significantly reduce the amount of boilerplate code required to implement data access layers for various persistence stores. 9 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/repositories/core-concepts.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$repositories/core-concepts.adoc[] 2 | 3 | [[couchbase.entity-persistence.state-detection-strategies]] 4 | include::{commons}@data-commons::page$is-new-state-detection.adoc[leveloffset=+1] 5 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/repositories/core-domain-events.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$repositories/core-domain-events.adoc[] 2 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/repositories/core-extensions.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$repositories/core-extensions.adoc[] 2 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/repositories/create-instances.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$repositories/create-instances.adoc[] 2 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/repositories/custom-implementations.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$repositories/custom-implementations.adoc[] 2 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/repositories/definition.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$repositories/definition.adoc[] 2 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/repositories/null-handling.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$repositories/null-handling.adoc[] 2 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/repositories/projections.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$repositories/projections.adoc[] 2 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/repositories/query-keywords-reference.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$repositories/query-keywords-reference.adoc[] 2 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/repositories/query-methods-details.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$repositories/query-methods-details.adoc[] 2 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/repositories/query-return-types-reference.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$repositories/query-return-types-reference.adoc[] 2 | -------------------------------------------------------------------------------- /src/main/antora/resources/antora-resources/antora.yml: -------------------------------------------------------------------------------- 1 | version: ${antora-component.version} 2 | prerelease: ${antora-component.prerelease} 3 | 4 | asciidoc: 5 | attributes: 6 | copyright-year: ${current.year} 7 | version: ${project.version} 8 | springversionshort: ${spring.short} 9 | springversion: ${spring} 10 | attribute-missing: 'warn' 11 | commons: ${springdata.commons.docs} 12 | include-xml-namespaces: false 13 | spring-data-commons-docs-url: https://docs.spring.io/spring-data/commons/reference 14 | spring-data-commons-javadoc-base: https://docs.spring.io/spring-data/commons/docs/${springdata.commons}/api/ 15 | spring-framework-docs: https://docs.spring.io/spring-framework/reference/{springversionshort} 16 | spring-framework-javadoc: https://docs.spring.io/spring-framework/docs/${spring}/javadoc-api 17 | springhateoasversion: ${spring-hateoas} 18 | releasetrainversion: ${releasetrain} 19 | store: Couchbase 20 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/config/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This package contains all classes needed for specific configuration of Spring Data Couchbase. 3 | */ 4 | package org.springframework.data.couchbase.config; 5 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/CollectionCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.core; 18 | 19 | import java.util.concurrent.ExecutionException; 20 | import java.util.concurrent.TimeoutException; 21 | 22 | /** 23 | * Defines the callback which will be wrapped and executed on a bucket. 24 | * 25 | * @author Michael Nitschinger 26 | */ 27 | public interface CollectionCallback { 28 | 29 | /** 30 | * The enclosed body will be executed on the connected bucket. 31 | * 32 | * @return the result of the enclosed execution. 33 | * @throws TimeoutException if the enclosed operation timed out. 34 | * @throws ExecutionException if the result could not be retrieved because of a thrown exception before. 35 | * @throws InterruptedException if the enclosed operation was interrupted. 36 | */ 37 | T doInCollection() throws TimeoutException, ExecutionException, InterruptedException; 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/CouchbaseDataIntegrityViolationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.core; 18 | 19 | import org.springframework.dao.DataIntegrityViolationException; 20 | 21 | /** 22 | * A Couchbase specific integrity violation exception, thrown as a result of failing db operations. 23 | * 24 | * @author Michael Nitschinger 25 | */ 26 | public class CouchbaseDataIntegrityViolationException extends DataIntegrityViolationException { 27 | 28 | private static final long serialVersionUID = -3724991479213025850L; 29 | 30 | public CouchbaseDataIntegrityViolationException(String msg) { 31 | super(msg); 32 | } 33 | 34 | public CouchbaseDataIntegrityViolationException(String msg, Throwable cause) { 35 | super(msg, cause); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/CouchbaseQueryExecutionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.core; 18 | 19 | import org.springframework.dao.DataRetrievalFailureException; 20 | 21 | /** 22 | * An {@link DataRetrievalFailureException} that denotes an error during a query (N1QL). 23 | */ 24 | public class CouchbaseQueryExecutionException extends DataRetrievalFailureException { 25 | 26 | public CouchbaseQueryExecutionException(String msg) { 27 | super(msg); 28 | } 29 | 30 | public CouchbaseQueryExecutionException(String msg, Throwable cause) { 31 | super(msg, cause); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/FluentCouchbaseOperations.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.core; 18 | 19 | /** 20 | * The fluent couchbase operations combines all different possible operations for simplicity reasons. 21 | */ 22 | public interface FluentCouchbaseOperations extends ExecutableUpsertByIdOperation, ExecutableInsertByIdOperation, 23 | ExecutableReplaceByIdOperation, ExecutableFindByIdOperation, ExecutableFindFromReplicasByIdOperation, 24 | ExecutableFindByQueryOperation, ExecutableFindByAnalyticsOperation, ExecutableExistsByIdOperation, 25 | ExecutableRemoveByIdOperation, ExecutableRemoveByQueryOperation, ExecutableMutateInByIdOperation, 26 | ExecutableRangeScanOperation {} 27 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/ReactiveFluentCouchbaseOperations.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.core; 18 | 19 | /** 20 | * The fluent couchbase operations combines all different possible operations for simplicity reasons. 21 | */ 22 | public interface ReactiveFluentCouchbaseOperations extends ReactiveUpsertByIdOperation, ReactiveInsertByIdOperation, 23 | ReactiveReplaceByIdOperation, ReactiveFindByIdOperation, ReactiveExistsByIdOperation, 24 | ReactiveFindByAnalyticsOperation, ReactiveFindFromReplicasByIdOperation, ReactiveFindByQueryOperation, 25 | ReactiveRemoveByIdOperation, ReactiveRemoveByQueryOperation, ReactiveMutateInByIdOperation, 26 | ReactiveRangeScanOperation {} 27 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/convert/ConverterHasNoConversion.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.core.convert; 18 | 19 | /** 20 | * PropertyValueConverter throws this when cannot convert the property. The caller should catch this and resort to other 21 | * means for creating the value. 22 | * 23 | * @author Michael Reiche 24 | */ 25 | public class ConverterHasNoConversion extends RuntimeException {} 26 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/convert/CouchbaseTypeMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.core.convert; 18 | 19 | import org.springframework.data.convert.TypeMapper; 20 | import org.springframework.data.couchbase.core.mapping.CouchbaseDocument; 21 | import org.springframework.data.mapping.Alias; 22 | import org.springframework.data.util.TypeInformation; 23 | 24 | /** 25 | * Marker interface for the TypeMapper. 26 | * 27 | * @author Michael Nitschinger 28 | * @author Michael Reiche 29 | */ 30 | public interface CouchbaseTypeMapper extends TypeMapper { 31 | 32 | String getTypeKey(); 33 | 34 | Alias getTypeAlias(TypeInformation info); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/convert/CouchbaseWriter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.core.convert; 18 | 19 | import org.springframework.data.convert.EntityWriter; 20 | 21 | /** 22 | * Marker interface for the Couchbase {@link EntityWriter}. 23 | * 24 | * @author Michael Nitschinger 25 | */ 26 | public interface CouchbaseWriter extends EntityWriter {} 27 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/convert/TypeAwareTypeInformationMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.convert; 17 | 18 | import org.springframework.data.annotation.TypeAlias; 19 | import org.springframework.data.convert.SimpleTypeInformationMapper; 20 | import org.springframework.data.mapping.Alias; 21 | import org.springframework.data.util.TypeInformation; 22 | 23 | /** 24 | * TypeAwareTypeInformationMapper - leverages @TypeAlias 25 | * 26 | * @author Michael Reiche 27 | */ 28 | public class TypeAwareTypeInformationMapper extends SimpleTypeInformationMapper { 29 | 30 | @Override 31 | public Alias createAliasFor(TypeInformation type) { 32 | TypeAlias[] typeAlias = type.getType().getAnnotationsByType(TypeAlias.class); 33 | 34 | if (typeAlias.length == 1) { 35 | return Alias.of(typeAlias[0].value()); 36 | } 37 | 38 | return super.createAliasFor(type); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/convert/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This package contains classes used for entity-to-JSON conversions, type mapping and writing. 3 | */ 4 | package org.springframework.data.couchbase.core.convert; 5 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/convert/translation/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This package contains a service interface to translate entities to a Couchbase storable format, and its 3 | * implementations. 4 | */ 5 | package org.springframework.data.couchbase.core.convert.translation; 6 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/index/CompositeQueryIndex.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.index; 17 | 18 | import java.lang.annotation.Documented; 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Repeatable; 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.RetentionPolicy; 23 | import java.lang.annotation.Target; 24 | 25 | @Target({ ElementType.TYPE }) 26 | @Documented 27 | @Repeatable(CompositeQueryIndexes.class) 28 | @Retention(RetentionPolicy.RUNTIME) 29 | public @interface CompositeQueryIndex { 30 | 31 | String[] fields(); 32 | 33 | String name() default ""; 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/index/CompositeQueryIndexes.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.index; 17 | 18 | import java.lang.annotation.Documented; 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | @Target({ ElementType.TYPE }) 25 | @Documented 26 | @Retention(RetentionPolicy.RUNTIME) 27 | public @interface CompositeQueryIndexes { 28 | 29 | CompositeQueryIndex[] value(); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/index/IndexDefinition.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.index; 17 | 18 | import java.util.List; 19 | 20 | /** 21 | * @author Jon Brisbin 22 | * @author Christoph Strobl 23 | * @author Mark Paluch 24 | */ 25 | public interface IndexDefinition { 26 | 27 | String getIndexName(); 28 | 29 | List getIndexFields(); 30 | 31 | String getIndexPredicate(); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/index/QueryIndexDirection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.index; 17 | 18 | public enum QueryIndexDirection { 19 | ASCENDING, DESCENDING 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/index/QueryIndexed.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.index; 17 | 18 | import java.lang.annotation.ElementType; 19 | import java.lang.annotation.Retention; 20 | import java.lang.annotation.RetentionPolicy; 21 | import java.lang.annotation.Target; 22 | 23 | /** 24 | * Mark a field to be indexed by the query engine. 25 | */ 26 | @Target({ ElementType.ANNOTATION_TYPE, ElementType.FIELD }) 27 | @Retention(RetentionPolicy.RUNTIME) 28 | public @interface QueryIndexed { 29 | 30 | QueryIndexDirection direction() default QueryIndexDirection.ASCENDING; 31 | 32 | String name() default ""; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/mapping/CouchbasePersistentProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.core.mapping; 18 | 19 | import org.springframework.data.mapping.PersistentProperty; 20 | 21 | /** 22 | * Represents a property part of an entity that needs to be persisted. 23 | * 24 | * @author Michael Nitschinger 25 | */ 26 | public interface CouchbasePersistentProperty extends PersistentProperty { 27 | 28 | /** 29 | * Returns the field name of the property. 30 | *

31 | * The field name can be different from the actual property name by using a custom annotation. 32 | */ 33 | String getFieldName(); 34 | 35 | boolean isExpirationProperty(); 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/mapping/CouchbaseStorable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.core.mapping; 18 | 19 | /** 20 | * Marker Interface to identify either a {@link CouchbaseDocument} or a {@link CouchbaseList}. 21 | *

22 | * This interface will be extended in the future to refactor the needed infrastructure into the common interface. 23 | * 24 | * @author Michael Nitschinger 25 | */ 26 | public interface CouchbaseStorable {} 27 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/mapping/Durability.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.couchbase.core.mapping; 2 | 3 | import com.couchbase.client.core.msg.kv.DurabilityLevel; 4 | import org.springframework.data.annotation.Persistent; 5 | 6 | import java.lang.annotation.*; 7 | 8 | /** 9 | * Durability annotation 10 | * 11 | * @author Tigran Babloyan 12 | */ 13 | @Persistent 14 | @Inherited 15 | @Retention(RetentionPolicy.RUNTIME) 16 | @Target({ ElementType.TYPE, ElementType.ANNOTATION_TYPE }) 17 | public @interface Durability { 18 | /** 19 | * The optional durabilityLevel for all mutating operations, allows the application to wait until this replication 20 | * (or persistence) is successful before proceeding 21 | */ 22 | DurabilityLevel durabilityLevel() default DurabilityLevel.NONE; 23 | 24 | /** 25 | * Same as {@link #durabilityLevel()} but allows the actual value to be set using standard Spring property sources mechanism. 26 | * Only one might be set at the same time: either {@link #durabilityLevel()} or {@link #durabilityExpression()}.
27 | * Syntax is the same as for {@link org.springframework.core.env.Environment#resolveRequiredPlaceholders(String)}. 28 | *
29 | * SpEL is NOT supported. 30 | */ 31 | String durabilityExpression() default ""; 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/mapping/Expiration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.mapping; 17 | 18 | import java.lang.annotation.Documented; 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * Annotation to define a field to be substituted for META().expiration in a query 26 | * 27 | * @author Michael Reiche 28 | */ 29 | @Documented 30 | @Retention(RetentionPolicy.RUNTIME) 31 | @Target({ ElementType.FIELD, ElementType.ANNOTATION_TYPE }) 32 | public @interface Expiration { 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/mapping/event/AfterDeleteEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.core.mapping.event; 18 | 19 | /** 20 | * @author Michael Nitschinger 21 | */ 22 | public class AfterDeleteEvent extends CouchbaseMappingEvent { 23 | 24 | public AfterDeleteEvent(E source) { 25 | super(source, null); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/mapping/event/AfterSaveEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.core.mapping.event; 18 | 19 | import org.springframework.data.couchbase.core.mapping.CouchbaseDocument; 20 | 21 | /** 22 | * @author Michael Nitschinger 23 | */ 24 | public class AfterSaveEvent extends CouchbaseMappingEvent { 25 | 26 | public AfterSaveEvent(E source, CouchbaseDocument document) { 27 | super(source, document); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/mapping/event/BeforeConvertEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.core.mapping.event; 18 | 19 | /** 20 | * @author Michael Nitschinger 21 | */ 22 | public class BeforeConvertEvent extends CouchbaseMappingEvent { 23 | 24 | public BeforeConvertEvent(E source) { 25 | super(source, null); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/mapping/event/BeforeDeleteEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.core.mapping.event; 18 | 19 | /** 20 | * @author Michael Nitschinger 21 | */ 22 | public class BeforeDeleteEvent extends CouchbaseMappingEvent { 23 | 24 | public BeforeDeleteEvent(E source) { 25 | super(source, null); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/mapping/event/BeforeSaveEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.core.mapping.event; 18 | 19 | import org.springframework.data.couchbase.core.mapping.CouchbaseDocument; 20 | 21 | /** 22 | * @author Michael Nitschinger 23 | */ 24 | public class BeforeSaveEvent extends CouchbaseMappingEvent { 25 | 26 | public BeforeSaveEvent(E source, CouchbaseDocument document) { 27 | super(source, document); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/mapping/event/CouchbaseMappingEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.core.mapping.event; 18 | 19 | import org.springframework.context.ApplicationEvent; 20 | import org.springframework.data.couchbase.core.mapping.CouchbaseDocument; 21 | 22 | /** 23 | * A mapping event. 24 | * 25 | * @author Michael Nitschinger 26 | */ 27 | public class CouchbaseMappingEvent extends ApplicationEvent { 28 | 29 | private final CouchbaseDocument document; 30 | 31 | public CouchbaseMappingEvent(T source, CouchbaseDocument document) { 32 | super(source); 33 | this.document = document; 34 | } 35 | 36 | public CouchbaseDocument getDocument() { 37 | return document; 38 | } 39 | 40 | @SuppressWarnings("unchecked") 41 | @Override 42 | public T getSource() { 43 | return (T) super.getSource(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/mapping/event/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This package contains various events that are emitted during the lifecycle of a Spring Data entity. 3 | */ 4 | package org.springframework.data.couchbase.core.mapping.event; 5 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/mapping/id/GenerationStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.core.mapping.id; 18 | 19 | /** 20 | * Keys generation strategy 21 | * 22 | * @author Subhashni Balakrishnan 23 | */ 24 | public enum GenerationStrategy { 25 | /** 26 | * Constructs key from the entity attributes using the supplied id, prefix, suffix 27 | */ 28 | USE_ATTRIBUTES, 29 | 30 | /** 31 | * Uses an uuid generator 32 | */ 33 | UNIQUE 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/mapping/id/IdAttribute.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.core.mapping.id; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Inherited; 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.RetentionPolicy; 23 | import java.lang.annotation.Target; 24 | 25 | /** 26 | * This annotation is targeted at building the document id using the attribute value. 27 | * 28 | * @author Subhashni Balakrishnan 29 | */ 30 | @Inherited 31 | @Target({ ElementType.FIELD }) 32 | @Retention(RetentionPolicy.RUNTIME) 33 | public @interface IdAttribute { 34 | int order() default 0; 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/mapping/id/IdPrefix.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.core.mapping.id; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Inherited; 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.RetentionPolicy; 23 | import java.lang.annotation.Target; 24 | 25 | /** 26 | * This annotation is targeted at building the document id using the value as a part of a prefix build. The order 27 | * determines in way which the specified prefix value is used in building the prefix. 28 | * 29 | * @author Subhashni Balakrishnan 30 | */ 31 | @Inherited 32 | @Target({ ElementType.FIELD }) 33 | @Retention(RetentionPolicy.RUNTIME) 34 | public @interface IdPrefix { 35 | int order() default 0; 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/mapping/id/IdSuffix.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.core.mapping.id; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Inherited; 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.RetentionPolicy; 23 | import java.lang.annotation.Target; 24 | 25 | /** 26 | * This annotation is targeted at building the document id using the value as a part of a suffix build. The order 27 | * determines in way which the specified suffix value is used in building the suffix. 28 | * 29 | * @author Subhashni Balakrishnan 30 | */ 31 | @Inherited 32 | @Target({ ElementType.FIELD }) 33 | @Retention(RetentionPolicy.RUNTIME) 34 | public @interface IdSuffix { 35 | int order() default 0; 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/mapping/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This package contains interfaces and annotations relative to object-json mapping and the notion of a Couchbase 3 | * Storable. 4 | */ 5 | package org.springframework.data.couchbase.core.mapping; 6 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This package contains the specific implementations and core classes for Spring Data Couchbase internals. It also 3 | * contains Couchbase implementation to support the Spring Data template abstraction.
4 | * The template provides lower level access to the underlying database and also serves as the foundation for 5 | * repositories. Any time a repository is too high-level for you needs chances are good that the templates will serve 6 | * you well. 7 | */ 8 | package org.springframework.data.couchbase.core; 9 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/query/FetchType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.core.query; 18 | 19 | /** 20 | * Setting for specify when to fetch the associated entities 21 | * 22 | * @author Subhashni Balakrishnan 23 | */ 24 | public enum FetchType { 25 | /** 26 | * Immediately fetch the associated entities 27 | */ 28 | IMMEDIATE, 29 | 30 | /** 31 | * Lazily fetch the associated entities on access, the fetch happens only once 32 | */ 33 | LAZY 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/query/HashSide.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.core.query; 18 | 19 | /** 20 | * Hash side to specify hash join. Here based on probe or build, the entity will be used to query or build the hash 21 | * table. The smaller data set side should be used to build to fit in memory. 22 | * 23 | * @author Subhashni Balakrishnan 24 | */ 25 | public enum HashSide { 26 | /** 27 | * Hash join will not be used 28 | */ 29 | NONE("none"), 30 | 31 | /** 32 | * Associated entity will be on the probe side of the hash table 33 | */ 34 | PROBE("probe"), 35 | 36 | /** 37 | * Associated entity will be used to build the hash table for faster lookup 38 | */ 39 | BUILD("build"); 40 | 41 | private final String value; 42 | 43 | HashSide(String value) { 44 | this.value = value; 45 | } 46 | 47 | public String getValue() { 48 | return this.value; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/query/N1qlPrimaryIndexed.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.core.query; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | import org.springframework.data.couchbase.repository.CouchbaseRepository; 25 | 26 | /** 27 | * This annotation is targeted at {@link CouchbaseRepository Repository} interfaces, indicating that the framework 28 | * should ensure a N1QL Primary Index is present on the repository's associated bucket when the repository is created. 29 | * 30 | * @author Simon Baslé 31 | */ 32 | @Deprecated 33 | @Target({ElementType.TYPE}) 34 | @Retention(RetentionPolicy.RUNTIME) 35 | public @interface N1qlPrimaryIndexed { 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/query/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This package contains annotations and classes relative to querying with Couchbase (whether through views or N1QL) and 3 | * the associated indexes. 4 | */ 5 | package org.springframework.data.couchbase.core.query; 6 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/AnyId.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | import java.util.Collection; 19 | 20 | /** 21 | * A common interface for those that support one(T), all(Collection<T>) 22 | * 23 | * @author Michael Reiche 24 | * @param - the entity class 25 | */ 26 | public interface AnyId { 27 | 28 | T any(String id); 29 | 30 | Collection any(Collection ids); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/AnyIdReactive.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | import reactor.core.publisher.Flux; 19 | import reactor.core.publisher.Mono; 20 | 21 | import java.util.Collection; 22 | 23 | /** 24 | * A common interface for those that support one(T), all(Collection<T%gt;) 25 | * 26 | * @author Michael Reiche 27 | * @param - the entity class 28 | */ 29 | 30 | public interface AnyIdReactive { 31 | Mono any(String id); 32 | 33 | Flux any(Collection ids); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/ConsistentWith.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | import com.couchbase.client.java.kv.MutationState; 19 | 20 | /** 21 | * A common interface for those that support withOptions() 22 | * 23 | * @author Michael Reiche 24 | * @param - the entity class 25 | */ 26 | public interface ConsistentWith { 27 | Object consistentWith(MutationState mutationState); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/InCollection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | /** 19 | * A common interface for all of Insert, Replace, Upsert that take Collection 20 | * 21 | * @author Michael Reiche 22 | * @param - the entity class 23 | */ 24 | public interface InCollection { 25 | /** 26 | * Specify collection 27 | * 28 | * @param collection - collection name 29 | */ 30 | Object inCollection(String collection); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/InScope.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | /** 19 | * A common interface for all of Insert, Replace, Upsert that take options 20 | * 21 | * @author Michael Reiche 22 | * @param - the entity class 23 | */ 24 | public interface InScope { 25 | /** 26 | * Specify scope 27 | * 28 | * @param scope - scope name 29 | */ 30 | Object inScope(String scope); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/OneAndAll.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | import java.util.Collection; 19 | import java.util.Optional; 20 | import java.util.stream.Stream; 21 | 22 | /** 23 | * A common interface for those that support one(T), all(Collection<T>) 24 | * 25 | * @author Michael Reiche 26 | * 27 | * @param - the entity class 28 | */ 29 | public interface OneAndAll { 30 | 31 | Optional one(); 32 | 33 | Optional first(); 34 | 35 | T oneValue(); 36 | 37 | T firstValue(); 38 | 39 | Collection all(); 40 | 41 | Stream stream(); 42 | 43 | long count(); 44 | 45 | boolean exists(); 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/OneAndAllEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | import java.util.Collection; 19 | 20 | /** 21 | * A common interface for those that support one(T), all(Collection<T>) 22 | * 23 | * @author Michael Reiche 24 | * 25 | * @param - the entity class 26 | */ 27 | public interface OneAndAllEntity { 28 | 29 | T one(T object); 30 | 31 | Collection all(Collection objects); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/OneAndAllEntityReactive.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | import reactor.core.publisher.Flux; 19 | import reactor.core.publisher.Mono; 20 | 21 | import java.util.Collection; 22 | 23 | /** 24 | * A common interface for those that support one(T), all(Collection<T>) 25 | * 26 | * @author Michael Reiche 27 | * @param - the entity class 28 | */ 29 | 30 | public interface OneAndAllEntityReactive { 31 | Mono one(T object); 32 | 33 | Flux all(Collection objects); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/OneAndAllExists.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | import java.util.Collection; 19 | import java.util.Map; 20 | import java.util.Optional; 21 | import java.util.stream.Stream; 22 | 23 | /** 24 | * A common interface for those that support one(T), all(Collection<T>) 25 | * 26 | * @author Michael Reiche 27 | */ 28 | public interface OneAndAllExists { 29 | boolean one(String id); 30 | 31 | Map all(Collection ids); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/OneAndAllExistsReactive.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | import reactor.core.publisher.Mono; 19 | 20 | import java.util.Collection; 21 | import java.util.Map; 22 | 23 | /** 24 | * A common interface for those that support one(T), all(Collection<T>) 25 | * 26 | * @author Michael Reiche 27 | * 28 | */ 29 | public interface OneAndAllExistsReactive { 30 | Mono one(String id); 31 | 32 | Mono> all(Collection ids); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/OneAndAllId.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | import java.util.Collection; 19 | 20 | /** 21 | * A common interface for those that support one(String), all(Collection<String>) 22 | * 23 | * @author Michael Reiche 24 | * 25 | * @param - the entity class 26 | */ 27 | public interface OneAndAllId { 28 | 29 | T one(String id); 30 | 31 | Collection all(Collection ids); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/OneAndAllIdReactive.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | import reactor.core.publisher.Flux; 19 | import reactor.core.publisher.Mono; 20 | 21 | import java.util.Collection; 22 | 23 | /** 24 | * A common interface for those that support one(String), all(Collection<String>) 25 | * 26 | * @author Michael Reiche 27 | * @param - the entity class 28 | */ 29 | 30 | public interface OneAndAllIdReactive { 31 | Mono one(Object id); 32 | 33 | Flux all(Collection ids); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/OneAndAllReactive.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | import reactor.core.publisher.Flux; 19 | import reactor.core.publisher.Mono; 20 | 21 | import java.util.Collection; 22 | import java.util.Optional; 23 | import java.util.stream.Stream; 24 | 25 | /** 26 | * A common interface for those that support one(T), all(Collection<T>) 27 | * 28 | * @author Michael Reiche 29 | * @param - the entity class 30 | */ 31 | 32 | public interface OneAndAllReactive { 33 | Mono one(); 34 | 35 | Mono first(); 36 | 37 | Flux all(); 38 | 39 | Mono count(); 40 | 41 | Mono exists(); 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/WithAnalyticsConsistency.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | import com.couchbase.client.java.analytics.AnalyticsScanConsistency; 19 | 20 | /** 21 | * Interface for operations that take AnalyticsScanConsistency 22 | * 23 | * @author Michael Reiche 24 | * @param - the entity class 25 | */ 26 | public interface WithAnalyticsConsistency { 27 | /** 28 | * Specify scan consistency 29 | * 30 | * @param scanConsistency - scan consistency 31 | */ 32 | Object withConsistency(AnalyticsScanConsistency scanConsistency); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/WithAnalyticsOptions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | import com.couchbase.client.java.analytics.AnalyticsOptions; 19 | 20 | /** 21 | * Interface for operations that take AnalyticsOptions 22 | * 23 | * @author Michael Reiche 24 | * @param - the entity class 25 | */ 26 | public interface WithAnalyticsOptions { 27 | /** 28 | * Specify analytics options 29 | * 30 | * @param options - analytics options 31 | */ 32 | Object withOptions(AnalyticsOptions options); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/WithAnalyticsQuery.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | import org.springframework.data.couchbase.core.query.AnalyticsQuery; 19 | 20 | /** 21 | * Interface for operations that take AnalyticsQuery 22 | * 23 | * @author Michael Reiche 24 | * @param - the entity class 25 | */ 26 | public interface WithAnalyticsQuery { 27 | /** 28 | * Specify query 29 | * 30 | * @param query - query 31 | */ 32 | Object matching(AnalyticsQuery query); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/WithBatchByteLimit.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | /** 19 | * A common interface for those that support withBatchByteLimit() 20 | * 21 | * @author Michael Reiche 22 | * @param - the entity class 23 | */ 24 | public interface WithBatchByteLimit { 25 | Object withBatchByteLimit(Integer batchByteLimit); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/WithBatchItemLimit.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | /** 19 | * A common interface for those that support withBatchItemLimit() 20 | * 21 | * @author Michael Reiche 22 | * @param - the entity class 23 | */ 24 | public interface WithBatchItemLimit { 25 | Object withBatchItemLimit(Integer batchItemLimit); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/WithConsistency.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | import com.couchbase.client.java.query.QueryScanConsistency; 19 | 20 | /** 21 | * A common interface operations that take scan consistency 22 | * 23 | * @author Michael Reiche 24 | * @param - the entity class 25 | */ 26 | public interface WithConsistency { 27 | /** 28 | * Specify scan consistency 29 | * 30 | * @param scanConsistency - scan consistency 31 | */ 32 | Object withConsistency(QueryScanConsistency scanConsistency); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/WithDistinct.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | /** 19 | * Interface for operations that take distinct fields 20 | * 21 | * @author Michael Reiche 22 | * @param - the entity class 23 | */ 24 | public interface WithDistinct { 25 | /** 26 | * Specify distinct field names 27 | * 28 | * @param distinctFields - distinct fields 29 | */ 30 | Object distinct(String[] distinctFields); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/WithDurability.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | import com.couchbase.client.core.msg.kv.DurabilityLevel; 19 | import com.couchbase.client.java.kv.PersistTo; 20 | import com.couchbase.client.java.kv.ReplicateTo; 21 | 22 | /** 23 | * A common interface for all of Insert, Replace, Upsert that take Durability 24 | * 25 | * @author Michael Reiche 26 | * @param - the entity class 27 | */ 28 | public interface WithDurability { 29 | Object withDurability(DurabilityLevel durabilityLevel); 30 | 31 | Object withDurability(PersistTo persistTo, ReplicateTo replicateTo); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/WithExistsOptions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | import com.couchbase.client.java.kv.ExistsOptions; 19 | 20 | /** 21 | * Interface for operations that take ExistsOptions 22 | * 23 | * @author Michael Reiche 24 | * @param - the entity class 25 | */ 26 | public interface WithExistsOptions { 27 | /** 28 | * Specify options 29 | * 30 | * @param options - exists options 31 | */ 32 | Object withOptions(ExistsOptions options); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/WithExpiry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | import java.time.Duration; 19 | 20 | /** 21 | * A common interface for those that support withExpiry() 22 | * 23 | * @author Michael Reiche 24 | * @param - the entity class 25 | */ 26 | public interface WithExpiry { 27 | Object withExpiry(Duration expiry); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/WithGetAnyReplicaOptions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | import com.couchbase.client.java.kv.GetAnyReplicaOptions; 19 | 20 | /** 21 | * A interface for operations that take GetAnyReplicaOptions 22 | * 23 | * @author Michael Reiche 24 | * @param - the entity class 25 | */ 26 | public interface WithGetAnyReplicaOptions { 27 | /** 28 | * Specify options 29 | * 30 | * @param options - GetAnyReplicaOptions 31 | */ 32 | Object withOptions(GetAnyReplicaOptions options); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/WithGetOptions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | import com.couchbase.client.java.kv.GetOptions; 19 | 20 | /** 21 | * Interface for operations that take GetOptions 22 | * 23 | * @author Michael Reiche 24 | * @param - the entity class 25 | */ 26 | public interface WithGetOptions { 27 | /** 28 | * Specify options 29 | * 30 | * @param options - get options 31 | */ 32 | Object withOptions(GetOptions options); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/WithInsertOptions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | import com.couchbase.client.java.kv.InsertOptions; 19 | 20 | /** 21 | * Interface for operations take insert options 22 | * 23 | * @author Michael Reiche 24 | * @param - the entity class 25 | */ 26 | public interface WithInsertOptions { 27 | /** 28 | * Specify options 29 | * 30 | * @param options - insert options 31 | */ 32 | Object withOptions(InsertOptions options); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/WithLock.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | import java.time.Duration; 19 | 20 | /** 21 | * A common interface for those that support withLock() 22 | * 23 | * @author Tigran Babloyan 24 | * @param - the entity class 25 | */ 26 | public interface WithLock { 27 | Object withLock(Duration lockDuration); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/WithMutateInOptions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | import com.couchbase.client.java.kv.MutateInOptions; 19 | 20 | /** 21 | * A common interface for all of Insert, Replace, Upsert mutations that take options. 22 | * 23 | * @author Tigran Babloyan 24 | * @param - the entity class 25 | */ 26 | public interface WithMutateInOptions { 27 | /** 28 | * Specify options 29 | * 30 | * @param options The mutate options to use. 31 | */ 32 | Object withOptions(MutateInOptions options); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/WithMutateInPaths.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | /** 19 | * A common interface for all of Insert, Replace, Upsert and Remove mutations that take options. 20 | * 21 | * @author Tigran Babloyan 22 | * @param - the entity class 23 | */ 24 | public interface WithMutateInPaths { 25 | Object withRemovePaths(final String... removePaths); 26 | 27 | Object withInsertPaths(final String... insertPaths); 28 | 29 | Object withReplacePaths(final String... replacePaths); 30 | 31 | Object withUpsertPaths(final String... upsertPaths); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/WithProjecting.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | /** 19 | * A common interface for all of Insert, Replace, Upsert that take Projection 20 | * 21 | * @author Michael Reiche 22 | * @param - the entity class 23 | */ 24 | public interface WithProjecting { 25 | Object project(String[] fields); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/WithProjection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | /** 19 | * A common interface for all of Insert, Replace, Upsert that take Projection 20 | * 21 | * @author Michael Reiche 22 | * @param - the entity class 23 | */ 24 | public interface WithProjection { 25 | Object as(Class returnType); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/WithProjectionId.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | /** 19 | * A common interface for those that support project() 20 | * 21 | * @author Michael Reiche 22 | * @param - the entity class 23 | */ 24 | public interface WithProjectionId { 25 | Object project(String[] fields); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/WithQuery.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | import org.springframework.data.couchbase.core.query.Query; 19 | import org.springframework.data.couchbase.core.query.QueryCriteria; 20 | import org.springframework.data.couchbase.core.query.QueryCriteriaDefinition; 21 | 22 | /** 23 | * A common interface for all of Insert, Replace, Upsert that take Query 24 | * 25 | * @author Michael Reiche 26 | * @param - the entity class 27 | */ 28 | public interface WithQuery { 29 | Object matching(Query query); 30 | 31 | Object matching(QueryCriteriaDefinition queryCriteria); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/WithQueryOptions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | import com.couchbase.client.java.query.QueryOptions; 19 | 20 | /** 21 | * A common interface for all of Insert, Replace, Upsert that take options 22 | * 23 | * @author Michael Reiche 24 | * @param - the entity class 25 | */ 26 | public interface WithQueryOptions { 27 | /** 28 | * Specify options 29 | * 30 | * @param options - query options 31 | */ 32 | Object withOptions(QueryOptions options); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/WithRemoveOptions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | import com.couchbase.client.java.kv.RemoveOptions; 19 | 20 | /** 21 | * A common interface for all of Insert, Replace, Upsert that take options 22 | * 23 | * @author Michael Reiche 24 | * @param - the entity class 25 | */ 26 | public interface WithRemoveOptions { 27 | Object withOptions(RemoveOptions options); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/WithReplaceOptions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | import com.couchbase.client.java.kv.ReplaceOptions; 19 | 20 | /** 21 | * A common interface for all of Insert, Replace, Upsert that take options 22 | * 23 | * @author Michael Reiche 24 | * @param - the entity class 25 | */ 26 | public interface WithReplaceOptions { 27 | Object withOptions(ReplaceOptions options); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/WithScanOptions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | import com.couchbase.client.java.kv.ScanOptions; 19 | 20 | /** 21 | * A common interface for those that support withOptions() 22 | * 23 | * @author Michael Reiche 24 | * @param - the entity class 25 | */ 26 | public interface WithScanOptions { 27 | Object withOptions(ScanOptions expiry); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/WithScanSort.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | /** 19 | * A common interface for those that support withOptions() 20 | * 21 | * @author Michael Reiche 22 | * @param - the entity class 23 | */ 24 | public interface WithScanSort { 25 | Object withSort(Object expiry); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/core/support/WithUpsertOptions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.core.support; 17 | 18 | import com.couchbase.client.java.kv.UpsertOptions; 19 | 20 | /** 21 | * A common interface for all of Insert, Replace, Upsert that take options 22 | * 23 | * @author Michael Reiche 24 | * @param - the entity class 25 | */ 26 | public interface WithUpsertOptions { 27 | Object withOptions(UpsertOptions options); 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/repository/config/CouchbaseRepositoriesRegistrar.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.repository.config; 18 | 19 | import java.lang.annotation.Annotation; 20 | 21 | import org.springframework.data.repository.config.RepositoryBeanDefinitionRegistrarSupport; 22 | import org.springframework.data.repository.config.RepositoryConfigurationExtension; 23 | 24 | /** 25 | * @author Michael Nitschinger 26 | */ 27 | public class CouchbaseRepositoriesRegistrar extends RepositoryBeanDefinitionRegistrarSupport { 28 | 29 | @Override 30 | protected Class getAnnotation() { 31 | return EnableCouchbaseRepositories.class; 32 | } 33 | 34 | @Override 35 | protected RepositoryConfigurationExtension getExtension() { 36 | return new CouchbaseRepositoryConfigurationExtension(); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/repository/config/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This package contains the support classes to configure repositories in the context of Couchbase. 3 | */ 4 | package org.springframework.data.couchbase.repository.config; 5 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/repository/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains the Couchbase interfaces to support the Spring Data repository abstraction.
19 | * The goal of Spring Data repository abstraction is to significantly reduce the amount of boilerplate code required to 20 | * implement data access layers for various persistence stores. 21 | */ 22 | package org.springframework.data.couchbase.repository; 23 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/repository/query/CouchbaseEntityInformation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.repository.query; 17 | 18 | import org.springframework.data.repository.core.EntityInformation; 19 | 20 | /** 21 | * Marker interface for the Couchbase Entity Information. 22 | * 23 | * @author Michael Nitschinger 24 | * @author Oliver Gierke 25 | */ 26 | public interface CouchbaseEntityInformation extends EntityInformation {} 27 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/repository/query/CountFragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.repository.query; 18 | 19 | /** 20 | * An utility entity that allows to extract total row count out of a COUNT(*) N1QL query. 21 | *

22 | * The query should use the COUNT_ALIAS, eg.: SELECT COUNT(*) AS count FROM default; 23 | *

24 | * This ensures that the framework will be able to map the JSON result to this {@link CountFragment} class so that it 25 | * can be used. 26 | */ 27 | public class CountFragment { 28 | 29 | /** 30 | * Use this alias for the COUNT part of a N1QL query so that the framework can extract the count result. Eg.: "SELECT 31 | * A.COUNT(*) AS " + COUNT_ALIAS + " FROM A"; 32 | */ 33 | public static final String COUNT_ALIAS = "count"; 34 | 35 | /** 36 | * The value for a COUNT that used {@link #COUNT_ALIAS} as an alias. 37 | */ 38 | public long count; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/repository/query/PartTreeN1qlQueryCreator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.repository.query; 18 | 19 | import com.couchbase.client.java.json.JsonValue; 20 | 21 | /** 22 | * A Part Tree Query creator for Couchbase 23 | * 24 | * @author Subhashni Balakrishnan 25 | */ 26 | public interface PartTreeN1qlQueryCreator { 27 | 28 | /** Get the named placeholder values */ 29 | JsonValue getPlaceHolderValues(); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/repository/query/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This package contains classes related to query derivation and concrete ways of querying couchbase. 3 | */ 4 | package org.springframework.data.couchbase.repository.query; 5 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/repository/query/support/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This package contains support classes for query derivation and other ways of querying couchbase (helper classes). 3 | */ 4 | package org.springframework.data.couchbase.repository.query.support; 5 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/repository/support/CrudMethodMetadata.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.repository.support; 17 | 18 | import java.lang.reflect.Method; 19 | 20 | import org.springframework.data.couchbase.repository.ScanConsistency; 21 | 22 | public interface CrudMethodMetadata { 23 | 24 | /** 25 | * Returns the {@link Method} to be used. 26 | */ 27 | Method getMethod(); 28 | 29 | /** 30 | * If present holds the scan consistency annotation (null otherwise). 31 | */ 32 | ScanConsistency getScanConsistency(); 33 | 34 | String getScope(); 35 | 36 | String getCollection(); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/repository/support/DBRef.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.repository.support; 17 | 18 | /** 19 | * DB references 20 | * 21 | * @author Michael Reiche 22 | */ 23 | public class DBRef { 24 | Object id; 25 | 26 | public Object getId() { 27 | return id; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/repository/support/ViewMetadataProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.repository.support; 17 | 18 | import org.springframework.data.couchbase.core.query.View; 19 | 20 | /** 21 | * Interface to abstract {@link ViewMetadataProvider} that provides {@link View}s to be used for query execution. 22 | * 23 | * @author David Harrigan. 24 | */ 25 | public interface ViewMetadataProvider { 26 | 27 | /** 28 | * Returns the {@link View} to be used. 29 | * 30 | * @return the View, or null if the method hasn't been annotated with @View. 31 | */ 32 | View getView(); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/repository/support/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | /** 18 | * This package contains the Couchbase implementations to support the Spring Data repository abstraction.
19 | * This includes repository factories and factory beans, concrete base repository classes, metadata providers and a 20 | * class in charge of managing various indexes (views, N1QL). 21 | */ 22 | package org.springframework.data.couchbase.repository.support; 23 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/transaction/CouchbaseResourceOwner.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.couchbase.transaction; 2 | 3 | import reactor.core.publisher.Mono; 4 | 5 | import java.util.Optional; 6 | 7 | import com.couchbase.client.core.annotation.Stability.Internal; 8 | 9 | @Internal 10 | public class CouchbaseResourceOwner { 11 | private static final ThreadLocal marker = new ThreadLocal(); 12 | 13 | public CouchbaseResourceOwner() {} 14 | 15 | public static void set(CouchbaseResourceHolder toInject) { 16 | if (marker.get() != null) { 17 | throw new IllegalStateException( 18 | "Trying to set resource holder when already inside a transaction - likely an internal bug, please report it"); 19 | } else { 20 | marker.set(toInject); 21 | } 22 | } 23 | 24 | public static void clear() { 25 | marker.remove(); 26 | } 27 | 28 | public static Mono> get() { 29 | return Mono.deferContextual((ctx) -> { 30 | CouchbaseResourceHolder fromThreadLocal = marker.get(); 31 | CouchbaseResourceHolder fromReactive = ctx.hasKey(CouchbaseResourceHolder.class) 32 | ? ctx.get(CouchbaseResourceHolder.class) 33 | : null; 34 | if (fromThreadLocal != null) { 35 | return Mono.just(Optional.of(fromThreadLocal)); 36 | } else { 37 | return fromReactive != null ? Mono.just(Optional.of(fromReactive)) : Mono.just(Optional.empty()); 38 | } 39 | }); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/transaction/CouchbaseTransactionDefinition.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.transaction; 17 | 18 | import org.springframework.transaction.support.DefaultTransactionDefinition; 19 | 20 | import com.couchbase.client.core.annotation.Stability; 21 | 22 | /** 23 | * Couchbase Transaction Definition for Spring Data transaction framework. 24 | * 25 | * @author Michael Reiche 26 | */ 27 | @Stability.Internal 28 | public class CouchbaseTransactionDefinition extends DefaultTransactionDefinition { 29 | public CouchbaseTransactionDefinition() { 30 | super(); 31 | setIsolationLevel(ISOLATION_READ_COMMITTED); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/transaction/error/TransactionRollbackRequestedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.transaction.error; 17 | 18 | import com.couchbase.client.core.error.CouchbaseException; 19 | 20 | /** 21 | * A transaction rollback has been requested. 22 | * 23 | * @author Graham Pople 24 | */ 25 | public class TransactionRollbackRequestedException extends CouchbaseException { 26 | public TransactionRollbackRequestedException(String message) { 27 | super(message); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/springframework/data/couchbase/transaction/error/TransactionSystemUnambiguousException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.transaction.error; 17 | 18 | import com.couchbase.client.java.transactions.error.TransactionFailedException; 19 | 20 | /** 21 | * The transaction failed and unambiguously did not commit. No actors can see any part of this failed transaction. 22 | *

23 | * The application does not need to do anything to rollback the transaction. 24 | * 25 | * @author Graham Pople 26 | */ 27 | public class TransactionSystemUnambiguousException extends TransactionSystemCouchbaseException { 28 | public TransactionSystemUnambiguousException(TransactionFailedException ex) { 29 | super(ex); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/services/jakarta.enterprise.inject.spi.Extension: -------------------------------------------------------------------------------- 1 | org.springframework.data.couchbase.repository.cdi.CouchbaseRepositoryExtension -------------------------------------------------------------------------------- /src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.data.repository.core.support.RepositoryFactorySupport=org.springframework.data.couchbase.repository.support.CouchbaseRepositoryFactory 2 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/spring.handlers: -------------------------------------------------------------------------------- 1 | http\://www.springframework.org/schema/data/couchbase=org.springframework.data.couchbase.config.CouchbaseNamespaceHandler -------------------------------------------------------------------------------- /src/main/resources/META-INF/spring.schemas: -------------------------------------------------------------------------------- 1 | http\://www.springframework.org/schema/data/couchbase/spring-couchbase-1.0.xsd=org/springframework/data/couchbase/config/spring-couchbase-1.0.xsd 2 | http\://www.springframework.org/schema/data/couchbase/spring-couchbase-2.0.xsd=org/springframework/data/couchbase/config/spring-couchbase-2.0.xsd 3 | http\://www.springframework.org/schema/data/couchbase/spring-couchbase-env-2.0.xsd=org/springframework/data/couchbase/config/spring-couchbase-env-2.0.xsd 4 | http\://www.springframework.org/schema/data/couchbase/spring-couchbase.xsd=org/springframework/data/couchbase/config/spring-couchbase-2.0.xsd 5 | https\://www.springframework.org/schema/data/couchbase/spring-couchbase-1.0.xsd=org/springframework/data/couchbase/config/spring-couchbase-1.0.xsd 6 | https\://www.springframework.org/schema/data/couchbase/spring-couchbase-2.0.xsd=org/springframework/data/couchbase/config/spring-couchbase-2.0.xsd 7 | https\://www.springframework.org/schema/data/couchbase/spring-couchbase-env-2.0.xsd=org/springframework/data/couchbase/config/spring-couchbase-env-2.0.xsd 8 | https\://www.springframework.org/schema/data/couchbase/spring-couchbase.xsd=org/springframework/data/couchbase/config/spring-couchbase-2.0.xsd 9 | -------------------------------------------------------------------------------- /src/main/resources/META-INF/spring.tooling: -------------------------------------------------------------------------------- 1 | # Tooling related information for the Couchbase DB namespace 2 | http\://www.springframework.org/schema/data/couchbase@name=Couchbase Namespace 3 | http\://www.springframework.org/schema/data/couchbase@prefix=couchbase 4 | http\://www.springframework.org/schema/data/couchbase@icon=org/springframework/jdbc/config/spring-jdbc.gif -------------------------------------------------------------------------------- /src/main/resources/notice.txt: -------------------------------------------------------------------------------- 1 | Spring Data Couchbase 6.0 M3 (2025.1.0) 2 | Copyright (c) [2013-2019] Couchbase / Pivotal Software, Inc. 3 | 4 | This product is licensed to you under the Apache License, Version 2.0 (the "License"). 5 | You may not use this product except in compliance with the License. 6 | 7 | This product may include a number of subcomponents with 8 | separate copyright notices and license terms. Your use of the source 9 | code for these subcomponents is subject to the terms and 10 | conditions of the subcomponent's license, as noted in the LICENSE file. 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/AbstractUser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.domain; 18 | 19 | import org.springframework.data.annotation.Id; 20 | import org.springframework.data.annotation.TypeAlias; 21 | import org.springframework.data.couchbase.core.mapping.Field; 22 | 23 | /** 24 | * User entity for tests 25 | * 26 | * @author Michael Reiche 27 | */ 28 | @TypeAlias(AbstractingTypeMapper.Type.ABSTRACTUSER) 29 | public abstract class AbstractUser extends ComparableEntity { 30 | @Id protected String id; 31 | protected String firstname; 32 | protected String lastname; 33 | @Field(AbstractingTypeMapper.SUBTYPE) protected String subtype; 34 | 35 | public String getId() { 36 | return id; 37 | } 38 | 39 | public String getFirstname() { 40 | return firstname; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/AddressAnnotated.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.domain; 18 | 19 | import org.springframework.data.couchbase.repository.Collection; 20 | import org.springframework.data.couchbase.repository.Scope; 21 | 22 | /** 23 | * @author Michael Reiche 24 | */ 25 | @Scope("dummy_scope") // set to non-existing scope. To use, scope must be determined by other means 26 | // a different collection 27 | @Collection("my_collection2") 28 | public class AddressAnnotated extends Address {} 29 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/AddressWithEncStreet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.domain; 17 | 18 | import org.springframework.data.couchbase.core.mapping.Document; 19 | 20 | import com.couchbase.client.java.encryption.annotation.Encrypted; 21 | 22 | @Document 23 | public class AddressWithEncStreet extends Address { 24 | 25 | private @Encrypted String encStreet; 26 | 27 | public AddressWithEncStreet() {} 28 | 29 | public String getEncStreet() { 30 | return encStreet; 31 | } 32 | 33 | public void setEncStreet(String encStreet) { 34 | this.encStreet = encStreet; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/AirlineCollectionedRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.domain; 18 | 19 | import org.springframework.data.couchbase.repository.CouchbaseRepository; 20 | import org.springframework.data.couchbase.repository.DynamicProxyable; 21 | import org.springframework.data.querydsl.QuerydslPredicateExecutor; 22 | import org.springframework.stereotype.Repository; 23 | 24 | /** 25 | * @author Michael Reiche 26 | */ 27 | @Repository 28 | public interface AirlineCollectionedRepository extends CouchbaseRepository, 29 | QuerydslPredicateExecutor, DynamicProxyable { 30 | } 31 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/AirportJsonValueRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.domain; 17 | 18 | import org.springframework.data.couchbase.repository.CouchbaseRepository; 19 | import org.springframework.data.couchbase.repository.DynamicProxyable; 20 | import org.springframework.stereotype.Repository; 21 | 22 | /** 23 | * AirportJsonValue repository for testing
24 | * 25 | * @author Michael Reiche 26 | */ 27 | @Repository 28 | public interface AirportJsonValueRepository 29 | extends CouchbaseRepository, DynamicProxyable { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/AirportRepositoryAnnotated.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.domain; 17 | 18 | import org.springframework.data.couchbase.repository.Collection; 19 | 20 | /** 21 | * AirportRepository with collection annotation 22 | * 23 | * @author Michael Reiche 24 | */ 25 | @Collection("my_collection2") 26 | public interface AirportRepositoryAnnotated extends AirportRepository {} 27 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/AirportRepositoryScanConsistencyTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.domain; 18 | 19 | import org.springframework.data.couchbase.repository.CouchbaseRepository; 20 | import org.springframework.stereotype.Repository; 21 | 22 | /** 23 | * Airport repository for testing
24 | * 25 | * @author Michael Reiche 26 | */ 27 | @Repository 28 | public interface AirportRepositoryScanConsistencyTest extends CouchbaseRepository { 29 | 30 | } 31 | 32 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/ConfigScoped.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.domain; 18 | 19 | /** 20 | * @author Michael Reiche 21 | */ 22 | public class ConfigScoped extends Config{ 23 | @Override 24 | protected java.lang.String getScopeName() { 25 | return "my_scope"; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/Course.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.domain; 18 | 19 | import org.springframework.data.annotation.Id; 20 | 21 | import java.lang.reflect.Field; 22 | 23 | /** 24 | * Course entity for tests 25 | * 26 | * @author Michael Reiche 27 | */ 28 | public class Course extends ComparableEntity { 29 | @Id private final String id; 30 | private final String userId; 31 | private final String room; 32 | 33 | public Course(String id, String userId, String room) { 34 | this.id = id; 35 | this.userId = userId; 36 | this.room = room; 37 | } 38 | 39 | public String getId() { 40 | return id; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/EBTurbulenceCategory.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.couchbase.domain; 2 | 3 | /* 4 | * Copyright 2022-2025 the original author or authors. 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * https://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | import com.fasterxml.jackson.annotation.JsonCreator; 20 | import com.fasterxml.jackson.annotation.JsonValue; 21 | 22 | /** 23 | * An enum that has an Boolean getCode() method. 24 | * 25 | * @author Michael Reiche 26 | */ 27 | public enum EBTurbulenceCategory { 28 | T(true), F(false); 29 | 30 | private final Boolean code; 31 | 32 | @JsonCreator 33 | EBTurbulenceCategory(Boolean code) { 34 | this.code = code; 35 | } 36 | 37 | @JsonValue 38 | public Boolean getCode() { 39 | return code; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/EITurbulenceCategory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.domain; 17 | 18 | import com.fasterxml.jackson.annotation.JsonValue; 19 | 20 | /** 21 | * An enum that has an Integer getCode() method. 22 | * 23 | * @author Michael Reiche 24 | */ 25 | public enum EITurbulenceCategory { 26 | T10(10), T20(20), T30(30), T40(40); 27 | 28 | private final Integer code; 29 | 30 | EITurbulenceCategory(Integer code) { 31 | this.code = code; 32 | } 33 | 34 | @JsonValue 35 | public Integer getCode() { 36 | return code; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/EJsonCreatorTurbulenceCategory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.domain; 17 | 18 | import com.fasterxml.jackson.annotation.JsonCreator; 19 | import com.fasterxml.jackson.annotation.JsonValue; 20 | 21 | /** 22 | * An enum that has an @JsonCreator method. 23 | * 24 | * @author Michael Reiche 25 | */ 26 | public enum EJsonCreatorTurbulenceCategory { 27 | T10("10%"), T20("20%"), T30("30%"), T40("40%"); 28 | 29 | private final String code; 30 | 31 | @JsonCreator 32 | EJsonCreatorTurbulenceCategory(String code) { 33 | this.code = code; 34 | } 35 | 36 | @JsonValue 37 | public String getCode() { 38 | return code; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/ETurbulenceCategory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.domain; 17 | 18 | import com.fasterxml.jackson.annotation.JsonValue; 19 | 20 | /** 21 | * An enum that has an String getCode() method. 22 | * 23 | * @author Michael Reiche 24 | */ 25 | public enum ETurbulenceCategory { 26 | T10("\"10%"), T20("\"20%"), T30("\"30%"); 27 | 28 | private final String code; 29 | 30 | ETurbulenceCategory(String code) { 31 | this.code = code; 32 | } 33 | 34 | @JsonValue 35 | public String getCode() { 36 | return code; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/Iata.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.couchbase.domain; 2 | 3 | public enum Iata { 4 | vie, // must be lower-case to match "vie" as airport.iata is always specified in lowercase 5 | xxx 6 | } 7 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/LibraryRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.domain; 18 | 19 | import org.springframework.data.couchbase.repository.CouchbaseRepository; 20 | import org.springframework.stereotype.Repository; 21 | 22 | /** 23 | * Library Repository for tests 24 | * 25 | * @author Andrea Torlaschi 26 | */ 27 | @Repository 28 | public interface LibraryRepository extends CouchbaseRepository { 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/MutableUser.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.couchbase.domain; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.couchbase.core.mapping.Document; 6 | 7 | @Document 8 | public class MutableUser extends User{ 9 | public MutableUser(String id, String firstname, String lastname) { 10 | super(id, firstname, lastname); 11 | } 12 | 13 | private Address address; 14 | 15 | private MutableUser subuser; 16 | 17 | private List roles; 18 | 19 | public void setRoles(List roles) { 20 | this.roles = roles; 21 | } 22 | 23 | public List getRoles() { 24 | return roles; 25 | } 26 | 27 | public void setAddress(Address address) { 28 | this.address = address; 29 | } 30 | 31 | public Address getAddress() { 32 | return address; 33 | } 34 | 35 | public void setSubuser(MutableUser subuser) { 36 | this.subuser = subuser; 37 | } 38 | 39 | public MutableUser getSubuser() { 40 | return subuser; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/MyPerson.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.couchbase.domain; 2 | 3 | import jakarta.validation.constraints.NotNull; 4 | import org.springframework.data.annotation.Id; 5 | import org.springframework.data.couchbase.core.mapping.Field; 6 | 7 | public class MyPerson { 8 | @NotNull 9 | @Id 10 | public String id; 11 | 12 | @Field 13 | public Object myObject; 14 | 15 | public String toString() { 16 | StringBuffer sb = new StringBuffer(); 17 | sb.append("MyPerson:{"); 18 | sb.append("id:"); 19 | sb.append(id); 20 | sb.append(", myObject:"); 21 | sb.append(myObject); 22 | sb.append("}"); 23 | return sb.toString(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/MyPersonRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.domain; 17 | 18 | import java.util.List; 19 | import java.util.UUID; 20 | 21 | import org.springframework.data.couchbase.repository.CouchbaseRepository; 22 | import org.springframework.data.couchbase.repository.DynamicProxyable; 23 | import org.springframework.data.couchbase.repository.Query; 24 | import org.springframework.data.couchbase.repository.ScanConsistency; 25 | import org.springframework.data.repository.query.Param; 26 | 27 | import com.couchbase.client.java.query.QueryScanConsistency; 28 | 29 | /** 30 | * @author Michael Reiche 31 | */ 32 | public interface MyPersonRepository extends CouchbaseRepository, DynamicProxyable { 33 | 34 | } 35 | 36 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/OtherUser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.domain; 18 | 19 | import org.springframework.data.annotation.PersistenceCreator; 20 | import org.springframework.data.annotation.TypeAlias; 21 | import org.springframework.data.couchbase.core.mapping.Document; 22 | 23 | /** 24 | * OtherUser entity for tests. Both User and OtherUser extend AbstractUser 25 | * 26 | * @author Michael Reiche 27 | */ 28 | 29 | @Document 30 | @TypeAlias(AbstractingTypeMapper.Type.ABSTRACTUSER) 31 | public class OtherUser extends AbstractUser { 32 | 33 | @PersistenceCreator 34 | public OtherUser(final String id, final String firstname, final String lastname) { 35 | this.id = id; 36 | this.firstname = firstname; 37 | this.lastname = lastname; 38 | this.subtype = AbstractingTypeMapper.Type.OTHERUSER; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/PersonValueRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.domain; 17 | 18 | import org.springframework.data.repository.CrudRepository; 19 | 20 | /** 21 | * PersonValue repository for tests 22 | * 23 | * @author Michael Reiche 24 | */ 25 | public interface PersonValueRepository extends CrudRepository { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/PersonWithDurability.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.domain; 17 | 18 | import com.couchbase.client.java.kv.PersistTo; 19 | import com.couchbase.client.java.kv.ReplicateTo; 20 | import org.springframework.data.couchbase.core.mapping.Document; 21 | 22 | import java.util.UUID; 23 | 24 | /** 25 | * Person entity for tests. 26 | * 27 | * @author Tigran Babloyan 28 | */ 29 | @Document(persistTo = PersistTo.ONE, replicateTo = ReplicateTo.ONE) 30 | public class PersonWithDurability extends Person { 31 | public PersonWithDurability() { 32 | setId(UUID.randomUUID()); 33 | setMiddlename("Nick"); 34 | } 35 | 36 | public PersonWithDurability(String firstname, String lastname) { 37 | this(); 38 | setFirstname(firstname); 39 | setLastname(lastname); 40 | isNew(true); 41 | } 42 | } -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/PersonWithDurability2.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.domain; 17 | 18 | import com.couchbase.client.core.msg.kv.DurabilityLevel; 19 | import com.couchbase.client.java.kv.PersistTo; 20 | import com.couchbase.client.java.kv.ReplicateTo; 21 | import org.springframework.data.couchbase.core.mapping.Document; 22 | 23 | import java.util.UUID; 24 | 25 | /** 26 | * Person entity for tests. 27 | * 28 | * @author Tigran Babloyan 29 | */ 30 | @Document(durabilityLevel = DurabilityLevel.MAJORITY) 31 | public class PersonWithDurability2 extends Person { 32 | public PersonWithDurability2() { 33 | setId(UUID.randomUUID()); 34 | setMiddlename("Nick"); 35 | } 36 | 37 | public PersonWithDurability2(String firstname, String lastname) { 38 | this(); 39 | setFirstname(firstname); 40 | setLastname(lastname); 41 | isNew(true); 42 | } 43 | } -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/ReactiveAirlineRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.domain; 18 | 19 | import java.util.List; 20 | 21 | import org.springframework.data.couchbase.repository.Query; 22 | import org.springframework.data.couchbase.repository.ReactiveCouchbaseRepository; 23 | import org.springframework.data.repository.query.Param; 24 | import org.springframework.stereotype.Repository; 25 | 26 | /** 27 | * @author Michael Reiche 28 | */ 29 | @Repository 30 | public interface ReactiveAirlineRepository extends ReactiveCouchbaseRepository { 31 | 32 | @Query("#{#n1ql.selectEntity} where #{#n1ql.filter} and (name = $1)") 33 | List getByName(@Param("airline_name") String airlineName); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/ReactiveAirportMustScopeRepository.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.couchbase.domain; 2 | 3 | import org.springframework.data.couchbase.repository.Collection; 4 | import org.springframework.data.couchbase.repository.Scope; 5 | 6 | @Scope("must set scope name") 7 | @Collection("my_collection") 8 | public interface ReactiveAirportMustScopeRepository extends ReactiveAirportRepository { 9 | } 10 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/ReactiveAirportRepositoryAnnotated.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.domain; 17 | 18 | import org.springframework.data.couchbase.repository.Collection; 19 | 20 | /** 21 | * AirportRepository with collection annotation 22 | * 23 | * @author Michael Reiche 24 | */ 25 | @Collection("my_collection2") 26 | public interface ReactiveAirportRepositoryAnnotated extends ReactiveAirportRepository {} 27 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/ReactiveNaiveAuditorAware.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.domain; 17 | 18 | import reactor.core.publisher.Mono; 19 | 20 | import org.springframework.data.domain.ReactiveAuditorAware; 21 | 22 | /** 23 | * This class returns a string that represents the current user 24 | * 25 | * @author Jorge Rodríguez Martín 26 | * @since 4.2 27 | */ 28 | public class ReactiveNaiveAuditorAware implements ReactiveAuditorAware { 29 | 30 | public static final String AUDITOR = "reactive_auditor"; 31 | 32 | @Override 33 | public Mono getCurrentAuditor() { 34 | return Mono.just(AUDITOR); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/ReactivePersonRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.domain; 17 | 18 | import org.springframework.data.couchbase.repository.DynamicProxyable; 19 | import org.springframework.data.couchbase.repository.ReactiveCouchbaseRepository; 20 | 21 | /** 22 | * @author Michael Reiche 23 | */ 24 | public interface ReactivePersonRepository 25 | extends ReactiveCouchbaseRepository, DynamicProxyable { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/ReactiveUserRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.domain; 18 | 19 | import reactor.core.publisher.Flux; 20 | 21 | import org.springframework.data.couchbase.repository.ReactiveCouchbaseRepository; 22 | import org.springframework.stereotype.Repository; 23 | 24 | @Repository 25 | public interface ReactiveUserRepository extends ReactiveCouchbaseRepository { 26 | 27 | Flux findByFirstname(String firstname); 28 | 29 | Flux findByFirstnameAndLastname(String firstname, String lastname); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/Submission.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.domain; 18 | 19 | /** 20 | * Submission entity for tests 21 | * 22 | * @author Michael Reiche 23 | */ 24 | public class Submission extends ComparableEntity { 25 | private final String id; 26 | private final String userId; 27 | private final String talkId; 28 | private final String status; 29 | private final long number; 30 | 31 | public Submission(String id, String userId, String talkId, String status, long number) { 32 | this.id = id; 33 | this.userId = userId; 34 | this.talkId = talkId; 35 | this.status = status; 36 | this.number = number; 37 | } 38 | 39 | public String getId() { 40 | return id; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/SubscriptionTokenRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.domain; 18 | 19 | import org.springframework.data.couchbase.repository.CouchbaseRepository; 20 | import org.springframework.stereotype.Repository; 21 | 22 | /** 23 | * SubscriptionToken Repository for tests 24 | * 25 | * @author Michael Reiche 26 | */ 27 | @Repository 28 | public interface SubscriptionTokenRepository extends CouchbaseRepository {} 29 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/TypeAwareTypeInformationMapper.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.couchbase.domain; 2 | 3 | import org.springframework.data.annotation.TypeAlias; 4 | import org.springframework.data.convert.SimpleTypeInformationMapper; 5 | import org.springframework.data.mapping.Alias; 6 | import org.springframework.data.util.TypeInformation; 7 | 8 | public class TypeAwareTypeInformationMapper extends SimpleTypeInformationMapper { 9 | 10 | @Override 11 | public Alias createAliasFor(TypeInformation type) { 12 | TypeAlias[] typeAlias = type.getType().getAnnotationsByType(TypeAlias.class); 13 | 14 | if (typeAlias.length == 1) { 15 | return Alias.of(typeAlias[0].value()); 16 | } 17 | 18 | return super.createAliasFor(type); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/TypeBasedCouchbaseTypeMapper.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.couchbase.domain; 2 | 3 | import org.springframework.data.convert.DefaultTypeMapper; 4 | import org.springframework.data.couchbase.core.convert.CouchbaseTypeMapper; 5 | import org.springframework.data.couchbase.core.convert.DefaultCouchbaseTypeMapper; 6 | import org.springframework.data.couchbase.core.mapping.CouchbaseDocument; 7 | import org.springframework.data.mapping.Alias; 8 | import org.springframework.data.util.TypeInformation; 9 | 10 | import java.util.Collections; 11 | 12 | public class TypeBasedCouchbaseTypeMapper extends DefaultTypeMapper implements CouchbaseTypeMapper { 13 | 14 | private final String typeKey; 15 | 16 | public TypeBasedCouchbaseTypeMapper(final String typeKey) { 17 | super(new DefaultCouchbaseTypeMapper.CouchbaseDocumentTypeAliasAccessor(typeKey), 18 | Collections.singletonList(new TypeAwareTypeInformationMapper())); 19 | this.typeKey = typeKey; 20 | } 21 | 22 | @Override 23 | public String getTypeKey() { 24 | return typeKey; 25 | } 26 | 27 | @Override 28 | public Alias getTypeAlias(TypeInformation info) { 29 | return getAliasFor(info); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/UserAnnotated.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.domain; 18 | 19 | import org.springframework.data.couchbase.core.mapping.Document; 20 | 21 | /** 22 | * Annoted User entity for tests 23 | * 24 | * @author Michael Reiche 25 | */ 26 | 27 | @Document(expiry = 1) 28 | public class UserAnnotated extends User { 29 | 30 | public UserAnnotated(String id, String firstname, String lastname) { 31 | super(id, firstname, lastname); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/UserAnnotated2.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.domain; 18 | 19 | import java.util.concurrent.TimeUnit; 20 | 21 | import org.springframework.data.couchbase.core.mapping.Document; 22 | 23 | /** 24 | * Annotated User entity for tests 25 | * 26 | * @author Michael Reiche 27 | */ 28 | 29 | @Document(expiryExpression = "${myExpiryExpression}", expiryUnit = TimeUnit.SECONDS) 30 | public class UserAnnotated2 extends User { 31 | static { 32 | System.setProperty("myExpiryExpression", "2"); 33 | } 34 | 35 | public UserAnnotated2(String id, String firstname, String lastname) { 36 | super(id, firstname, lastname); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/UserAnnotated3.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.domain; 18 | 19 | import java.util.concurrent.TimeUnit; 20 | 21 | import org.springframework.data.couchbase.core.mapping.Document; 22 | 23 | /** 24 | * Annotated User entity for tests 25 | * 26 | * @author Michael Reiche 27 | */ 28 | 29 | @Document(expiry=1, expiryUnit = TimeUnit.SECONDS) 30 | public class UserAnnotated3 extends User { 31 | 32 | public UserAnnotated3(String id, String firstname, String lastname) { 33 | super(id, firstname, lastname); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/UserAnnotatedDurability.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.domain; 18 | 19 | import com.couchbase.client.core.msg.kv.DurabilityLevel; 20 | import org.springframework.data.couchbase.core.mapping.Document; 21 | 22 | import java.io.Serializable; 23 | 24 | /** 25 | * Annotated User entity for tests 26 | * 27 | * @author Tigran Babloyan 28 | */ 29 | 30 | @Document(durabilityLevel = DurabilityLevel.MAJORITY) 31 | public class UserAnnotatedDurability extends User implements Serializable { 32 | 33 | public UserAnnotatedDurability(String id, String firstname, String lastname) { 34 | super(id, firstname, lastname); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/UserAnnotatedDurabilityExpression.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.domain; 18 | 19 | import com.couchbase.client.core.msg.kv.DurabilityLevel; 20 | import org.springframework.data.couchbase.core.mapping.Document; 21 | 22 | import java.io.Serializable; 23 | 24 | /** 25 | * Annotated User entity for tests 26 | * 27 | * @author Tigran Babloyan 28 | */ 29 | 30 | @Document(durabilityExpression = "${valid.document.durability}") 31 | public class UserAnnotatedDurabilityExpression extends User implements Serializable { 32 | 33 | public UserAnnotatedDurabilityExpression(String id, String firstname, String lastname) { 34 | super(id, firstname, lastname); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/UserAnnotatedPersistTo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.domain; 18 | 19 | import com.couchbase.client.java.kv.PersistTo; 20 | import com.couchbase.client.java.kv.ReplicateTo; 21 | import org.springframework.data.couchbase.core.mapping.Document; 22 | 23 | import java.io.Serializable; 24 | 25 | /** 26 | * Annotated User entity for tests 27 | * 28 | * @author Tigran Babloyan 29 | */ 30 | 31 | @Document(persistTo = PersistTo.ACTIVE) 32 | public class UserAnnotatedPersistTo extends User implements Serializable { 33 | 34 | public UserAnnotatedPersistTo(String id, String firstname, String lastname) { 35 | super(id, firstname, lastname); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/UserAnnotatedReplicateTo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.domain; 18 | 19 | import com.couchbase.client.core.msg.kv.DurabilityLevel; 20 | import com.couchbase.client.java.kv.ReplicateTo; 21 | import org.springframework.data.couchbase.core.mapping.Document; 22 | 23 | import java.io.Serializable; 24 | 25 | /** 26 | * Annotated User entity for tests 27 | * 28 | * @author Tigran Babloyan 29 | */ 30 | 31 | @Document(replicateTo = ReplicateTo.ONE) 32 | public class UserAnnotatedReplicateTo extends User implements Serializable { 33 | 34 | public UserAnnotatedReplicateTo(String id, String firstname, String lastname) { 35 | super(id, firstname, lastname); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/UserCol.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.domain; 18 | 19 | import org.springframework.data.annotation.PersistenceCreator; 20 | import org.springframework.data.couchbase.core.mapping.Document; 21 | import org.springframework.data.couchbase.repository.Collection; 22 | import org.springframework.data.couchbase.repository.Scope; 23 | 24 | /** 25 | * User entity for tests 26 | * 27 | * @author Michael Nitschinger 28 | * @author Michael Reiche 29 | */ 30 | 31 | @Document 32 | @Scope("other_scope") 33 | @Collection("other_collection") 34 | public class UserCol extends User { 35 | 36 | @PersistenceCreator 37 | public UserCol(final String id, final String firstname, final String lastname) { 38 | super(id, firstname, lastname); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/UserSubmissionAnnotatedRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.domain; 18 | 19 | import java.util.List; 20 | 21 | import org.springframework.data.couchbase.repository.CouchbaseRepository; 22 | import org.springframework.data.couchbase.repository.ScanConsistency; 23 | import org.springframework.stereotype.Repository; 24 | 25 | import com.couchbase.client.java.query.QueryScanConsistency; 26 | 27 | /** 28 | * UserSubmissionAnnotatedRepository for tests 29 | * 30 | * @author Michael Reiche 31 | */ 32 | @Repository 33 | public interface UserSubmissionAnnotatedRepository extends CouchbaseRepository { 34 | 35 | @ScanConsistency(query = QueryScanConsistency.REQUEST_PLUS) 36 | List findByUsername(String username); 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/UserSubmissionUnannotatedRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.domain; 18 | 19 | import java.util.List; 20 | 21 | import org.springframework.data.couchbase.repository.CouchbaseRepository; 22 | import org.springframework.data.couchbase.repository.ScanConsistency; 23 | import org.springframework.stereotype.Repository; 24 | 25 | import com.couchbase.client.java.query.QueryScanConsistency; 26 | 27 | /** 28 | * UserSubmissionAnnotatedRepository for tests 29 | * 30 | * @author Michael Reiche 31 | */ 32 | @Repository 33 | public interface UserSubmissionUnannotatedRepository extends CouchbaseRepository { 34 | 35 | @ScanConsistency(query = QueryScanConsistency.REQUEST_PLUS) 36 | List findByUsername(String username); 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/time/AuditingDateTimeProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.domain.time; 17 | 18 | import java.time.Instant; 19 | import java.time.temporal.TemporalAccessor; 20 | import java.util.Optional; 21 | 22 | import org.springframework.data.auditing.DateTimeProvider; 23 | 24 | public class AuditingDateTimeProvider implements DateTimeProvider { 25 | 26 | private DateTimeService dateTimeService = new FixedDateTimeService(); 27 | 28 | public AuditingDateTimeProvider() {} 29 | 30 | public AuditingDateTimeProvider(DateTimeService dateTimeService) { 31 | this.dateTimeService = dateTimeService; 32 | } 33 | 34 | @Override 35 | public Optional getNow() { 36 | return Optional.of(Instant.ofEpochSecond(dateTimeService.getCurrentDateAndTime().toEpochSecond())); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/time/CurrentDateTimeService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.domain.time; 17 | 18 | import java.time.ZonedDateTime; 19 | 20 | public class CurrentDateTimeService implements DateTimeService { 21 | @Override 22 | public ZonedDateTime getCurrentDateAndTime() { 23 | return ZonedDateTime.now(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/time/DateTimeService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.domain.time; 17 | 18 | import java.time.ZonedDateTime; 19 | 20 | public interface DateTimeService { 21 | ZonedDateTime getCurrentDateAndTime(); 22 | } 23 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/domain/time/FixedDateTimeService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.domain.time; 17 | 18 | import java.time.ZoneId; 19 | import java.time.ZonedDateTime; 20 | 21 | public class FixedDateTimeService implements DateTimeService { 22 | public static void main(String[] args) { 23 | System.out.println((new FixedDateTimeService()).getCurrentDateAndTime()); 24 | } 25 | 26 | @Override 27 | public ZonedDateTime getCurrentDateAndTime() { 28 | return ZonedDateTime.of(2020, 1, 1, 0, 0, 0, 0, ZoneId.of("GMT-8")); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/transactions/AfterTransactionAssertion.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.transactions; 18 | 19 | import org.springframework.data.domain.Persistable; 20 | 21 | /** 22 | * For testing transactions. 23 | * 24 | * @author Michael Reiche 25 | */ 26 | 27 | public class AfterTransactionAssertion { 28 | 29 | private final T persistable; 30 | private boolean expectToBePresent; 31 | 32 | public AfterTransactionAssertion(T persistable) { 33 | this.persistable = persistable; 34 | } 35 | 36 | public void isPresent() { 37 | expectToBePresent = true; 38 | } 39 | 40 | public void isNotPresent() { 41 | expectToBePresent = false; 42 | } 43 | 44 | public Object getId() { 45 | return persistable.getId(); 46 | } 47 | 48 | public boolean shouldBePresent() { 49 | return expectToBePresent; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/transactions/ObjectId.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.transactions; 18 | 19 | import java.util.UUID; 20 | 21 | /** 22 | * ObjectId for Transaction tests 23 | * 24 | * @author Michael Reiche 25 | */ 26 | public class ObjectId { 27 | public ObjectId() { 28 | id = UUID.randomUUID().toString(); 29 | } 30 | 31 | String id; 32 | 33 | public String toString() { 34 | return id.toString(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/transactions/SimulateFailureException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.transactions; 18 | 19 | /** 20 | * A recognizable exception for testing transactions 21 | * 22 | * @author Michael Reiche 23 | */ 24 | public class SimulateFailureException extends RuntimeException { 25 | 26 | public SimulateFailureException(String... s) { 27 | super(s != null && s.length > 0 ? s[0] : null); 28 | } 29 | 30 | public SimulateFailureException() {} 31 | 32 | public static void throwEx(String... s) { 33 | throw new SimulateFailureException(s); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/util/ClusterType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.util; 17 | 18 | public enum ClusterType { 19 | // CONTAINERIZED, 20 | MOCKED, UNMANAGED 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/util/IgnoreWhen.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.util; 17 | 18 | import java.lang.annotation.ElementType; 19 | import java.lang.annotation.Retention; 20 | import java.lang.annotation.RetentionPolicy; 21 | import java.lang.annotation.Target; 22 | 23 | @Target({ ElementType.ANNOTATION_TYPE, ElementType.METHOD, ElementType.TYPE }) 24 | @Retention(RetentionPolicy.RUNTIME) 25 | public @interface IgnoreWhen { 26 | 27 | ClusterType[] clusterTypes() default {}; 28 | 29 | Capabilities[] missesCapabilities() default {}; 30 | 31 | Capabilities[] hasCapabilities() default {}; 32 | 33 | int nodesLessThan() default 0; 34 | 35 | int nodesGreaterThan() default Integer.MAX_VALUE; 36 | 37 | int replicasLessThan() default 0; 38 | 39 | int replicasGreaterThan() default Integer.MAX_VALUE; 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/util/Services.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.couchbase.util; 17 | 18 | public enum Services { 19 | KV, KV_TLS, MANAGER, MANAGER_TLS, QUERY, QUERY_TLS, ANALYTICS, ANALYTICS_TLS, SEARCH, SEARCH_TLS, VIEW, VIEW_TLS 20 | } 21 | -------------------------------------------------------------------------------- /src/test/java/org/springframework/data/couchbase/util/TestNodeConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.couchbase.util; 18 | 19 | import java.util.Map; 20 | 21 | public class TestNodeConfig { 22 | 23 | private final String hostname; 24 | 25 | private final Map ports; 26 | 27 | public TestNodeConfig(String hostname, Map ports) { 28 | this.hostname = hostname; 29 | this.ports = ports; 30 | } 31 | 32 | public String hostname() { 33 | return hostname; 34 | } 35 | 36 | public Map ports() { 37 | return ports; 38 | } 39 | 40 | @Override 41 | public String toString() { 42 | return "TestNodeConfig{" + "hostname='" + hostname + '\'' + ", ports=" + ports + '}'; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/test/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/test/resources/configurations/couchbase-consistency.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/test/resources/configurations/couchbase-multi-bucket-bean.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/test/resources/configurations/couchbase-repository-bean.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/test/resources/configurations/couchbase-template-bean.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/test/resources/configurations/couchbase-template-with-translation-service-bean.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 17 | 18 | -------------------------------------------------------------------------------- /src/test/resources/configurations/couchbaseBucket-bean.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 18 | 19 | -------------------------------------------------------------------------------- /src/test/resources/configurations/couchbaseCluster-bean.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 192.1.2.3 17 | 192.4.5.6 18 | 19 | 20 | 21 | 2.2.2.2 22 | 4.4.4.4 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/test/resources/configurations/couchbaseEnv-bean.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 33 | 34 | -------------------------------------------------------------------------------- /src/test/resources/configurations/couchbaseSingleEnv-bean.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/test/resources/integration.properties: -------------------------------------------------------------------------------- 1 | # Couchbase Integration-Test Default Properties 2 | # If set to false, it is assumed that the host is managing the cluster and 3 | # as a result no containers or anything will be spun up. 4 | # Options: containerized, mocked, unmanaged 5 | cluster.type=mocked 6 | # Default configs for both cases 7 | # Default configs for the mocked environment 8 | cluster.mocked.numNodes=1 9 | cluster.mocked.numReplicas=1 10 | # Entry point configuration if not managed 11 | # value of hostname and ns_server port 12 | cluster.unmanaged.seed=127.0.0.1:8091 13 | cluster.adminUsername=Administrator 14 | cluster.adminPassword=password 15 | #cluster.unmanaged.seed=cb.zsibzkbgllfbcj8g.cloud.couchbase.com 16 | #cluster.adminUsername=user 17 | #cluster.adminPassword=Couch0base! 18 | cluster.unmanaged.numReplicas=0 19 | -------------------------------------------------------------------------------- /src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | %d %5p %40.40c:%4L - %m%n 7 | 8 | 9 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 24 | 25 | " 26 | 27 | 28 | 29 | 30 | " 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/test/resources/server.properties: -------------------------------------------------------------------------------- 1 | #Couchbase server versions 4.5 and above are supported 2 | server.version=6.0.0 3 | #resource can be set to container or omitted 4 | #container just would require docker installed 5 | #omitted indicates that there is a local couchbase server running 6 | server.resource=container -------------------------------------------------------------------------------- /template.mf: -------------------------------------------------------------------------------- 1 | Bundle-ManifestVersion: 2 2 | Bundle-SymbolicName: org.springframework.data.couchbase 3 | Bundle-Name: ${project.name} 4 | Bundle-Vendor: Couchbase Inc., Pivotal Software Inc. 5 | Bundle-Version: ${project.version} 6 | Bundle-RequiredExecutionEnvironment: JavaSE-1.6 7 | Export-Template: 8 | org.springframework.data.couchbase.*;version="${project.version}" 9 | Import-Template: 10 | com.couchbase.client.*;version="${couchbase.osgi:[=.=.=,+1.0.0)}", 11 | com.fasterxml.jackson.*;version="${jackson:[=.=.=,+1.0.0)}", 12 | javax.enterprise.*;version="${cdi:[=.=.=,+1.0.0)}";resolution:=optional, 13 | javax.validation.*;version="${validation:[=.=.=.=,+1.0.0)}";resolution:=optional, 14 | org.aopalliance.*;version="[1.0.0, 2.0.0)";resolution:=optional, 15 | org.joda.time.*;version="${jodatime:[=.=.=,+1.0.0)}";resolution:=optional, 16 | org.slf4j.*;version="${slf4j:[=.=.=,+1.0.0)}", 17 | org.springframework.*;version="${spring:[=.=.=.=,+1.0.0)}", 18 | org.springframework.data.*;version="${springdata.commons:[=.=.=.=,+1.0.0)}", 19 | org.w3c.*;version="0.0.0", 20 | 21 | --------------------------------------------------------------------------------