├── .github ├── PULL_REQUEST_TEMPLATE.md ├── dco.yml └── workflows │ └── project.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 └── pipeline.properties ├── mvnw ├── mvnw.cmd ├── pom.xml ├── settings.xml ├── setup-cassandra.sh ├── spring-data-cassandra-distribution ├── package.json └── pom.xml ├── spring-data-cassandra ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── data │ │ │ └── cassandra │ │ │ ├── CassandraAuthenticationException.java │ │ │ ├── CassandraConnectionFailureException.java │ │ │ ├── CassandraDriverTimeoutException.java │ │ │ ├── CassandraInsufficientReplicasAvailableException.java │ │ │ ├── CassandraInternalException.java │ │ │ ├── CassandraInvalidConfigurationInQueryException.java │ │ │ ├── CassandraInvalidQueryException.java │ │ │ ├── CassandraKeyspaceExistsException.java │ │ │ ├── CassandraManagedTypes.java │ │ │ ├── CassandraQuerySyntaxException.java │ │ │ ├── CassandraReadTimeoutException.java │ │ │ ├── CassandraSchemaElementExistsException.java │ │ │ ├── CassandraTableExistsException.java │ │ │ ├── CassandraTraceRetrievalException.java │ │ │ ├── CassandraTruncateException.java │ │ │ ├── CassandraTypeMismatchException.java │ │ │ ├── CassandraUnauthorizedException.java │ │ │ ├── CassandraUncategorizedException.java │ │ │ ├── CassandraWriteTimeoutException.java │ │ │ ├── ReactiveResultSet.java │ │ │ ├── ReactiveSession.java │ │ │ ├── ReactiveSessionFactory.java │ │ │ ├── SessionFactory.java │ │ │ ├── aot │ │ │ ├── CassandraManagedTypesBeanRegistrationAotProcessor.java │ │ │ ├── CassandraRuntimeHints.java │ │ │ └── package-info.java │ │ │ ├── config │ │ │ ├── AbstractCassandraConfiguration.java │ │ │ ├── AbstractCqlTemplateConfiguration.java │ │ │ ├── AbstractReactiveCassandraConfiguration.java │ │ │ ├── AbstractSessionConfiguration.java │ │ │ ├── CassandraAuditingBeanDefinitionParser.java │ │ │ ├── CassandraAuditingRegistrar.java │ │ │ ├── CassandraCqlSessionFactoryBean.java │ │ │ ├── CassandraCqlTemplateFactoryBean.java │ │ │ ├── CassandraCqlTemplateParser.java │ │ │ ├── CassandraEntityClassScanner.java │ │ │ ├── CassandraMappingContextParser.java │ │ │ ├── CassandraMappingConverterParser.java │ │ │ ├── CassandraNamespaceHandler.java │ │ │ ├── CassandraSessionFactoryBean.java │ │ │ ├── CassandraTemplateFactoryBean.java │ │ │ ├── CassandraTemplateParser.java │ │ │ ├── CompressionType.java │ │ │ ├── CqlNamespaceHandler.java │ │ │ ├── CqlSessionFactoryBean.java │ │ │ ├── CqlSessionParser.java │ │ │ ├── DefaultBeanNames.java │ │ │ ├── DefaultCqlBeanNames.java │ │ │ ├── DriverConfigLoaderBuilderConfigurer.java │ │ │ ├── EnableCassandraAuditing.java │ │ │ ├── EnableReactiveCassandraAuditing.java │ │ │ ├── InitializeKeyspaceBeanDefinitionParser.java │ │ │ ├── KeyspaceAction.java │ │ │ ├── KeyspaceActionSpecificationFactory.java │ │ │ ├── KeyspaceActionSpecificationFactoryBean.java │ │ │ ├── KeyspaceActions.java │ │ │ ├── ParsingUtils.java │ │ │ ├── PersistentEntitiesFactoryBean.java │ │ │ ├── ReactiveCassandraAuditingRegistrar.java │ │ │ ├── SchemaAction.java │ │ │ ├── SchemaUtils.java │ │ │ ├── SessionBuilderConfigurer.java │ │ │ ├── SessionFactoryBeanDefinitionParser.java │ │ │ ├── SessionFactoryFactoryBean.java │ │ │ ├── SortedResourcesFactoryBean.java │ │ │ └── package-info.java │ │ │ ├── core │ │ │ ├── AsyncCassandraOperations.java │ │ │ ├── AsyncCassandraTemplate.java │ │ │ ├── CassandraAdminOperations.java │ │ │ ├── CassandraAdminTemplate.java │ │ │ ├── CassandraBatchOperations.java │ │ │ ├── CassandraBatchTemplate.java │ │ │ ├── CassandraOperations.java │ │ │ ├── CassandraPersistentEntitySchemaCreator.java │ │ │ ├── CassandraPersistentEntitySchemaDropper.java │ │ │ ├── CassandraTemplate.java │ │ │ ├── DeleteOptions.java │ │ │ ├── EntityLifecycleEventDelegate.java │ │ │ ├── EntityOperations.java │ │ │ ├── EntityQueryUtils.java │ │ │ ├── EntityResultConverter.java │ │ │ ├── EntityWriteResult.java │ │ │ ├── ExecutableDeleteOperation.java │ │ │ ├── ExecutableDeleteOperationSupport.java │ │ │ ├── ExecutableInsertOperation.java │ │ │ ├── ExecutableInsertOperationSupport.java │ │ │ ├── ExecutableSelectOperation.java │ │ │ ├── ExecutableSelectOperationSupport.java │ │ │ ├── ExecutableUpdateOperation.java │ │ │ ├── ExecutableUpdateOperationSupport.java │ │ │ ├── FluentCassandraOperations.java │ │ │ ├── InsertOptions.java │ │ │ ├── PreparedStatementDelegate.java │ │ │ ├── QueryResultConverter.java │ │ │ ├── ReactiveCassandraBatchOperations.java │ │ │ ├── ReactiveCassandraBatchTemplate.java │ │ │ ├── ReactiveCassandraOperations.java │ │ │ ├── ReactiveCassandraTemplate.java │ │ │ ├── ReactiveDeleteOperation.java │ │ │ ├── ReactiveDeleteOperationSupport.java │ │ │ ├── ReactiveFluentCassandraOperations.java │ │ │ ├── ReactiveInsertOperation.java │ │ │ ├── ReactiveInsertOperationSupport.java │ │ │ ├── ReactiveSelectOperation.java │ │ │ ├── ReactiveSelectOperationSupport.java │ │ │ ├── ReactiveUpdateOperation.java │ │ │ ├── ReactiveUpdateOperationSupport.java │ │ │ ├── StatementFactory.java │ │ │ ├── UpdateOptions.java │ │ │ ├── WriteResult.java │ │ │ ├── convert │ │ │ │ ├── AbstractCassandraConverter.java │ │ │ │ ├── CassandraColumnType.java │ │ │ │ ├── CassandraConversionContext.java │ │ │ │ ├── CassandraConverter.java │ │ │ │ ├── CassandraConverters.java │ │ │ │ ├── CassandraCustomConversions.java │ │ │ │ ├── CassandraJsr310Converters.java │ │ │ │ ├── CassandraRowValueProvider.java │ │ │ │ ├── CassandraValueConverter.java │ │ │ │ ├── CassandraValueProvider.java │ │ │ │ ├── CassandraVector.java │ │ │ │ ├── ColumnType.java │ │ │ │ ├── ColumnTypeResolver.java │ │ │ │ ├── CustomConversions.java │ │ │ │ ├── DefaultCassandraColumnType.java │ │ │ │ ├── DefaultColumnType.java │ │ │ │ ├── DefaultColumnTypeResolver.java │ │ │ │ ├── FrozenIndicator.java │ │ │ │ ├── IndexSpecificationFactory.java │ │ │ │ ├── MappingCassandraConverter.java │ │ │ │ ├── QueryMapper.java │ │ │ │ ├── RowReader.java │ │ │ │ ├── RowReaderPropertyAccessor.java │ │ │ │ ├── RowValueProvider.java │ │ │ │ ├── SchemaFactory.java │ │ │ │ ├── TupleValueProvider.java │ │ │ │ ├── UdtValueProvider.java │ │ │ │ ├── UpdateMapper.java │ │ │ │ ├── UserTypeUtil.java │ │ │ │ ├── Where.java │ │ │ │ └── package-info.java │ │ │ ├── cql │ │ │ │ ├── ArgumentPreparedStatementBinder.java │ │ │ │ ├── AsyncCqlOperations.java │ │ │ │ ├── AsyncCqlTemplate.java │ │ │ │ ├── AsyncPreparedStatementCreator.java │ │ │ │ ├── AsyncResultSetExtractor.java │ │ │ │ ├── AsyncResultStream.java │ │ │ │ ├── AsyncRowMapperResultSetExtractor.java │ │ │ │ ├── AsyncSessionCallback.java │ │ │ │ ├── BeanPropertyRowMapper.java │ │ │ │ ├── CachedPreparedStatementCreator.java │ │ │ │ ├── CassandraAccessor.java │ │ │ │ ├── CassandraExceptionTranslator.java │ │ │ │ ├── ColumnMapRowMapper.java │ │ │ │ ├── CqlConstantType.java │ │ │ │ ├── CqlExceptionTranslator.java │ │ │ │ ├── CqlIdentifier.java │ │ │ │ ├── CqlOperations.java │ │ │ │ ├── CqlProvider.java │ │ │ │ ├── CqlTemplate.java │ │ │ │ ├── DataClassRowMapper.java │ │ │ │ ├── ExecutionProfileResolver.java │ │ │ │ ├── HostMapper.java │ │ │ │ ├── IncorrectResultSetColumnCountException.java │ │ │ │ ├── KeyspaceIdentifier.java │ │ │ │ ├── Ordering.java │ │ │ │ ├── PreparedStatementBinder.java │ │ │ │ ├── PreparedStatementCallback.java │ │ │ │ ├── PreparedStatementCreator.java │ │ │ │ ├── PrimaryKeyType.java │ │ │ │ ├── QueryExtractorDelegate.java │ │ │ │ ├── QueryOptions.java │ │ │ │ ├── QueryOptionsUtil.java │ │ │ │ ├── ReactiveCassandraAccessor.java │ │ │ │ ├── ReactiveCqlOperations.java │ │ │ │ ├── ReactiveCqlTemplate.java │ │ │ │ ├── ReactivePreparedStatementCallback.java │ │ │ │ ├── ReactivePreparedStatementCreator.java │ │ │ │ ├── ReactiveResultSetExtractor.java │ │ │ │ ├── ReactiveRowMapperResultSetExtractor.java │ │ │ │ ├── ReactiveSessionCallback.java │ │ │ │ ├── ReactiveStatementCallback.java │ │ │ │ ├── ReservedKeyword.java │ │ │ │ ├── ResultSetExtractor.java │ │ │ │ ├── RingMember.java │ │ │ │ ├── RingMemberHostMapper.java │ │ │ │ ├── RowCallbackHandler.java │ │ │ │ ├── RowMapper.java │ │ │ │ ├── RowMapperResultSetExtractor.java │ │ │ │ ├── RowUtils.java │ │ │ │ ├── SessionCallback.java │ │ │ │ ├── SimplePreparedStatementCreator.java │ │ │ │ ├── SingleColumnRowMapper.java │ │ │ │ ├── WriteOptions.java │ │ │ │ ├── converter │ │ │ │ │ ├── AbstractResultSetConverter.java │ │ │ │ │ ├── AbstractResultSetToBasicFixedTypeConverter.java │ │ │ │ │ ├── ResultSetToArrayConverter.java │ │ │ │ │ ├── ResultSetToBigDecimalConverter.java │ │ │ │ │ ├── ResultSetToBigIntegerConverter.java │ │ │ │ │ ├── ResultSetToBooleanConverter.java │ │ │ │ │ ├── ResultSetToByteBufferConverter.java │ │ │ │ │ ├── ResultSetToDateConverter.java │ │ │ │ │ ├── ResultSetToDoubleConverter.java │ │ │ │ │ ├── ResultSetToFloatConverter.java │ │ │ │ │ ├── ResultSetToInetAddressConverter.java │ │ │ │ │ ├── ResultSetToIntegerConverter.java │ │ │ │ │ ├── ResultSetToListConverter.java │ │ │ │ │ ├── ResultSetToListOfStringConverter.java │ │ │ │ │ ├── ResultSetToLongConverter.java │ │ │ │ │ ├── ResultSetToStringConverter.java │ │ │ │ │ ├── ResultSetToUuidConverter.java │ │ │ │ │ ├── RowToArrayConverter.java │ │ │ │ │ ├── RowToListConverter.java │ │ │ │ │ ├── RowToMapConverter.java │ │ │ │ │ └── package-info.java │ │ │ │ ├── generator │ │ │ │ │ ├── AddColumnCqlGenerator.java │ │ │ │ │ ├── AlterColumnCqlGenerator.java │ │ │ │ │ ├── AlterKeyspaceCqlGenerator.java │ │ │ │ │ ├── AlterTableCqlGenerator.java │ │ │ │ │ ├── AlterUserTypeCqlGenerator.java │ │ │ │ │ ├── ColumnChangeCqlGenerator.java │ │ │ │ │ ├── CqlGenerator.java │ │ │ │ │ ├── CqlIdentifierUtil.java │ │ │ │ │ ├── CreateIndexCqlGenerator.java │ │ │ │ │ ├── CreateKeyspaceCqlGenerator.java │ │ │ │ │ ├── CreateTableCqlGenerator.java │ │ │ │ │ ├── CreateUserTypeCqlGenerator.java │ │ │ │ │ ├── DropColumnCqlGenerator.java │ │ │ │ │ ├── DropIndexCqlGenerator.java │ │ │ │ │ ├── DropKeyspaceCqlGenerator.java │ │ │ │ │ ├── DropTableCqlGenerator.java │ │ │ │ │ ├── DropUserTypeCqlGenerator.java │ │ │ │ │ ├── IndexNameCqlGenerator.java │ │ │ │ │ ├── KeyspaceNameCqlGenerator.java │ │ │ │ │ ├── KeyspaceOptionsCqlGenerator.java │ │ │ │ │ ├── OptionRenderUtil.java │ │ │ │ │ ├── RenameColumnCqlGenerator.java │ │ │ │ │ ├── TableNameCqlGenerator.java │ │ │ │ │ ├── TableOptionsCqlGenerator.java │ │ │ │ │ ├── UserTypeNameCqlGenerator.java │ │ │ │ │ └── package-info.java │ │ │ │ ├── keyspace │ │ │ │ │ ├── AddColumnSpecification.java │ │ │ │ │ ├── AlterColumnSpecification.java │ │ │ │ │ ├── AlterKeyspaceSpecification.java │ │ │ │ │ ├── AlterTableSpecification.java │ │ │ │ │ ├── AlterUserTypeSpecification.java │ │ │ │ │ ├── ColumnChangeSpecification.java │ │ │ │ │ ├── ColumnSpecification.java │ │ │ │ │ ├── ColumnTypeChangeSpecification.java │ │ │ │ │ ├── CqlSpecification.java │ │ │ │ │ ├── CqlStringUtils.java │ │ │ │ │ ├── CreateIndexSpecification.java │ │ │ │ │ ├── CreateKeyspaceSpecification.java │ │ │ │ │ ├── CreateTableSpecification.java │ │ │ │ │ ├── CreateUserTypeSpecification.java │ │ │ │ │ ├── DataCenterReplication.java │ │ │ │ │ ├── DefaultOption.java │ │ │ │ │ ├── DropColumnSpecification.java │ │ │ │ │ ├── DropIndexSpecification.java │ │ │ │ │ ├── DropKeyspaceSpecification.java │ │ │ │ │ ├── DropTableSpecification.java │ │ │ │ │ ├── DropUserTypeSpecification.java │ │ │ │ │ ├── FieldSpecification.java │ │ │ │ │ ├── IndexDescriptor.java │ │ │ │ │ ├── IndexNameSpecification.java │ │ │ │ │ ├── KeyspaceActionSpecification.java │ │ │ │ │ ├── KeyspaceAttributes.java │ │ │ │ │ ├── KeyspaceDescriptor.java │ │ │ │ │ ├── KeyspaceOption.java │ │ │ │ │ ├── KeyspaceOptionsSpecification.java │ │ │ │ │ ├── Option.java │ │ │ │ │ ├── RenameColumnSpecification.java │ │ │ │ │ ├── SpecificationBuilder.java │ │ │ │ │ ├── TableDescriptor.java │ │ │ │ │ ├── TableNameSpecification.java │ │ │ │ │ ├── TableOption.java │ │ │ │ │ ├── TableOptionsSpecification.java │ │ │ │ │ ├── TableSpecification.java │ │ │ │ │ ├── UserTypeNameSpecification.java │ │ │ │ │ ├── UserTypeSpecification.java │ │ │ │ │ └── package-info.java │ │ │ │ ├── package-info.java │ │ │ │ ├── session │ │ │ │ │ ├── DefaultBridgedReactiveSession.java │ │ │ │ │ ├── DefaultReactiveSessionFactory.java │ │ │ │ │ ├── DefaultSessionFactory.java │ │ │ │ │ ├── init │ │ │ │ │ │ ├── CannotReadScriptException.java │ │ │ │ │ │ ├── CompositeKeyspacePopulator.java │ │ │ │ │ │ ├── KeyspacePopulator.java │ │ │ │ │ │ ├── ResourceKeyspacePopulator.java │ │ │ │ │ │ ├── ScriptException.java │ │ │ │ │ │ ├── ScriptParseException.java │ │ │ │ │ │ ├── ScriptStatementFailedException.java │ │ │ │ │ │ ├── ScriptUtils.java │ │ │ │ │ │ ├── SessionFactoryInitializer.java │ │ │ │ │ │ ├── UncategorizedScriptException.java │ │ │ │ │ │ └── package-info.java │ │ │ │ │ ├── lookup │ │ │ │ │ │ ├── AbstractRoutingSessionFactory.java │ │ │ │ │ │ ├── BeanFactorySessionFactoryLookup.java │ │ │ │ │ │ ├── MapSessionFactoryLookup.java │ │ │ │ │ │ ├── SessionFactoryLookup.java │ │ │ │ │ │ ├── SessionFactoryLookupFailureException.java │ │ │ │ │ │ ├── SingleSessionFactoryLookup.java │ │ │ │ │ │ └── package-info.java │ │ │ │ │ └── package-info.java │ │ │ │ ├── support │ │ │ │ │ ├── CachedPreparedStatementCreator.java │ │ │ │ │ ├── MapPreparedStatementCache.java │ │ │ │ │ ├── PreparedStatementCache.java │ │ │ │ │ └── package-info.java │ │ │ │ └── util │ │ │ │ │ ├── Bindings.java │ │ │ │ │ ├── StatementBuilder.java │ │ │ │ │ ├── TermFactory.java │ │ │ │ │ └── package-info.java │ │ │ ├── mapping │ │ │ │ ├── AnnotatedCassandraConstructorProperty.java │ │ │ │ ├── BasicCassandraMappingContext.java │ │ │ │ ├── BasicCassandraPersistentEntity.java │ │ │ │ ├── BasicCassandraPersistentEntityMetadataVerifier.java │ │ │ │ ├── BasicCassandraPersistentProperty.java │ │ │ │ ├── BasicCassandraPersistentTupleEntity.java │ │ │ │ ├── BasicCassandraPersistentTupleProperty.java │ │ │ │ ├── BasicMapId.java │ │ │ │ ├── CachingCassandraPersistentProperty.java │ │ │ │ ├── CassandraColumnAnnotationComparator.java │ │ │ │ ├── CassandraConstructorProperty.java │ │ │ │ ├── CassandraMappingContext.java │ │ │ │ ├── CassandraPersistentEntity.java │ │ │ │ ├── CassandraPersistentEntityMetadataVerifier.java │ │ │ │ ├── CassandraPersistentProperty.java │ │ │ │ ├── CassandraPersistentPropertyComparator.java │ │ │ │ ├── CassandraPersistentTupleMetadataVerifier.java │ │ │ │ ├── CassandraPrimaryKeyColumnAnnotationComparator.java │ │ │ │ ├── CassandraSimpleTypeHolder.java │ │ │ │ ├── CassandraType.java │ │ │ │ ├── CassandraUserTypePersistentEntity.java │ │ │ │ ├── CodecRegistryTupleTypeFactory.java │ │ │ │ ├── Column.java │ │ │ │ ├── CompositeCassandraPersistentEntityMetadataVerifier.java │ │ │ │ ├── CqlIdentifierGenerator.java │ │ │ │ ├── Element.java │ │ │ │ ├── Embedded.java │ │ │ │ ├── EmbeddedEntityOperations.java │ │ │ │ ├── EntityMapping.java │ │ │ │ ├── Frozen.java │ │ │ │ ├── IdInterfaceException.java │ │ │ │ ├── IdInterfaceExceptions.java │ │ │ │ ├── IdInterfaceValidator.java │ │ │ │ ├── Indexed.java │ │ │ │ ├── MapId.java │ │ │ │ ├── MapIdFactory.java │ │ │ │ ├── MapIdProxyDelegate.java │ │ │ │ ├── MapIdentifiable.java │ │ │ │ ├── Mapping.java │ │ │ │ ├── NamingStrategy.java │ │ │ │ ├── PersistentPropertyTranslator.java │ │ │ │ ├── PrimaryKey.java │ │ │ │ ├── PrimaryKeyClass.java │ │ │ │ ├── PrimaryKeyClassEntityMetadataVerifier.java │ │ │ │ ├── PrimaryKeyColumn.java │ │ │ │ ├── PropertyMapping.java │ │ │ │ ├── SASI.java │ │ │ │ ├── SaiIndexed.java │ │ │ │ ├── SimilarityFunction.java │ │ │ │ ├── SimpleTupleTypeFactory.java │ │ │ │ ├── SimpleUserTypeResolver.java │ │ │ │ ├── SnakeCaseNamingStrategy.java │ │ │ │ ├── Table.java │ │ │ │ ├── TransformingNamingStrategy.java │ │ │ │ ├── Tuple.java │ │ │ │ ├── TupleTypeFactory.java │ │ │ │ ├── UnsupportedCassandraOperationException.java │ │ │ │ ├── UserDefinedType.java │ │ │ │ ├── UserTypeResolver.java │ │ │ │ ├── VectorType.java │ │ │ │ ├── VerifierMappingExceptions.java │ │ │ │ ├── event │ │ │ │ │ ├── AbstractCassandraEventListener.java │ │ │ │ │ ├── AbstractDeleteEvent.java │ │ │ │ │ ├── AbstractStatementAwareMappingEvent.java │ │ │ │ │ ├── AfterConvertEvent.java │ │ │ │ │ ├── AfterDeleteEvent.java │ │ │ │ │ ├── AfterLoadEvent.java │ │ │ │ │ ├── AfterSaveEvent.java │ │ │ │ │ ├── AuditingEntityCallback.java │ │ │ │ │ ├── BeforeConvertCallback.java │ │ │ │ │ ├── BeforeDeleteEvent.java │ │ │ │ │ ├── BeforeSaveCallback.java │ │ │ │ │ ├── BeforeSaveEvent.java │ │ │ │ │ ├── CassandraMappingEvent.java │ │ │ │ │ ├── ReactiveAuditingEntityCallback.java │ │ │ │ │ ├── ReactiveBeforeConvertCallback.java │ │ │ │ │ ├── ReactiveBeforeSaveCallback.java │ │ │ │ │ └── package-info.java │ │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ └── query │ │ │ │ ├── CassandraPageRequest.java │ │ │ │ ├── CassandraScrollPosition.java │ │ │ │ ├── ColumnName.java │ │ │ │ ├── Columns.java │ │ │ │ ├── Criteria.java │ │ │ │ ├── CriteriaDefinition.java │ │ │ │ ├── DefaultFilter.java │ │ │ │ ├── Filter.java │ │ │ │ ├── Query.java │ │ │ │ ├── SerializationUtils.java │ │ │ │ ├── Update.java │ │ │ │ ├── VectorSort.java │ │ │ │ └── package-info.java │ │ │ ├── observability │ │ │ ├── CassandraObservation.java │ │ │ ├── CassandraObservationContext.java │ │ │ ├── CassandraObservationConvention.java │ │ │ ├── CassandraObservationSupplier.java │ │ │ ├── CqlSessionObservationInterceptor.java │ │ │ ├── DefaultCassandraObservationConvention.java │ │ │ ├── ObservableCqlSessionFactory.java │ │ │ ├── ObservableCqlSessionFactoryBean.java │ │ │ ├── ObservableReactiveSession.java │ │ │ ├── ObservableReactiveSessionFactory.java │ │ │ ├── ObservableReactiveSessionFactoryBean.java │ │ │ ├── ObservationRequestTracker.java │ │ │ ├── ObservationStatement.java │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ ├── repository │ │ │ ├── AllowFiltering.java │ │ │ ├── CassandraRepository.java │ │ │ ├── Consistency.java │ │ │ ├── CountQuery.java │ │ │ ├── ExistsQuery.java │ │ │ ├── MapIdCassandraRepository.java │ │ │ ├── Query.java │ │ │ ├── ReactiveCassandraRepository.java │ │ │ ├── cdi │ │ │ │ ├── CassandraRepositoryBean.java │ │ │ │ ├── CassandraRepositoryExtension.java │ │ │ │ └── package-info.java │ │ │ ├── config │ │ │ │ ├── CassandraRepositoriesRegistrar.java │ │ │ │ ├── CassandraRepositoryConfigurationExtension.java │ │ │ │ ├── CassandraRepositoryNamespaceHandler.java │ │ │ │ ├── EnableCassandraRepositories.java │ │ │ │ ├── EnableReactiveCassandraRepositories.java │ │ │ │ ├── ReactiveCassandraRepositoriesRegistrar.java │ │ │ │ ├── ReactiveCassandraRepositoryConfigurationExtension.java │ │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ ├── query │ │ │ │ ├── AbstractCassandraQuery.java │ │ │ │ ├── AbstractReactiveCassandraQuery.java │ │ │ │ ├── BindingContext.java │ │ │ │ ├── CassandraEntityInformation.java │ │ │ │ ├── CassandraEntityMetadata.java │ │ │ │ ├── CassandraParameterAccessor.java │ │ │ │ ├── CassandraParameters.java │ │ │ │ ├── CassandraParametersParameterAccessor.java │ │ │ │ ├── CassandraQueryCreator.java │ │ │ │ ├── CassandraQueryExecution.java │ │ │ │ ├── CassandraQueryMethod.java │ │ │ │ ├── CassandraRepositoryQuerySupport.java │ │ │ │ ├── ContextualValueExpressionEvaluator.java │ │ │ │ ├── ConvertingParameterAccessor.java │ │ │ │ ├── PartTreeCassandraQuery.java │ │ │ │ ├── ProjectionUtil.java │ │ │ │ ├── QueryStatementCreator.java │ │ │ │ ├── ReactiveCassandraParameterAccessor.java │ │ │ │ ├── ReactiveCassandraQueryExecution.java │ │ │ │ ├── ReactiveCassandraQueryMethod.java │ │ │ │ ├── ReactivePartTreeCassandraQuery.java │ │ │ │ ├── ReactiveStringBasedCassandraQuery.java │ │ │ │ ├── SimpleCassandraEntityMetadata.java │ │ │ │ ├── StringBasedCassandraQuery.java │ │ │ │ ├── StringBasedQuery.java │ │ │ │ ├── WindowUtil.java │ │ │ │ └── package-info.java │ │ │ └── support │ │ │ │ ├── CachingExpressionParser.java │ │ │ │ ├── CassandraRepositoryFactory.java │ │ │ │ ├── CassandraRepositoryFactoryBean.java │ │ │ │ ├── CassandraRepositoryFragmentsContributor.java │ │ │ │ ├── EmptyFragmentsContributor.java │ │ │ │ ├── FindByIdQuery.java │ │ │ │ ├── MappingCassandraEntityInformation.java │ │ │ │ ├── ReactiveCassandraRepositoryFactory.java │ │ │ │ ├── ReactiveCassandraRepositoryFactoryBean.java │ │ │ │ ├── ReactiveCassandraRepositoryFragmentsContributor.java │ │ │ │ ├── ReactiveEmptyFragmentsContributor.java │ │ │ │ ├── SimpleCassandraRepository.java │ │ │ │ ├── SimpleReactiveCassandraRepository.java │ │ │ │ └── package-info.java │ │ │ └── util │ │ │ ├── MapBuilder.java │ │ │ ├── SpelUtils.java │ │ │ └── package-info.java │ ├── kotlin │ │ └── org │ │ │ └── springframework │ │ │ └── data │ │ │ └── cassandra │ │ │ └── core │ │ │ ├── AsyncCassandraOperationsExtensions.kt │ │ │ ├── CassandraOperationsExtensions.kt │ │ │ ├── ExecutableDeleteOperationExtensions.kt │ │ │ ├── ExecutableInsertOperationExtensions.kt │ │ │ ├── ExecutableSelectOperationExtensions.kt │ │ │ ├── ExecutableUpdateOperationExtensions.kt │ │ │ ├── ReactiveCassandraOperationsExtensions.kt │ │ │ ├── ReactiveDeleteOperationExtensions.kt │ │ │ ├── ReactiveInsertOperationExtensions.kt │ │ │ ├── ReactiveSelectOperationExtensions.kt │ │ │ ├── ReactiveUpdateOperationExtensions.kt │ │ │ ├── cql │ │ │ ├── AsyncCqlOperationsExtensions.kt │ │ │ ├── CqlOperationsExtensions.kt │ │ │ ├── DataClassRowMapperExtensions.kt │ │ │ └── ReactiveCqlOperationsExtensions.kt │ │ │ └── query │ │ │ ├── CriteriaExtensions.kt │ │ │ └── QueryExtensions.kt │ └── resources │ │ ├── META-INF │ │ ├── services │ │ │ └── jakarta.enterprise.inject.spi.Extension │ │ ├── spring.factories │ │ ├── spring.handlers │ │ ├── spring.schemas │ │ ├── spring.tooling │ │ └── spring │ │ │ └── aot.factories │ │ └── org │ │ └── springframework │ │ └── data │ │ └── cassandra │ │ └── config │ │ ├── spring-cassandra-1.0.xsd │ │ ├── spring-cassandra-1.5.xsd │ │ ├── spring-cassandra-2.0.xsd │ │ ├── spring-cassandra-2.2.xsd │ │ ├── spring-cassandra-3.0.xsd │ │ ├── spring-cassandra-4.0.xsd │ │ ├── spring-cassandra.gif │ │ ├── spring-cql-1.0.xsd │ │ ├── spring-cql-1.5.xsd │ │ ├── spring-cql-2.0.xsd │ │ ├── spring-cql-2.2.xsd │ │ └── spring-cql.gif │ └── test │ ├── java │ └── org │ │ └── springframework │ │ └── data │ │ └── cassandra │ │ ├── aot │ │ ├── CassandraRuntimeHintsUnitTests.java │ │ └── CodeContributionAssert.java │ │ ├── config │ │ ├── AbstractAuditingTests.java │ │ ├── AbstractSessionConfigurationIntegrationTests.java │ │ ├── CassandraAuditingRegistrarIntegrationTests.java │ │ ├── CassandraAuditingRegistrarUnitTests.java │ │ ├── CassandraNamespaceIntegrationTests.java │ │ ├── ConfigIntegrationTests.java │ │ ├── CqlSessionFactoryBeanUnitTests.java │ │ ├── CqlTemplateConfigIntegrationTests.java │ │ ├── FullySpecifiedKeyspaceCreatingXmlConfigIntegrationTests.java │ │ ├── JavaConfigAuditingTests.java │ │ ├── KeyspaceActionSpecificationFactoryBeanUnitTests.java │ │ ├── LazyStartupConfigurationTest.java │ │ ├── MinimalKeyspaceCreatingXmlConfigIntegrationTests.java │ │ ├── MinimalXmlConfigIntegrationTests.java │ │ ├── NamespaceAuditingTests.java │ │ ├── ParsingUtilsUnitTests.java │ │ ├── ReactiveAuditingTests.java │ │ ├── ReactiveCassandraConfigurationIntegrationTests.java │ │ ├── SchemaActionIntegrationTests.java │ │ └── SchemaUtilsUnitTests.java │ │ ├── core │ │ ├── AsyncCassandraTemplateIntegrationTests.java │ │ ├── AsyncCassandraTemplatePreparedStatementsIntegrationTests.java │ │ ├── AsyncCassandraTemplateUnitTests.java │ │ ├── AsyncOptimisticLockingIntegrationTests.java │ │ ├── CassandraAdminTemplateIntegrationTests.java │ │ ├── CassandraBatchTemplateIntegrationTests.java │ │ ├── CassandraPersistentEntitySchemaCreatorUnitTests.java │ │ ├── CassandraPersistentEntitySchemaDropperUnitTests.java │ │ ├── CassandraPersistentEntitySchemaTestSupport.java │ │ ├── CassandraTemplateIntegrationTests.java │ │ ├── CassandraTemplateMapIdIntegrationTest.java │ │ ├── CassandraTemplateMapIdProxyDelegateIntegrationTests.java │ │ ├── CassandraTemplatePreparedStatementIntegrationTests.java │ │ ├── CassandraTemplateUnitTests.java │ │ ├── CassandraVectorSearchIntegrationTests.java │ │ ├── DeleteOptionsUnitTests.java │ │ ├── EntityQueryUtilsUnitTests.java │ │ ├── ExecutableDeleteOperationSupportIntegrationTests.java │ │ ├── ExecutableInsertOperationSupportIntegrationTests.java │ │ ├── ExecutableSelectOperationSupportIntegrationTests.java │ │ ├── ExecutableUpdateOperationSupportIntegrationTests.java │ │ ├── InsertOptionsUnitTests.java │ │ ├── MultipleKeyspacesIntegrationTests.java │ │ ├── OptimisticLockingIntegrationTests.java │ │ ├── QueryResultConverterUnitTests.java │ │ ├── ReactiveCassandraBatchTemplateIntegrationTests.java │ │ ├── ReactiveCassandraTemplateIntegrationTests.java │ │ ├── ReactiveCassandraTemplatePreparedStatementIntegrationTests.java │ │ ├── ReactiveCassandraTemplateUnitTests.java │ │ ├── ReactiveDeleteOperationSupportIntegrationTests.java │ │ ├── ReactiveInsertOperationSupportIntegrationTests.java │ │ ├── ReactiveOptimisticLockingIntegrationTests.java │ │ ├── ReactiveSelectOperationSupportIntegrationTests.java │ │ ├── ReactiveUpdateOperationSupportIntegrationTests.java │ │ ├── StatementFactoryUnitTests.java │ │ ├── UpdateOptionsUnitTests.java │ │ ├── convert │ │ │ ├── CassandraJsr310ConvertersUnitTests.java │ │ │ ├── CassandraTypeMappingIntegrationTests.java │ │ │ ├── ColumnTypeResolverUnitTests.java │ │ │ ├── CounterEntity.java │ │ │ ├── CurrencyConverter.java │ │ │ ├── CustomConversionIntegrationTests.java │ │ │ ├── IndexCreationIntegrationTests.java │ │ │ ├── IndexSpecificationFactoryUnitTests.java │ │ │ ├── MappingCassandraConverterMappedTupleUnitTests.java │ │ │ ├── MappingCassandraConverterTupleIntegrationTests.java │ │ │ ├── MappingCassandraConverterUDTIntegrationTests.java │ │ │ ├── MappingCassandraConverterUDTUnitTests.java │ │ │ ├── MappingCassandraConverterUnitTests.java │ │ │ ├── QueryMapperUnitTests.java │ │ │ ├── RowReaderUnitTests.java │ │ │ ├── SchemaFactoryUnitTests.java │ │ │ ├── TimeEntity.java │ │ │ └── UpdateMapperUnitTests.java │ │ ├── cql │ │ │ ├── AsyncCqlTemplateIntegrationTests.java │ │ │ ├── AsyncCqlTemplateUnitTests.java │ │ │ ├── AsyncResultStreamUnitTests.java │ │ │ ├── BeanPropertyRowMapperUnitTests.java │ │ │ ├── CachedPreparedStatementCreatorUnitTests.java │ │ │ ├── CassandraAccessorUnitTests.java │ │ │ ├── CassandraExceptionTranslatorUnitTests.java │ │ │ ├── CqlIdentifierUnitTests.java │ │ │ ├── CqlTemplateIntegrationTests.java │ │ │ ├── CqlTemplateUnitTests.java │ │ │ ├── DefaultBridgedReactiveSessionIntegrationTests.java │ │ │ ├── DefaultBridgedReactiveSessionUnitTests.java │ │ │ ├── ExecutionProfileResolverUnitTests.java │ │ │ ├── QueryOptionsUnitTests.java │ │ │ ├── QueryOptionsUtilUnitTests.java │ │ │ ├── ReactiveCqlTemplateIntegrationTests.java │ │ │ ├── ReactiveCqlTemplateUnitTests.java │ │ │ ├── SingleColumnRowMapperUnitTests.java │ │ │ ├── WriteOptionsUnitTests.java │ │ │ ├── generator │ │ │ │ ├── AbstractIndexOperationCqlGeneratorTest.java │ │ │ │ ├── AbstractKeyspaceOperationCqlGeneratorTest.java │ │ │ │ ├── AbstractTableOperationCqlGeneratorTest.java │ │ │ │ ├── AlterKeyspaceCqlGeneratorUnitTests.java │ │ │ │ ├── AlterTableCqlGeneratorIntegrationTests.java │ │ │ │ ├── AlterTableCqlGeneratorUnitTests.java │ │ │ │ ├── AlterUserTypeCqlGeneratorIntegrationTests.java │ │ │ │ ├── AlterUserTypeCqlGeneratorUnitTests.java │ │ │ │ ├── CqlIndexSpecificationAssertions.java │ │ │ │ ├── CqlKeyspaceSpecificationAssertions.java │ │ │ │ ├── CreateIndexCqlGeneratorUnitTests.java │ │ │ │ ├── CreateKeyspaceCqlGeneratorIntegrationTests.java │ │ │ │ ├── CreateKeyspaceCqlGeneratorUnitTests.java │ │ │ │ ├── CreateTableCqlGeneratorIntegrationTests.java │ │ │ │ ├── CreateTableCqlGeneratorUnitTests.java │ │ │ │ ├── CreateUserTypeCqlGeneratorIntegrationTests.java │ │ │ │ ├── CreateUserTypeCqlGeneratorUnitTests.java │ │ │ │ ├── DropIndexCqlGeneratorUnitTests.java │ │ │ │ ├── DropKeyspaceCqlGeneratorUnitTests.java │ │ │ │ ├── DropTableCqlGeneratorUnitTests.java │ │ │ │ └── DropUserTypeCqlGeneratorUnitTests.java │ │ │ ├── keyspace │ │ │ │ └── OptionUnitTests.java │ │ │ ├── lookup │ │ │ │ ├── AbstractRoutingSessionFactoryUnitTests.java │ │ │ │ ├── BeanFactorySessionFactoryLookupUnitTests.java │ │ │ │ ├── MapSessionFactoryLookupUnitTests.java │ │ │ │ └── SingleSessionFactoryLookupUnitTests.java │ │ │ ├── session │ │ │ │ └── init │ │ │ │ │ ├── CompositeKeyspacePopulatorUnitTests.java │ │ │ │ │ ├── ResourceKeyspacePopulatorUnitTests.java │ │ │ │ │ ├── ScriptUtilsUnitTests.java │ │ │ │ │ └── SessionFactoryInitializerTests.java │ │ │ ├── support │ │ │ │ ├── CachedPreparedStatementCreatorIntegrationTests.java │ │ │ │ └── CachedPreparedStatementCreatorUnitTests.java │ │ │ └── util │ │ │ │ └── StatementBuilderUnitTests.java │ │ ├── mapping │ │ │ ├── BasicCassandraPersistentEntityMetadataVerifierUnitTests.java │ │ │ ├── BasicCassandraPersistentEntityUnitTests.java │ │ │ ├── BasicCassandraPersistentPropertyUnitTests.java │ │ │ ├── BasicCassandraPersistentTupleEntityUnitTests.java │ │ │ ├── BasicCassandraPersistentTuplePropertyUnitTests.java │ │ │ ├── BasicMapIdUnitTests.java │ │ │ ├── CassandraCompositePrimaryKeyUnitTests.java │ │ │ ├── CassandraMappingContextUnitTests.java │ │ │ ├── CassandraPersistentEntityOrderPropertiesUnitTests.java │ │ │ ├── CassandraPersistentPropertyComparatorUnitTests.java │ │ │ ├── CassandraPrimaryKeyColumnAnnotationComparatorUnitTests.java │ │ │ ├── CassandraSimpleTypeHolderUnitTests.java │ │ │ ├── CassandraUserTypePersistentEntityUnitTests.java │ │ │ ├── CompositeCassandraPersistentEntityMetadataVerifierUnitTests.java │ │ │ ├── CompoundPrimaryKeyUnitTests.java │ │ │ ├── CreateUserTypeIntegrationTests.java │ │ │ ├── ForceQuotedEntitiesSimpleUnitTests.java │ │ │ ├── ForceQuotedPropertiesSimpleUnitTests.java │ │ │ ├── MapIdFactoryUnitTests.java │ │ │ ├── NamingStrategyUnitTests.java │ │ │ ├── PrimaryKeyClassEntityMetadataVerifierUnitTests.java │ │ │ ├── SnakeCaseNamingStrategyUnitTests.java │ │ │ ├── event │ │ │ │ ├── AsyncCassandraTemplateEventIntegrationTests.java │ │ │ │ ├── AuditingEntityCallbackUnitTests.java │ │ │ │ ├── CassandraTemplateEventIntegrationTests.java │ │ │ │ ├── EventListenerIntegrationTestSupport.java │ │ │ │ ├── ReactiveAuditingEntityCallbackUnitTests.java │ │ │ │ └── ReactiveEventListenerIntegrationTestSupport.java │ │ │ └── multipackagescanning │ │ │ │ ├── MultipackageScanningUnitTests.java │ │ │ │ ├── Top.java │ │ │ │ ├── first │ │ │ │ └── First.java │ │ │ │ ├── second │ │ │ │ └── Second.java │ │ │ │ └── third │ │ │ │ └── Third.java │ │ └── query │ │ │ ├── CassandraPageRequestUnitTests.java │ │ │ ├── ColumnNameUnitTests.java │ │ │ ├── ColumnsUnitTests.java │ │ │ ├── CriteriaUnitTests.java │ │ │ ├── QueryUnitTests.java │ │ │ └── UpdateUnitTests.java │ │ ├── domain │ │ ├── AddressType.java │ │ ├── AllPossibleTypes.java │ │ ├── BookReference.java │ │ ├── CompositeKey.java │ │ ├── FlatGroup.java │ │ ├── Group.java │ │ ├── GroupKey.java │ │ ├── Person.java │ │ ├── TypeWithCompositeKey.java │ │ ├── TypeWithKeyClass.java │ │ ├── TypeWithMapId.java │ │ ├── User.java │ │ ├── UserToken.java │ │ └── VersionedUser.java │ │ ├── observability │ │ ├── ImperativeIntegrationTests.java │ │ ├── ObservableCqlSessionFactoryUnitTests.java │ │ ├── ObservableReactiveSessionFactoryBeanUnitTests.java │ │ ├── ObservationRequestTrackerUnitTests.java │ │ ├── ReactiveIntegrationTests.java │ │ └── TestConfig.java │ │ ├── repository │ │ ├── BigIntParamIntegrationTests.java │ │ ├── ConvertingReactiveCassandraRepositoryTests.java │ │ ├── DateKeyIntegrationTests.java │ │ ├── IntParamIntegrationTests.java │ │ ├── NamedQueryIntegrationTests.java │ │ ├── QueryDerivationIntegrationTests.java │ │ ├── ReactiveCassandraRepositoryIntegrationTests.java │ │ ├── ReactiveVectorSearchIntegrationTests.java │ │ ├── VectorSearchIntegrationTests.java │ │ ├── cdi │ │ │ ├── CassandraOperationsProducer.java │ │ │ ├── CdiRepositoryClient.java │ │ │ ├── CdiRepositoryTests.java │ │ │ ├── CdiUserRepository.java │ │ │ ├── OtherQualifier.java │ │ │ ├── QualifiedUserRepository.java │ │ │ ├── SamplePersonFragment.java │ │ │ ├── SamplePersonFragmentImpl.java │ │ │ ├── SamplePersonRepository.java │ │ │ └── UserDB.java │ │ ├── config │ │ │ ├── CassandraRepositoriesRegistrarUnitTests.java │ │ │ ├── CassandraRepositoryConfigurationExtensionUnitTests.java │ │ │ ├── ReactiveCassandraRepositoriesRegistrarUnitTests.java │ │ │ └── ReactiveCassandraRepositoryConfigurationExtensionUnitTests.java │ │ ├── conversion │ │ │ ├── Address.java │ │ │ ├── Contact.java │ │ │ ├── DerivedQueryMethodsParameterConversionIntegrationTests.java │ │ │ ├── ParameterConversionTestSupport.java │ │ │ ├── Phone.java │ │ │ └── StringQueryMethodsParameterConversionIntegrationTests.java │ │ ├── forcequote │ │ │ ├── compositeprimarykey │ │ │ │ ├── CompositeKeyCrudIntegrationTests.java │ │ │ │ ├── Explicit.java │ │ │ │ ├── ExplicitKey.java │ │ │ │ ├── ExplicitRepository.java │ │ │ │ ├── ForceQuotedCompositePrimaryKeyRepositoryIntegrationTestsDelegator.java │ │ │ │ ├── ForceQuotedCompositePrimaryKeyRepositoryJavaConfigIntegrationTests.java │ │ │ │ ├── ForceQuotedCompositePrimaryKeyRepositoryTests.java │ │ │ │ ├── ForceQuotedCompositePrimaryKeyRepositoryXmlConfigIntegrationTests.java │ │ │ │ ├── Implicit.java │ │ │ │ ├── ImplicitKey.java │ │ │ │ ├── ImplicitRepository.java │ │ │ │ └── entity │ │ │ │ │ └── CorrelationEntity.java │ │ │ └── config │ │ │ │ ├── Explicit.java │ │ │ │ ├── ExplicitProperties.java │ │ │ │ ├── ExplicitPropertiesRepository.java │ │ │ │ ├── ExplicitRepository.java │ │ │ │ ├── ForceQuotedRepositoryIntegrationTests.java │ │ │ │ ├── ForceQuotedRepositoryJavaConfigIntegrationTests.java │ │ │ │ ├── ForceQuotedRepositoryTests.java │ │ │ │ ├── ForceQuotedRepositoryXmlConfigIntegrationTests.java │ │ │ │ ├── Implicit.java │ │ │ │ ├── ImplicitProperties.java │ │ │ │ ├── ImplicitPropertiesRepository.java │ │ │ │ └── ImplicitRepository.java │ │ ├── isolated │ │ │ ├── RepositoryQueryMethodParameterTypesIntegrationTests.java │ │ │ └── RepositoryReturnTypesIntegrationTests.java │ │ ├── mapid │ │ │ ├── MultiPrimaryKeyColumns.java │ │ │ ├── MultiPrimaryKeyColumnsRepository.java │ │ │ ├── RepositoryMapIdIntegrationTests.java │ │ │ ├── SinglePrimaryKecColumnRepository.java │ │ │ └── SinglePrimaryKeyColumn.java │ │ ├── query │ │ │ ├── AbstractCassandraQueryUnitTests.java │ │ │ ├── CassandraParametersParameterAccessorUnitTests.java │ │ │ ├── CassandraParametersUnitTests.java │ │ │ ├── CassandraQueryCreatorUnitTests.java │ │ │ ├── CassandraQueryMethodUnitTests.java │ │ │ ├── ConvertingParameterAccessorUnitTests.java │ │ │ ├── ParameterBindingParserUnitTests.java │ │ │ ├── PartTreeCassandraQueryUnitTests.java │ │ │ ├── ReactiveCassandraParameterAccessorUnitTests.java │ │ │ ├── ReactiveCassandraQueryMethodUnitTests.java │ │ │ ├── ReactivePartTreeCassandraQueryUnitTests.java │ │ │ ├── ReactiveStringBasedCassandraQueryUnitTests.java │ │ │ ├── StringBasedCassandraQueryUnitTests.java │ │ │ └── StubParameterAccessor.java │ │ └── support │ │ │ ├── AbstractSpringDataEmbeddedCassandraIntegrationTest.java │ │ │ ├── CassandraRepositoryFactoryUnitTests.java │ │ │ ├── IntegrationTestConfig.java │ │ │ ├── ReactiveCassandraRepositoryFactoryUnitTests.java │ │ │ ├── SchemaTestUtils.java │ │ │ ├── SharedCqlSessionFactoryBean.java │ │ │ ├── SimpleCassandraRepositoryCompositeIdIntegrationTests.java │ │ │ ├── SimpleCassandraRepositoryIntegrationTests.java │ │ │ ├── SimpleCassandraRepositoryUnitTests.java │ │ │ ├── SimpleReactiveCassandraRepositoryCompositeIdIntegrationTests.java │ │ │ ├── SimpleReactiveCassandraRepositoryIntegrationTests.java │ │ │ └── SimpleReactiveCassandraRepositoryUnitTests.java │ │ ├── support │ │ ├── AbstractTestJavaConfig.java │ │ ├── BeanDefinitionTestUtils.java │ │ ├── CassandraConnectionProperties.java │ │ ├── CassandraRepositoryFragmentsContributorUnitTests.java │ │ ├── CassandraVersion.java │ │ ├── CqlDataSet.java │ │ ├── KeyspaceTestUtils.java │ │ ├── RandomKeyspaceName.java │ │ ├── ReactiveCassandraRepositoryFragmentsContributorUnitTests.java │ │ └── UserDefinedTypeBuilder.java │ │ └── test │ │ └── util │ │ ├── AbstractKeyspaceCreatingIntegrationTests.java │ │ ├── CassandraDelegate.java │ │ ├── CassandraExtension.java │ │ ├── EmbeddedCassandraServerHelper.java │ │ ├── IntegrationTestsSupport.java │ │ ├── RowMockUtil.java │ │ ├── TestKeyspace.java │ │ ├── TestKeyspaceDelegate.java │ │ └── TestKeyspaceName.java │ ├── kotlin │ └── org │ │ └── springframework │ │ └── data │ │ └── cassandra │ │ ├── core │ │ ├── AsyncCassandraOperationsExtensionsUnitTests.kt │ │ ├── CassandraOperationsExtensionsUnitTests.kt │ │ ├── ExecutableDeleteOperationExtensionsUnitTests.kt │ │ ├── ExecutableInsertOperationExtensionsUnitTests.kt │ │ ├── ExecutableSelectOperationExtensionsUnitTests.kt │ │ ├── ExecutableUpdateOperationExtensionsUnitTests.kt │ │ ├── Person.kt │ │ ├── ReactiveCassandraOperationsExtensionsUnitTests.kt │ │ ├── ReactiveDeleteOperationExtensionsUnitTests.kt │ │ ├── ReactiveInsertOperationExtensionsUnitTests.kt │ │ ├── ReactiveSelectOperationExtensionsUnitTests.kt │ │ ├── ReactiveUpdateOperationExtensionsUnitTests.kt │ │ ├── cql │ │ │ ├── CqlOperationsExtensionsUnitTests.kt │ │ │ ├── DataClassRowMapperUnitTests.kt │ │ │ ├── LegacyAsyncCqlOperationsExtensionsUnitTests.kt │ │ │ └── ReactiveCqlOperationsExtensionsUnitTests.kt │ │ └── query │ │ │ ├── CriteriaExtensionsUnitTests.kt │ │ │ └── QueryExtensionsUnitTests.kt │ │ └── repository │ │ ├── CoroutineRepositoryUnitTests.kt │ │ └── query │ │ └── ReactiveCassandraQueryMethodCoroutineUnitTests.kt │ └── resources │ ├── META-INF │ ├── PersonRepositoryWithNamedQueries.properties │ └── cassandra-named-queries.properties │ ├── application.conf │ ├── cassandraOperationsTest-cql-cleanup.cql │ ├── cassandraOperationsTest-cql-dataload.cql │ ├── config │ ├── cassandra-connection.properties │ └── spring-data-cassandra-basic.xml │ ├── embedded-cassandra.yaml │ ├── integration │ └── cql │ │ └── generator │ │ ├── CreateIndexCqlGeneratorIntegrationTests-BasicTest-After.cql │ │ └── CreateIndexCqlGeneratorIntegrationTests-BasicTest.cql │ ├── logback.xml │ ├── org │ └── springframework │ │ └── data │ │ └── cassandra │ │ ├── config │ │ ├── CassandraNamespaceIntegrationTests-context.xml │ │ ├── FullySpecifiedKeyspaceCreatingXmlConfigIntegrationTests-context.xml │ │ ├── FullySpecifiedKeyspaceCreatingXmlConfigIntegrationTests.properties │ │ ├── MinimalKeyspaceCreatingXmlConfigIntegrationTests-context.xml │ │ ├── MinimalXmlConfigIntegrationTests-context.xml │ │ ├── NamespaceAuditingTests-context.xml │ │ ├── cassandra.properties │ │ ├── cluster-and-mock-session.xml │ │ ├── mock-session-converter.xml │ │ ├── mock-session-mapping-converter.xml │ │ ├── multiple-converters.xml │ │ ├── multiple-mapping-contexts.xml │ │ ├── multiple-session-factories.xml │ │ ├── multiple-sessions.xml │ │ ├── schema.cql │ │ └── two-keyspaces-namespace.xml │ │ ├── core │ │ └── cql │ │ │ └── session │ │ │ └── init │ │ │ ├── cleanup-schema.cql │ │ │ ├── db-test-data-multi-newline.cql │ │ │ ├── initialize-and-cleanup-keyspace.xml │ │ │ ├── initialize-keyspace.xml │ │ │ ├── schema.cql │ │ │ ├── test-data-with-comments-and-leading-tabs.cql │ │ │ ├── test-data-with-comments.cql │ │ │ ├── test-data-with-multi-line-comments.cql │ │ │ ├── test-data-with-multi-line-nested-comments.cql │ │ │ └── test-data-with-multi-prefix-comments.cql │ │ └── repository │ │ └── forcequote │ │ ├── compositeprimarykey │ │ └── ForceQuotedCompositePrimaryKeyRepositoryXmlConfigIntegrationTests-context.xml │ │ └── config │ │ └── ForceQuotedRepositoryXmlConfigIntegrationTests-context.xml │ └── testcontainer-cassandra-v5.yaml └── src └── main ├── antora ├── antora-playbook.yml ├── antora.yml ├── modules │ └── ROOT │ │ ├── examples │ │ ├── AppConfig.java │ │ ├── CassandraApplication.java │ │ ├── CassandraConfig.java │ │ ├── CassandraConfiguration.java │ │ ├── CassandraTemplateExamples.java │ │ ├── CassandraTemplateProducer.java │ │ ├── ConverterConfiguration.java │ │ ├── CqlTemplateExamples.java │ │ ├── CreateKeyspaceConfiguration.java │ │ ├── CustomizedCassandraConfiguration.java │ │ ├── EntityBasePackagesConfiguration.java │ │ ├── FactoryBeanAppConfig.java │ │ ├── KeyspacePopulatorConfiguration.java │ │ ├── KeyspacePopulatorFailureConfiguration.java │ │ ├── LoginEvent.java │ │ ├── LoginEventKey.java │ │ ├── NamingStrategyConfiguration.java │ │ ├── Person.java │ │ ├── PersonReadConverter.java │ │ ├── PersonWriteConverter.java │ │ ├── ReactiveCassandraApplication.java │ │ ├── ReactiveCassandraConfiguration.java │ │ ├── ReactiveCassandraTemplateExamples.java │ │ ├── ReactiveCqlTemplateExamples.java │ │ ├── RepositoryClient.java │ │ ├── ReversingValueConverter.java │ │ ├── SchemaConfiguration.java │ │ ├── SessionFactoryInitializerConfiguration.java │ │ ├── Specifications.java │ │ ├── VectorSearchExample.java │ │ └── mapping │ │ │ ├── Address.java │ │ │ ├── BeforeSaveListener.java │ │ │ ├── Coordinates.java │ │ │ ├── Person.java │ │ │ ├── PersonReadConverter.java │ │ │ └── PersonWithIndexes.java │ │ ├── nav.adoc │ │ ├── pages │ │ ├── cassandra.adoc │ │ ├── cassandra │ │ │ ├── auditing.adoc │ │ │ ├── configuration.adoc │ │ │ ├── converters.adoc │ │ │ ├── cql-template.adoc │ │ │ ├── events.adoc │ │ │ ├── getting-started.adoc │ │ │ ├── prepared-statements.adoc │ │ │ ├── property-converters.adoc │ │ │ ├── reactive-cassandra.adoc │ │ │ ├── repositories │ │ │ │ ├── cdi-integration.adoc │ │ │ │ ├── query-methods.adoc │ │ │ │ ├── repositories.adoc │ │ │ │ └── vector-search.adoc │ │ │ ├── schema-management.adoc │ │ │ ├── template.adoc │ │ │ └── value-expressions.adoc │ │ ├── commons │ │ │ └── upgrade.adoc │ │ ├── index.adoc │ │ ├── kotlin.adoc │ │ ├── kotlin │ │ │ ├── coroutines.adoc │ │ │ ├── extensions.adoc │ │ │ ├── null-safety.adoc │ │ │ ├── object-mapping.adoc │ │ │ └── requirements.adoc │ │ ├── migration-guide │ │ │ ├── migration-guide-1.5-to-2.0.adoc │ │ │ ├── migration-guide-2.2-to-3.0.adoc │ │ │ ├── migration-guide-3.0-to-4.0.adoc │ │ │ └── migration-guide-4.0-to-4.3.adoc │ │ ├── migration-guides.adoc │ │ ├── object-mapping.adoc │ │ ├── observability.adoc │ │ ├── observability │ │ │ ├── conventions.adoc │ │ │ ├── metrics.adoc │ │ │ └── spans.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 │ │ └── partials │ │ ├── vector-search-intro-include.adoc │ │ ├── vector-search-method-annotated-include.adoc │ │ ├── vector-search-method-derived-include.adoc │ │ ├── vector-search-model-include.adoc │ │ ├── vector-search-repository-include.adoc │ │ ├── vector-search-scoring-include.adoc │ │ └── vector-search.adoc └── resources │ └── antora-resources │ └── antora.yml └── resources ├── license.txt └── notice.txt /.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 | - [ ] 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. 10 | - [ ] You submit test cases (unit or integration tests) that back your changes. 11 | - [ ] 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). 12 | -------------------------------------------------------------------------------- /.github/dco.yml: -------------------------------------------------------------------------------- 1 | require: 2 | members: false 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | target 3 | bin 4 | build 5 | .gradle 6 | .springBeans 7 | *.iml 8 | *.ipr 9 | *.iws 10 | *.log 11 | .classpath 12 | .project 13 | .settings 14 | .cassandra 15 | .idea 16 | download 17 | work 18 | build/ 19 | node_modules 20 | node 21 | package-lock.json 22 | .mvn/.develocity 23 | -------------------------------------------------------------------------------- /.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-cassandra/e8d8f240d7e5f375929f6b59780cb5b87a383692/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Nov 07 09:47:18 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-cassandra[Spring Data Cassandra] 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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /setup-cassandra.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ -z ${CASSANDRA_VERSION+x} ]; then 4 | CASSANDRA_VERSION=3.11.12 5 | fi 6 | 7 | if [[ ! -d download ]] ; then 8 | mkdir -p download 9 | fi 10 | 11 | FILENAME="apache-cassandra-${CASSANDRA_VERSION}-bin.tar.gz" 12 | 13 | echo "[INFO] Downloading ${FILENAME}" 14 | if [[ ! -f download/${FILENAME} ]] ; then 15 | mkdir -p download 16 | wget https://archive.apache.org/dist/cassandra/${CASSANDRA_VERSION}/${FILENAME} -O download/${FILENAME} 17 | if [[ $? != 0 ]] ; then 18 | echo "[ERROR] Download failed" 19 | exit 1 20 | fi 21 | fi 22 | 23 | 24 | if [[ ! -d work ]] ; then 25 | mkdir -p work 26 | fi 27 | 28 | BASENAME=apache-cassandra-${CASSANDRA_VERSION} 29 | if [[ ! -d work/${BASENAME} ]] ; then 30 | 31 | echo "[INFO] Extracting ${FILENAME}" 32 | mkdir -p work/${BASENAME} 33 | cd work 34 | 35 | tar xzf ../download/${FILENAME} 36 | if [[ $? != 0 ]] ; then 37 | echo "[ERROR] Extraction failed" 38 | exit 1 39 | fi 40 | cd .. 41 | fi 42 | 43 | cd work/${BASENAME} 44 | 45 | echo "[INFO] Cleaning data directory" 46 | rm -Rf data 47 | mkdir -p data 48 | 49 | echo "[INFO] Starting Apache Cassandra ${CASSANDRA_VERSION}" 50 | export MAX_HEAP_SIZE=1500M 51 | export HEAP_NEWSIZE=300M 52 | bin/cassandra 53 | 54 | for start in {1..20} 55 | do 56 | nc -w 1 localhost 9042 all tables in the keyspace, then create each table as necessary. 49 | */ 50 | RECREATE_DROP_UNUSED 51 | 52 | } 53 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/config/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Spring Data Cassandra {@link org.springframework.beans.factory.FactoryBean factory beans} and configuration. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.cassandra.config; 6 | 7 | 8 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/EntityResultConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 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.cassandra.core; 17 | 18 | import com.datastax.oss.driver.api.core.cql.Row; 19 | 20 | enum EntityResultConverter implements QueryResultConverter { 21 | 22 | INSTANCE; 23 | 24 | @Override 25 | public Object mapRow(Row row, ConversionResultSupplier reader) { 26 | return reader.get(); 27 | } 28 | 29 | @Override 30 | public QueryResultConverter andThen(QueryResultConverter after) { 31 | return (QueryResultConverter) after; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/FluentCassandraOperations.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 | package org.springframework.data.cassandra.core; 17 | 18 | /** 19 | * Stripped down interface providing access to a fluent API that specifies a basic set of Cassandra operations. 20 | * 21 | * @author Mark Paluch 22 | * @since 2.1 23 | * @see CassandraOperations 24 | */ 25 | public interface FluentCassandraOperations extends ExecutableSelectOperation, ExecutableInsertOperation, 26 | ExecutableUpdateOperation, ExecutableDeleteOperation {} 27 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/ReactiveFluentCassandraOperations.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 | package org.springframework.data.cassandra.core; 17 | 18 | /** 19 | * Stripped down interface providing access to a fluent API that specifies a basic set of reactive Cassandra operations. 20 | * 21 | * @author Mark Paluch 22 | * @since 2.1 23 | * @see ReactiveCassandraOperations 24 | */ 25 | public interface ReactiveFluentCassandraOperations 26 | extends ReactiveSelectOperation, ReactiveInsertOperation, ReactiveUpdateOperation, ReactiveDeleteOperation {} 27 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/convert/CassandraRowValueProvider.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.cassandra.core.convert; 17 | 18 | /** 19 | * {@link CassandraValueProvider} providing values based on a {@link com.datastax.oss.driver.api.core.cql.Row}. 20 | * 21 | * @author Matthew T. Adams 22 | * @author Mark Paluch 23 | */ 24 | public interface CassandraRowValueProvider extends CassandraValueProvider { 25 | 26 | } 27 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/convert/Where.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-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.cassandra.core.convert; 17 | 18 | import java.util.LinkedHashMap; 19 | 20 | import org.jspecify.annotations.Nullable; 21 | 22 | import com.datastax.oss.driver.api.core.CqlIdentifier; 23 | 24 | /** 25 | * @author Mark Paluch 26 | */ 27 | public class Where extends LinkedHashMap {} 28 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/convert/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Spring Data Cassandra specific converter infrastructure. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.cassandra.core.convert; 6 | 7 | 8 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/cql/CqlProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-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.cassandra.core.cql; 17 | 18 | /** 19 | * Interface to be implemented by objects that can provide CQL strings. 20 | *

21 | * Typically implemented by {@link PreparedStatementCreator}s and statement callbacks that want to expose the CQL they 22 | * use to create their statements, to allow for better contextual information in case of exceptions. 23 | * 24 | * @author Mark Paluch 25 | * @since 2.0 26 | * @see PreparedStatementCreator 27 | * @see ReactivePreparedStatementCreator 28 | * @see ReactiveStatementCallback 29 | */ 30 | @FunctionalInterface 31 | public interface CqlProvider { 32 | 33 | /** 34 | * Return the CQL string for this object, i.e. typically the CQL used for creating statements. 35 | * 36 | * @return the CQL string. 37 | */ 38 | String getCql(); 39 | } 40 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/cql/Ordering.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.cassandra.core.cql; 17 | 18 | /** 19 | * Enum for Cassandra primary key column ordering. 20 | * 21 | * @author Matthew T. Adams 22 | * @author Mark Paluch 23 | */ 24 | public enum Ordering { 25 | 26 | /** 27 | * Ascending Cassandra column ordering. 28 | */ 29 | ASCENDING("ASC"), 30 | 31 | /** 32 | * Descending Cassandra column ordering. 33 | */ 34 | DESCENDING("DESC"); 35 | 36 | private String cql; 37 | 38 | Ordering(String cql) { 39 | this.cql = cql; 40 | } 41 | 42 | /** 43 | * Returns the CQL keyword of this {@link Ordering}. 44 | */ 45 | public String cql() { 46 | return cql; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/cql/PrimaryKeyType.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.cassandra.core.cql; 17 | 18 | /** 19 | * Values representing primary key column types. 20 | * 21 | * @author Matthew T. Adams 22 | * @author Alex Shvid 23 | * @author Mark Paluch 24 | */ 25 | public enum PrimaryKeyType { 26 | 27 | /** 28 | * Used for a column that is part of the partition key. 29 | */ 30 | PARTITIONED, 31 | 32 | /** 33 | * Used for a column that is clustered key. 34 | */ 35 | CLUSTERED 36 | } 37 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/cql/converter/AbstractResultSetToBasicFixedTypeConverter.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 | package org.springframework.data.cassandra.core.cql.converter; 17 | 18 | import org.springframework.core.convert.ConversionService; 19 | import org.springframework.core.convert.support.DefaultConversionService; 20 | 21 | /** 22 | * Thin wrapper that allows subclasses to delegate conversion of the given value to a {@link DefaultConversionService}. 23 | * 24 | * @author Matthew T. Adams 25 | * @param 26 | */ 27 | public abstract class AbstractResultSetToBasicFixedTypeConverter extends AbstractResultSetConverter { 28 | 29 | protected static final ConversionService CONVERTER = DefaultConversionService.getSharedInstance(); 30 | } 31 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/cql/converter/ResultSetToDoubleConverter.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 | package org.springframework.data.cassandra.core.cql.converter; 17 | 18 | import org.jspecify.annotations.Nullable; 19 | 20 | import org.springframework.core.convert.converter.Converter; 21 | 22 | import com.datastax.oss.driver.api.core.cql.ResultSet; 23 | 24 | /** 25 | * {@link Converter} from {@link ResultSet} to a single {@link Double} value. 26 | * 27 | * @author Mark Paluch 28 | */ 29 | public class ResultSetToDoubleConverter extends AbstractResultSetToBasicFixedTypeConverter { 30 | 31 | public static final ResultSetToDoubleConverter INSTANCE = new ResultSetToDoubleConverter(); 32 | 33 | @Override 34 | protected @Nullable Double doConvertSingleValue(Object object) { 35 | return CONVERTER.convert(object, Double.class); 36 | } 37 | 38 | @Override 39 | protected Class getType() { 40 | return Double.class; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/cql/converter/ResultSetToFloatConverter.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 | package org.springframework.data.cassandra.core.cql.converter; 17 | 18 | import org.jspecify.annotations.Nullable; 19 | 20 | import org.springframework.core.convert.converter.Converter; 21 | 22 | import com.datastax.oss.driver.api.core.cql.ResultSet; 23 | 24 | /** 25 | * {@link Converter} from {@link ResultSet} to a single {@link Float} value. 26 | * 27 | * @author Mark Paluch 28 | */ 29 | public class ResultSetToFloatConverter extends AbstractResultSetToBasicFixedTypeConverter { 30 | 31 | public static final ResultSetToFloatConverter INSTANCE = new ResultSetToFloatConverter(); 32 | 33 | @Override 34 | protected @Nullable Float doConvertSingleValue(Object object) { 35 | return CONVERTER.convert(object, Float.class); 36 | } 37 | 38 | @Override 39 | protected Class getType() { 40 | return Float.class; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/cql/converter/ResultSetToLongConverter.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 | package org.springframework.data.cassandra.core.cql.converter; 17 | 18 | import org.jspecify.annotations.Nullable; 19 | 20 | import org.springframework.core.convert.converter.Converter; 21 | 22 | import com.datastax.oss.driver.api.core.cql.ResultSet; 23 | 24 | /** 25 | * {@link Converter} from {@link ResultSet} to a single {@link Long} value. 26 | * 27 | * @author Mark Paluch 28 | */ 29 | public class ResultSetToLongConverter extends AbstractResultSetToBasicFixedTypeConverter { 30 | 31 | public static final ResultSetToLongConverter INSTANCE = new ResultSetToLongConverter(); 32 | 33 | @Override 34 | protected @Nullable Long doConvertSingleValue(Object object) { 35 | return CONVERTER.convert(object, Long.class); 36 | } 37 | 38 | @Override 39 | protected Class getType() { 40 | return Long.class; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/cql/converter/RowToArrayConverter.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 | package org.springframework.data.cassandra.core.cql.converter; 17 | 18 | import java.util.List; 19 | 20 | import org.springframework.core.convert.converter.Converter; 21 | 22 | import com.datastax.oss.driver.api.core.cql.Row; 23 | 24 | /** 25 | * Converter to convert {@link Row} to {@link Object} array. 26 | * 27 | * @author Mark Paluch 28 | */ 29 | public enum RowToArrayConverter implements Converter { 30 | 31 | INSTANCE; 32 | 33 | @Override 34 | public Object[] convert(Row row) { 35 | 36 | List list = RowToListConverter.INSTANCE.convert(row); 37 | return list.toArray(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/cql/converter/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * CQL specific converters. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.cassandra.core.cql.converter; 6 | 7 | 8 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/cql/generator/AlterColumnCqlGenerator.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.cassandra.core.cql.generator; 17 | 18 | import org.springframework.data.cassandra.core.cql.keyspace.AlterColumnSpecification; 19 | 20 | /** 21 | * CQL generator for generating an {@code ALTER} column clause of an ALTER TABLE statement. 22 | * 23 | * @author Matthew T. Adams 24 | * @see AlterColumnSpecification 25 | * @see ColumnChangeCqlGenerator 26 | */ 27 | public class AlterColumnCqlGenerator extends ColumnChangeCqlGenerator { 28 | 29 | public AlterColumnCqlGenerator(AlterColumnSpecification specification) { 30 | super(specification); 31 | } 32 | 33 | public StringBuilder toCql(StringBuilder cql) { 34 | return cql.append("ALTER ").append(spec().getName().asCql(true)).append(" TYPE ") 35 | .append(spec().getType().asCql(true, true)); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/cql/generator/DropColumnCqlGenerator.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.cassandra.core.cql.generator; 17 | 18 | import org.springframework.data.cassandra.core.cql.keyspace.DropColumnSpecification; 19 | 20 | /** 21 | * CQL generator for generating a {@code DROP} column clause of an {@code ALTER TABLE} statement. 22 | * 23 | * @author Matthew T. Adams 24 | * @see DropColumnSpecification 25 | * @see ColumnChangeCqlGenerator 26 | * @see org.springframework.data.cassandra.core.cql.keyspace.AlterTableSpecification 27 | */ 28 | public class DropColumnCqlGenerator extends ColumnChangeCqlGenerator { 29 | 30 | public DropColumnCqlGenerator(DropColumnSpecification specification) { 31 | super(specification); 32 | } 33 | 34 | public StringBuilder toCql(StringBuilder cql) { 35 | return cql.append("DROP ").append(spec().getName().asCql(true)); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/cql/generator/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * CQL generators for Keyspace object actions. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.cassandra.core.cql.generator; 6 | 7 | 8 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/cql/keyspace/CqlSpecification.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024-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.cassandra.core.cql.keyspace; 17 | 18 | /** 19 | * Marker interface for CQL specification objects that describe CQL keyspace objects. 20 | * 21 | * @author Mark Paluch 22 | * @since 4.4 23 | */ 24 | public interface CqlSpecification {} 25 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/cql/keyspace/IndexDescriptor.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.cassandra.core.cql.keyspace; 17 | 18 | import org.jspecify.annotations.Nullable; 19 | 20 | import com.datastax.oss.driver.api.core.CqlIdentifier; 21 | 22 | /** 23 | * Describes an index. 24 | * 25 | * @author Matthew T. Adams 26 | * @author David Webb 27 | */ 28 | public interface IndexDescriptor { 29 | 30 | /** 31 | * Returns the name of the index. 32 | */ 33 | @Nullable 34 | CqlIdentifier getName(); 35 | 36 | /** 37 | * Returns the table name for the index 38 | */ 39 | @Nullable 40 | CqlIdentifier getTableName(); 41 | 42 | @Nullable 43 | CqlIdentifier getColumnName(); 44 | 45 | @Nullable 46 | String getUsing(); 47 | 48 | boolean isCustom(); 49 | } 50 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/cql/keyspace/KeyspaceDescriptor.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.cassandra.core.cql.keyspace; 17 | 18 | import java.util.Map; 19 | 20 | import com.datastax.oss.driver.api.core.CqlIdentifier; 21 | 22 | /** 23 | * Describes a Keyspace. 24 | * 25 | * @author John McPeek 26 | * @author Mark Paluch 27 | */ 28 | public interface KeyspaceDescriptor { 29 | 30 | /** 31 | * Returns the name of the table. 32 | */ 33 | CqlIdentifier getName(); 34 | 35 | /** 36 | * Returns an unmodifiable {@link Map} of keyspace options. 37 | */ 38 | Map getOptions(); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/cql/keyspace/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Keyspace object action specifications such as {@code CREATE TABLE}, {@code DROP INDEX}. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.cassandra.core.cql.keyspace; 6 | 7 | 8 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/cql/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * CQL core support. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.cassandra.core.cql; 6 | 7 | 8 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/cql/session/init/CannotReadScriptException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-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.cassandra.core.cql.session.init; 17 | 18 | import org.springframework.core.io.support.EncodedResource; 19 | 20 | /** 21 | * Thrown by {@link ScriptUtils} if a CQL script cannot be read. 22 | * 23 | * @author Mark Paluch 24 | * @since 3.0 25 | */ 26 | @SuppressWarnings("serial") 27 | public class CannotReadScriptException extends ScriptException { 28 | 29 | /** 30 | * Construct a new {@link CannotReadScriptException}. 31 | * 32 | * @param resource the resource that cannot be read from. 33 | * @param cause the root cause. 34 | */ 35 | public CannotReadScriptException(EncodedResource resource, Throwable cause) { 36 | super("Cannot read CQL script from " + resource, cause); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/cql/session/init/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides extensible support for initializing databases through scripts. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.cassandra.core.cql.session.init; 6 | 7 | 8 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/cql/session/lookup/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides a strategy for looking up {@link org.springframework.data.cassandra.SessionFactory}. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.cassandra.core.cql.session.lookup; 6 | 7 | 8 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/cql/session/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides utility classes for simple {@link com.datastax.oss.driver.api.core.CqlSession} access and various session 3 | * implementations. 4 | */ 5 | @org.jspecify.annotations.NullMarked 6 | package org.springframework.data.cassandra.core.cql.session; 7 | 8 | 9 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/cql/support/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Support classes for the CQL framework. Provides prepared statement caching. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.cassandra.core.cql.support; 6 | 7 | 8 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/cql/util/Bindings.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023-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.cassandra.core.cql.util; 17 | 18 | import org.jspecify.annotations.Nullable; 19 | 20 | import com.datastax.oss.driver.api.querybuilder.BindMarker; 21 | 22 | /** 23 | * Factory for {@link BindMarker} capturing binding {@code value}s. 24 | *

25 | * A {@link Bindings} object is typically used with {@link StatementBuilder}. 26 | * 27 | * @author Mark Paluch 28 | * @since 4.2 29 | */ 30 | @FunctionalInterface 31 | public interface Bindings { 32 | 33 | /** 34 | * Create a {@link BindMarker} for the given {@code value}. Using bindings with positional bind markers must consider 35 | * the usage order within a statement. 36 | * 37 | * @param value the value to bind, can be {@literal null}. 38 | * @return the {@link BindMarker} for the given {@code value}. 39 | */ 40 | BindMarker bind(@Nullable Object value); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/cql/util/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Utility classes for basic CQL interaction. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.cassandra.core.cql.util; 6 | 7 | 8 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/mapping/BasicCassandraMappingContext.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.cassandra.core.mapping; 17 | 18 | import org.springframework.data.mapping.context.MappingContext; 19 | 20 | /** 21 | * Default implementation of a {@link MappingContext} for Cassandra using {@link CassandraPersistentEntity} and 22 | * {@link CassandraPersistentProperty} as primary abstractions. 23 | * 24 | * @author Alex Shvid 25 | * @author Matthew T. Adams 26 | * @author Mark Paluch 27 | * @author John Blum 28 | * @author Jens Schauder 29 | * @deprecated since 2.0. Use {@link CassandraMappingContext}. 30 | */ 31 | @Deprecated 32 | public class BasicCassandraMappingContext extends CassandraMappingContext {} 33 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/mapping/CassandraColumnAnnotationComparator.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.cassandra.core.mapping; 17 | 18 | import java.util.Comparator; 19 | 20 | /** 21 | * {@link Comparator} implementation that uses {@link Column#value()}. 22 | * 23 | * @author Matthew T. Adams 24 | * @author Mark Paluch 25 | * @deprecated since 3.0 without replacement. 26 | */ 27 | @Deprecated 28 | public enum CassandraColumnAnnotationComparator implements Comparator { 29 | 30 | /** 31 | * Comparator instance. 32 | */ 33 | INSTANCE; 34 | 35 | @Override 36 | public int compare(Column left, Column right) { 37 | return left.value().compareTo(right.value()); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/mapping/CassandraPersistentEntityMetadataVerifier.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.cassandra.core.mapping; 17 | 18 | import org.springframework.data.mapping.MappingException; 19 | 20 | /** 21 | * Interface for Cassandra Persistent Entity Mapping Verification. 22 | * 23 | * @author David Webb 24 | * @author Mark Paluch 25 | */ 26 | @FunctionalInterface 27 | public interface CassandraPersistentEntityMetadataVerifier { 28 | 29 | /** 30 | * Performs verification on the Persistent Entity to ensure all markers and marker combinations are valid. 31 | * 32 | * @param entity the entity to verify, must not be {@literal null}. 33 | */ 34 | void verify(CassandraPersistentEntity entity) throws MappingException; 35 | } 36 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/mapping/Frozen.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.cassandra.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 | * Indicates that a persistent property should use a {@code frozen} column type. 26 | * 27 | * @author Jens Schauder 28 | * @see Documentation about 29 | * frozen collections 30 | * @since 3.0 31 | */ 32 | @Documented 33 | @Retention(RetentionPolicy.RUNTIME) 34 | @Target(value = { ElementType.TYPE_USE, ElementType.FIELD, ElementType.METHOD }) 35 | public @interface Frozen { 36 | 37 | } 38 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/mapping/MapId.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 | package org.springframework.data.cassandra.core.mapping; 17 | 18 | import java.util.Map; 19 | 20 | import org.jspecify.annotations.Nullable; 21 | 22 | /** 23 | * Interface that represents the id of a persistent entity, where the keys correspond to the entity's JavaBean 24 | * properties. 25 | * 26 | * @author Matthew T. Adams 27 | * @author Mark Paluch 28 | */ 29 | public interface MapId extends Map { 30 | 31 | /** 32 | * Builder method that adds the value for the named property, then returns {@code this}. 33 | * 34 | * @param name The property name containing the value. 35 | * @param value The property value. 36 | * @return {@code this} 37 | */ 38 | MapId with(String name, @Nullable Object value); 39 | } 40 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/mapping/MapIdentifiable.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 | package org.springframework.data.cassandra.core.mapping; 17 | 18 | /** 19 | * Interface that entity classes may choose to implement in order to allow a client of the entity to easily get the 20 | * entity's {@link MapId}. 21 | * 22 | * @author Matthew T. Adams 23 | */ 24 | public interface MapIdentifiable { 25 | 26 | /** 27 | * Gets the identity of this instance. Throws {@link IllegalStateException} if this instance does not use 28 | * {@link MapId}. 29 | */ 30 | MapId getMapId(); 31 | } 32 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/mapping/Mapping.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.cassandra.core.mapping; 17 | 18 | import java.util.Collections; 19 | import java.util.HashSet; 20 | import java.util.Set; 21 | 22 | import org.jspecify.annotations.Nullable; 23 | 24 | public class Mapping { 25 | 26 | private Set entityMappings = new HashSet<>(); 27 | 28 | public Set getEntityMappings() { 29 | return Collections.unmodifiableSet(entityMappings); 30 | } 31 | 32 | public void setEntityMappings(@Nullable Set mappings) { 33 | 34 | if (mappings == null) { 35 | entityMappings.clear(); 36 | return; 37 | } 38 | 39 | this.entityMappings = new HashSet<>(mappings); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/mapping/SimilarityFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 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.cassandra.core.mapping; 17 | 18 | /** 19 | * Enumeration of similarity functions. 20 | * 21 | * @since 4.5 22 | */ 23 | public enum SimilarityFunction { 24 | 25 | COSINE, DOT_PRODUCT, EUCLIDEAN 26 | 27 | } 28 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/mapping/UnsupportedCassandraOperationException.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 | package org.springframework.data.cassandra.core.mapping; 17 | 18 | import java.io.Serial; 19 | 20 | import org.springframework.dao.InvalidDataAccessApiUsageException; 21 | 22 | public class UnsupportedCassandraOperationException extends InvalidDataAccessApiUsageException { 23 | 24 | private static final @Serial long serialVersionUID = 4921001859094231277L; 25 | 26 | public UnsupportedCassandraOperationException(String msg) { 27 | super(msg); 28 | } 29 | 30 | public UnsupportedCassandraOperationException(String msg, Throwable cause) { 31 | super(msg, cause); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/mapping/event/AfterSaveEvent.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 | package org.springframework.data.cassandra.core.mapping.event; 17 | 18 | import java.io.Serial; 19 | 20 | import com.datastax.oss.driver.api.core.CqlIdentifier; 21 | 22 | /** 23 | * {@link CassandraMappingEvent} triggered after save of an object. 24 | * 25 | * @author Lukasz Antoniak 26 | * @author Mark Paluch 27 | * @since 2.1 28 | */ 29 | public class AfterSaveEvent extends CassandraMappingEvent { 30 | 31 | private static final @Serial long serialVersionUID = 1L; 32 | 33 | /** 34 | * Creates a new {@link AfterSaveEvent}. 35 | * 36 | * @param source must not be {@literal null}. 37 | * @param tableName must not be {@literal null}. 38 | */ 39 | public AfterSaveEvent(E source, CqlIdentifier tableName) { 40 | super(source, tableName); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/mapping/event/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Event callback infrastructure for Cassandra mapping subsystem. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.cassandra.core.mapping.event; 6 | 7 | 8 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/mapping/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Infrastructure for the Apache Cassandra row-to-object mapping subsystem. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.cassandra.core.mapping; 6 | 7 | 8 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Apache Cassandra core support. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.cassandra.core; 6 | 7 | 8 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/query/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Apache Cassandra specific query and update support. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.cassandra.core.query; 6 | 7 | 8 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/observability/CassandraObservationConvention.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.cassandra.observability; 17 | 18 | import io.micrometer.observation.Observation; 19 | import io.micrometer.observation.ObservationConvention; 20 | 21 | /** 22 | * {@link ObservationConvention} for Cassandra. 23 | * 24 | * @author Greg Turnquist 25 | * @since 4.0 26 | */ 27 | public interface CassandraObservationConvention extends ObservationConvention { 28 | 29 | @Override 30 | default boolean supportsContext(Observation.Context context) { 31 | return context instanceof CassandraObservationContext; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/observability/CassandraObservationSupplier.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.cassandra.observability; 17 | 18 | import io.micrometer.observation.Observation; 19 | 20 | /** 21 | * Returns the Cassandra Observation. Used internally - do not implement. 22 | * 23 | * @author Mark Paluch 24 | * @author Marcin Grzejszczak 25 | * @author Greg Turnquist 26 | * @since 4.0 27 | */ 28 | public interface CassandraObservationSupplier { 29 | 30 | /** 31 | * @return the observation 32 | */ 33 | Observation getObservation(); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/observability/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Infrastructure to provide driver observability using Micrometer. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.cassandra.observability; 6 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Spring Data's Cassandra abstraction. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.cassandra; 6 | 7 | 8 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/repository/AllowFiltering.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 | package org.springframework.data.cassandra.repository; 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 declare filtering for a derived query. 26 | * 27 | * @author Mark Paluch 28 | * @since 2.0 29 | */ 30 | @Documented 31 | @Target({ ElementType.METHOD, ElementType.ANNOTATION_TYPE }) 32 | @Retention(RetentionPolicy.RUNTIME) 33 | @Query(allowFiltering = true) 34 | public @interface AllowFiltering { 35 | } 36 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/repository/cdi/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * CDI support for Apache Cassandra specific repository implementation. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.cassandra.repository.cdi; 6 | 7 | 8 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/repository/config/CassandraRepositoryNamespaceHandler.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 | package org.springframework.data.cassandra.repository.config; 17 | 18 | import org.springframework.data.cassandra.config.CassandraNamespaceHandler; 19 | import org.springframework.data.repository.config.RepositoryBeanDefinitionParser; 20 | 21 | /** 22 | * Namespace handler for spring-data-cassandra. 23 | * 24 | * @author Oliver Gierke 25 | * @author Mark Paluch 26 | */ 27 | class CassandraRepositoryNamespaceHandler extends CassandraNamespaceHandler { 28 | 29 | @Override 30 | public void init() { 31 | 32 | super.init(); 33 | 34 | registerBeanDefinitionParser("repositories", 35 | new RepositoryBeanDefinitionParser(new CassandraRepositoryConfigurationExtension())); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/repository/config/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Support infrastructure for the configuration of Apache Cassandra specific repositories. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.cassandra.repository.config; 6 | 7 | 8 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/repository/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Apache Cassandra specific repository implementation. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.cassandra.repository; 6 | 7 | 8 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/repository/query/CassandraEntityInformation.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.cassandra.repository.query; 17 | 18 | import org.springframework.data.repository.core.EntityInformation; 19 | 20 | /** 21 | * Cassandra specific {@link EntityInformation}. 22 | * 23 | * @author Alex Shvid 24 | * @author Mark Paluch 25 | */ 26 | public interface CassandraEntityInformation extends EntityInformation, CassandraEntityMetadata { 27 | 28 | /** 29 | * Returns the attribute that the id will be persisted to. 30 | * 31 | * @return 32 | * @since 2.0 33 | */ 34 | String getIdAttribute(); 35 | } 36 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/repository/query/CassandraEntityMetadata.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.cassandra.repository.query; 17 | 18 | import org.springframework.data.repository.core.EntityMetadata; 19 | 20 | import com.datastax.oss.driver.api.core.CqlIdentifier; 21 | 22 | /** 23 | * Extension of {@link EntityMetadata} to additionally expose the table name an entity shall be persisted to. 24 | * 25 | * @author Alex Shvid 26 | * @author Matthew T. Adams 27 | * @param 28 | */ 29 | public interface CassandraEntityMetadata extends EntityMetadata { 30 | 31 | /** 32 | * Returns the name of the table the entity shall be persisted to. 33 | * 34 | * @return 35 | */ 36 | CqlIdentifier getTableName(); 37 | } 38 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/repository/query/WindowUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2023-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.cassandra.repository.query; 17 | 18 | import java.util.List; 19 | 20 | import org.springframework.data.cassandra.core.query.CassandraPageRequest; 21 | import org.springframework.data.domain.Slice; 22 | import org.springframework.data.domain.Window; 23 | 24 | /** 25 | * Utility to create {@link org.springframework.data.domain.Window} objects. 26 | * 27 | * @author Mark Paluch 28 | */ 29 | class WindowUtil { 30 | 31 | static Window of(Slice slice) { 32 | 33 | List content = slice.getContent(); 34 | CassandraPageRequest pageable = (CassandraPageRequest) slice.getPageable(); 35 | 36 | return Window.from(content, value -> pageable.getScrollPosition(), slice.hasNext()); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/repository/query/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Query derivation mechanism for Apache Cassandra specific repositories. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.cassandra.repository.query; 6 | 7 | 8 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/repository/support/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Support infrastructure for query derivation of Apache Cassandra specific repositories. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.cassandra.repository.support; 6 | 7 | 8 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/java/org/springframework/data/cassandra/util/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Map and SpEL utility infrastructure. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.cassandra.util; 6 | 7 | 8 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/kotlin/org/springframework/data/cassandra/core/ExecutableDeleteOperationExtensions.kt: -------------------------------------------------------------------------------- 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 | package org.springframework.data.cassandra.core 17 | 18 | import kotlin.reflect.KClass 19 | 20 | /** 21 | * Extensions for [ExecutableDeleteOperation]. 22 | * 23 | * @author Mark Paluch 24 | * @since 2.1 25 | */ 26 | 27 | /** 28 | * Extension for [ExecutableRemoveOperation.delete] providing a [KClass] based variant. 29 | */ 30 | @Deprecated("Since 2.2, use the reified variant", replaceWith = ReplaceWith("delete()")) 31 | fun ExecutableDeleteOperation.delete(entityClass: KClass): ExecutableDeleteOperation.ExecutableDelete = 32 | delete(entityClass.java) 33 | 34 | /** 35 | * Extension for [ExecutableRemoveOperation.delete] leveraging reified type parameters. 36 | */ 37 | inline fun ExecutableDeleteOperation.delete(): ExecutableDeleteOperation.ExecutableDelete = 38 | delete(T::class.java) 39 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/kotlin/org/springframework/data/cassandra/core/ExecutableInsertOperationExtensions.kt: -------------------------------------------------------------------------------- 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 | package org.springframework.data.cassandra.core 17 | 18 | import kotlin.reflect.KClass 19 | 20 | /** 21 | * Extensions for [ExecutableInsertOperation]. 22 | * 23 | * @author Mark Paluch 24 | * @since 2.1 25 | */ 26 | 27 | /** 28 | * Extension for [ExecutableInsertOperation.insert] providing a [KClass] based variant. 29 | */ 30 | @Deprecated("Since 2.2, use the reified variant", replaceWith = ReplaceWith("insert()")) 31 | fun ExecutableInsertOperation.insert(entityClass: KClass): ExecutableInsertOperation.ExecutableInsert = 32 | insert(entityClass.java) 33 | 34 | /** 35 | * Extension for [ExecutableInsertOperation.insert] leveraging reified type parameters. 36 | */ 37 | inline fun ExecutableInsertOperation.insert(): ExecutableInsertOperation.ExecutableInsert = 38 | insert(T::class.java) 39 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/kotlin/org/springframework/data/cassandra/core/ExecutableUpdateOperationExtensions.kt: -------------------------------------------------------------------------------- 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 | package org.springframework.data.cassandra.core 17 | 18 | import kotlin.reflect.KClass 19 | 20 | /** 21 | * Extensions for [ExecutableUpdateOperation]. 22 | * 23 | * @author Mark Paluch 24 | * @since 2.1 25 | */ 26 | 27 | /** 28 | * Extension for [ExecutableUpdateOperation.update] providing a [KClass] based variant. 29 | */ 30 | @Deprecated("Since 2.2, use the reified variant", replaceWith = ReplaceWith("update()")) 31 | fun ExecutableUpdateOperation.update(entityClass: KClass): ExecutableUpdateOperation.ExecutableUpdate = 32 | update(entityClass.java) 33 | 34 | /** 35 | * Extension for [ExecutableUpdateOperation.update] leveraging reified type parameters. 36 | */ 37 | inline fun ExecutableUpdateOperation.update(): ExecutableUpdateOperation.ExecutableUpdate = 38 | update(T::class.java) 39 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/kotlin/org/springframework/data/cassandra/core/cql/DataClassRowMapperExtensions.kt: -------------------------------------------------------------------------------- 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.cassandra.core.cql 17 | 18 | /** 19 | * Extensions for [DataClassRowMapper]. 20 | * 21 | * @author Mark Paluch 22 | * @since 3.1 23 | */ 24 | 25 | /** 26 | * Extension for [DataClassRowMapper] leveraging reified type parameters. 27 | */ 28 | inline fun DataClassRowMapper(): DataClassRowMapper = 29 | DataClassRowMapper(T::class.java) 30 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/kotlin/org/springframework/data/cassandra/core/query/QueryExtensions.kt: -------------------------------------------------------------------------------- 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 | package org.springframework.data.cassandra.core.query 17 | 18 | /** 19 | * Extensions for [Query]. 20 | * 21 | * @author Mark Paluch 22 | * @since 2.1 23 | */ 24 | 25 | /** 26 | * Extension for [Query.query] providing a global query alias for an improved DSL. 27 | */ 28 | fun query(criteria: CriteriaDefinition): Query = Query.query(criteria) 29 | 30 | /** 31 | * Extension for [Query.query] providing a global query alias for an improved DSL. 32 | */ 33 | fun query(criteriaDefinitions: CriteriaDefinitions): Query = Query.query(criteriaDefinitions.criteriaDefinitions) 34 | 35 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/resources/META-INF/services/jakarta.enterprise.inject.spi.Extension: -------------------------------------------------------------------------------- 1 | org.springframework.data.cassandra.repository.cdi.CassandraRepositoryExtension 2 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.data.repository.core.support.RepositoryFactorySupport=org.springframework.data.cassandra.repository.support.CassandraRepositoryFactory -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/resources/META-INF/spring.handlers: -------------------------------------------------------------------------------- 1 | http\://www.springframework.org/schema/cql=org.springframework.data.cassandra.config.CqlNamespaceHandler 2 | http\://www.springframework.org/schema/data/cassandra=org.springframework.data.cassandra.repository.config.CassandraRepositoryNamespaceHandler 3 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/resources/META-INF/spring.tooling: -------------------------------------------------------------------------------- 1 | # Tooling related information for the cql namespace 2 | http\://www.springframework.org/schema/cql@name=Spring Cassandra CQL Namespace 3 | http\://www.springframework.org/schema/cql@prefix=cql 4 | http\://www.springframework.org/schema/cql@icon=org/springframework/data/cassandra/config/spring-cql.gif 5 | 6 | # Tooling related information for the cassandra namespace 7 | http\://www.springframework.org/schema/data/cassandra@name=Spring Data Cassandra Namespace 8 | http\://www.springframework.org/schema/data/cassandra@prefix=cassandra 9 | http\://www.springframework.org/schema/data/cassandra@icon=org/springframework/data/cassandra/config/spring-cassandra.gif 10 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/resources/META-INF/spring/aot.factories: -------------------------------------------------------------------------------- 1 | org.springframework.aot.hint.RuntimeHintsRegistrar=\ 2 | org.springframework.data.cassandra.aot.CassandraRuntimeHints 3 | 4 | org.springframework.beans.factory.aot.BeanRegistrationAotProcessor=\ 5 | org.springframework.data.cassandra.aot.CassandraManagedTypesBeanRegistrationAotProcessor 6 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/resources/org/springframework/data/cassandra/config/spring-cassandra.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-projects/spring-data-cassandra/e8d8f240d7e5f375929f6b59780cb5b87a383692/spring-data-cassandra/src/main/resources/org/springframework/data/cassandra/config/spring-cassandra.gif -------------------------------------------------------------------------------- /spring-data-cassandra/src/main/resources/org/springframework/data/cassandra/config/spring-cql.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-projects/spring-data-cassandra/e8d8f240d7e5f375929f6b59780cb5b87a383692/spring-data-cassandra/src/main/resources/org/springframework/data/cassandra/config/spring-cql.gif -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/config/MinimalKeyspaceCreatingXmlConfigIntegrationTests.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 | package org.springframework.data.cassandra.config; 17 | 18 | import org.junit.jupiter.api.Test; 19 | import org.springframework.beans.factory.annotation.Autowired; 20 | import org.springframework.data.cassandra.support.KeyspaceTestUtils; 21 | import org.springframework.data.cassandra.test.util.IntegrationTestsSupport; 22 | import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; 23 | 24 | import com.datastax.oss.driver.api.core.CqlSession; 25 | 26 | /** 27 | * @author Matthew T. Adams 28 | */ 29 | @SpringJUnitConfig 30 | class MinimalKeyspaceCreatingXmlConfigIntegrationTests extends IntegrationTestsSupport { 31 | 32 | @Autowired CqlSession session; 33 | 34 | @Test 35 | void test() { 36 | KeyspaceTestUtils.assertKeyspaceExists("minimal", session); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/config/NamespaceAuditingTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-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.cassandra.config; 17 | 18 | import org.junit.jupiter.api.extension.ExtendWith; 19 | import org.springframework.beans.factory.annotation.Autowired; 20 | import org.springframework.context.ApplicationContext; 21 | import org.springframework.data.cassandra.test.util.CassandraExtension; 22 | import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; 23 | 24 | /** 25 | * Unit tests for auditing enabled using XML config. 26 | * 27 | * @author Mark Paluch 28 | */ 29 | @SpringJUnitConfig 30 | @ExtendWith(CassandraExtension.class) 31 | class NamespaceAuditingTests extends AbstractAuditingTests { 32 | 33 | @Autowired ApplicationContext context; 34 | 35 | @Override 36 | public ApplicationContext getApplicationContext() { 37 | return context; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/core/AsyncCassandraTemplatePreparedStatementsIntegrationTests.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.cassandra.core; 17 | 18 | /** 19 | * Integration tests for {@link AsyncCassandraTemplate} with 20 | * {@link AsyncCassandraTemplate#setUsePreparedStatements(boolean) prepared statements enabled}. 21 | * 22 | * @author Mark Paluch 23 | */ 24 | class AsyncCassandraTemplatePreparedStatementsIntegrationTests extends AsyncCassandraTemplateIntegrationTests { 25 | 26 | @Override 27 | void prepareTemplate(AsyncCassandraTemplate template) { 28 | template.setUsePreparedStatements(true); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/core/CassandraTemplatePreparedStatementIntegrationTests.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.cassandra.core; 17 | 18 | /** 19 | * Integration tests for {@link CassandraTemplate} with {@link CassandraTemplate#setUsePreparedStatements(boolean) 20 | * prepared statements enabled}. 21 | * 22 | * @author Mark Paluch 23 | */ 24 | class CassandraTemplatePreparedStatementIntegrationTests extends CassandraTemplateIntegrationTests { 25 | 26 | @Override 27 | void prepareTemplate(CassandraTemplate template) { 28 | template.setUsePreparedStatements(true); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/core/ReactiveCassandraTemplatePreparedStatementIntegrationTests.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.cassandra.core; 17 | 18 | /** 19 | * Integration tests for {@link ReactiveCassandraTemplate} with 20 | * {@link ReactiveCassandraTemplate#setUsePreparedStatements(boolean) prepared statements enabled}. 21 | * 22 | * @author Mark Paluch 23 | */ 24 | class ReactiveCassandraTemplatePreparedStatementIntegrationTests extends ReactiveCassandraTemplateIntegrationTests { 25 | 26 | @Override 27 | void prepareTemplate(ReactiveCassandraTemplate template) { 28 | template.setUsePreparedStatements(true); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/core/convert/CurrencyConverter.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 | package org.springframework.data.cassandra.core.convert; 17 | 18 | import java.util.Currency; 19 | import java.util.Locale; 20 | 21 | import org.springframework.core.convert.converter.Converter; 22 | 23 | /** 24 | * See also DATACASS-343. 25 | * 26 | * @author Mark Paluch 27 | */ 28 | enum CurrencyConverter implements Converter { 29 | 30 | INSTANCE; 31 | 32 | @Override 33 | public String convert(Currency source) { 34 | return source.getDisplayName(Locale.ENGLISH); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/core/convert/TimeEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-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.cassandra.core.convert; 17 | 18 | import org.springframework.data.cassandra.core.mapping.CassandraType; 19 | import org.springframework.data.cassandra.core.mapping.PrimaryKey; 20 | import org.springframework.data.cassandra.core.mapping.Table; 21 | 22 | /** 23 | * @author Mark Paluch 24 | */ 25 | @Table 26 | public record TimeEntity(@PrimaryKey String id, @CassandraType(type = CassandraType.Name.TIME) long time) { 27 | 28 | } 29 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/core/mapping/BasicMapIdUnitTests.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 | package org.springframework.data.cassandra.core.mapping; 17 | 18 | import static org.assertj.core.api.Assertions.*; 19 | 20 | import java.util.HashMap; 21 | import java.util.Map; 22 | 23 | import org.junit.jupiter.api.Test; 24 | 25 | /** 26 | * Unit tests for {@link BasicMapId}. 27 | * 28 | * @author Matthew T. Adams 29 | * @author Mark Paluch 30 | */ 31 | class BasicMapIdUnitTests { 32 | 33 | @Test 34 | void testMapConstructor() { 35 | 36 | Map map = new HashMap<>(); 37 | map.put("field1", "value1"); 38 | map.put("field2", 2); 39 | 40 | BasicMapId basicMapId = new BasicMapId(map); 41 | 42 | assertThat(map).containsEntry("field1", basicMapId.get("field1")).containsEntry("field2", basicMapId.get("field2")); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/core/mapping/multipackagescanning/Top.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-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.cassandra.core.mapping.multipackagescanning; 17 | 18 | import org.springframework.data.cassandra.core.mapping.PrimaryKey; 19 | import org.springframework.data.cassandra.core.mapping.Table; 20 | 21 | @Table 22 | class Top { 23 | 24 | @PrimaryKey String key; 25 | } 26 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/core/mapping/multipackagescanning/first/First.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.cassandra.core.mapping.multipackagescanning.first; 17 | 18 | import org.springframework.data.cassandra.core.mapping.PrimaryKey; 19 | import org.springframework.data.cassandra.core.mapping.Table; 20 | 21 | @Table 22 | public class First { 23 | 24 | @PrimaryKey String key; 25 | } 26 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/core/mapping/multipackagescanning/second/Second.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.cassandra.core.mapping.multipackagescanning.second; 17 | 18 | import org.springframework.data.cassandra.core.mapping.PrimaryKey; 19 | import org.springframework.data.cassandra.core.mapping.Table; 20 | 21 | @Table 22 | public class Second { 23 | 24 | @PrimaryKey String key; 25 | } 26 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/core/mapping/multipackagescanning/third/Third.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.cassandra.core.mapping.multipackagescanning.third; 17 | 18 | import org.springframework.data.cassandra.core.mapping.PrimaryKey; 19 | import org.springframework.data.cassandra.core.mapping.Table; 20 | 21 | @Table 22 | public class Third { 23 | 24 | @PrimaryKey String key; 25 | } 26 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/domain/TypeWithKeyClass.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-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.cassandra.domain; 17 | 18 | 19 | import org.springframework.data.cassandra.core.mapping.PrimaryKey; 20 | import org.springframework.data.cassandra.core.mapping.Table; 21 | 22 | /** 23 | * @author Mark Paluch 24 | */ 25 | @Table 26 | public class TypeWithKeyClass { 27 | 28 | @PrimaryKey CompositeKey key; 29 | 30 | public CompositeKey getKey() { 31 | return this.key; 32 | } 33 | 34 | public void setKey(CompositeKey key) { 35 | this.key = key; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/repository/cdi/CdiUserRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-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.cassandra.repository.cdi; 17 | 18 | import java.util.Optional; 19 | 20 | import org.springframework.data.cassandra.domain.User; 21 | import org.springframework.data.repository.CrudRepository; 22 | 23 | /** 24 | * @author Mohsin Husen 25 | * @author Oliver Gierke 26 | * @author Mark Paluch 27 | */ 28 | public interface CdiUserRepository extends CrudRepository { 29 | 30 | Optional findById(String id); 31 | } 32 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/repository/cdi/OtherQualifier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-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.cassandra.repository.cdi; 18 | 19 | import jakarta.inject.Qualifier; 20 | 21 | import java.lang.annotation.ElementType; 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | import java.lang.annotation.Target; 25 | 26 | /** 27 | * @author Mark Paluch 28 | */ 29 | @Qualifier 30 | @Retention(RetentionPolicy.RUNTIME) 31 | @Target({ ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER }) 32 | @interface OtherQualifier { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/repository/cdi/QualifiedUserRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-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.cassandra.repository.cdi; 18 | 19 | import org.springframework.data.cassandra.domain.User; 20 | import org.springframework.data.repository.CrudRepository; 21 | 22 | /** 23 | * @author Mark Paluch 24 | */ 25 | @OtherQualifier 26 | @UserDB 27 | public interface QualifiedUserRepository extends CrudRepository { 28 | 29 | } 30 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/repository/cdi/SamplePersonFragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-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.cassandra.repository.cdi; 17 | 18 | /** 19 | * @author Mark Paluch 20 | */ 21 | interface SamplePersonFragment { 22 | 23 | int returnOne(); 24 | } 25 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/repository/cdi/SamplePersonFragmentImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-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.cassandra.repository.cdi; 17 | 18 | /** 19 | * @author Mark Paluch 20 | */ 21 | class SamplePersonFragmentImpl implements SamplePersonFragment { 22 | 23 | @Override 24 | public int returnOne() { 25 | return 1; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/repository/cdi/SamplePersonRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-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.cassandra.repository.cdi; 17 | 18 | import org.springframework.data.cassandra.domain.Person; 19 | import org.springframework.data.repository.Repository; 20 | 21 | /** 22 | * @author Mark Paluch 23 | */ 24 | public interface SamplePersonRepository extends Repository, SamplePersonFragment { 25 | 26 | } 27 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/repository/cdi/UserDB.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-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.cassandra.repository.cdi; 18 | 19 | import jakarta.inject.Qualifier; 20 | 21 | import java.lang.annotation.ElementType; 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | import java.lang.annotation.Target; 25 | 26 | /** 27 | * @author Mark Paluch 28 | */ 29 | @Qualifier 30 | @Retention(RetentionPolicy.RUNTIME) 31 | @Target({ ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER }) 32 | @interface UserDB { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/repository/conversion/Phone.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-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.cassandra.repository.conversion; 17 | 18 | import org.springframework.util.ObjectUtils; 19 | 20 | /** 21 | * @author Mark Paluch 22 | */ 23 | class Phone { 24 | 25 | String number; 26 | 27 | public String getNumber() { 28 | return number; 29 | } 30 | 31 | public void setNumber(String number) { 32 | this.number = number; 33 | } 34 | 35 | @Override 36 | public boolean equals(Object o) { 37 | if (this == o) 38 | return true; 39 | if (o == null || getClass() != o.getClass()) 40 | return false; 41 | 42 | Phone phone = (Phone) o; 43 | 44 | return ObjectUtils.nullSafeEquals(number, phone.number); 45 | } 46 | 47 | @Override 48 | public int hashCode() { 49 | return ObjectUtils.nullSafeHashCode(number); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/repository/forcequote/compositeprimarykey/ExplicitRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-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.cassandra.repository.forcequote.compositeprimarykey; 17 | 18 | import org.springframework.data.cassandra.repository.CassandraRepository; 19 | 20 | /** 21 | * @author Matthew T. Adams 22 | * @author Mark Paluch 23 | */ 24 | public interface ExplicitRepository extends CassandraRepository {} 25 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/repository/forcequote/compositeprimarykey/ForceQuotedCompositePrimaryKeyRepositoryXmlConfigIntegrationTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-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.cassandra.repository.forcequote.compositeprimarykey; 17 | 18 | import org.junit.jupiter.api.Test; 19 | import org.springframework.test.context.ContextConfiguration; 20 | 21 | /** 22 | * @author Matthew T. Adams 23 | */ 24 | @ContextConfiguration 25 | class ForceQuotedCompositePrimaryKeyRepositoryXmlConfigIntegrationTests 26 | extends ForceQuotedCompositePrimaryKeyRepositoryIntegrationTestsDelegator { 27 | 28 | @Test 29 | void testExplicit() { 30 | testExplicit(String.format("\"%s\"", "XmlExplicitTable"), String.format("\"%s\"", "XmlExplicitStringValue"), 31 | String.format("\"%s\"", "XmlExplicitKeyZero"), String.format("\"%s\"", "XmlExplicitKeyOne")); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/repository/forcequote/compositeprimarykey/ImplicitRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-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.cassandra.repository.forcequote.compositeprimarykey; 17 | 18 | import org.springframework.data.cassandra.repository.CassandraRepository; 19 | 20 | /** 21 | * @author Matthew T. Adams 22 | * @author Mark Paluch 23 | */ 24 | public interface ImplicitRepository extends CassandraRepository {} 25 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/repository/forcequote/config/ExplicitPropertiesRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-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.cassandra.repository.forcequote.config; 17 | 18 | import org.springframework.data.cassandra.repository.CassandraRepository; 19 | 20 | /** 21 | * @author Matthew T. Adams 22 | * @author Mark Paluch 23 | */ 24 | public interface ExplicitPropertiesRepository extends CassandraRepository {} 25 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/repository/forcequote/config/ExplicitRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-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.cassandra.repository.forcequote.config; 17 | 18 | import org.springframework.data.cassandra.repository.CassandraRepository; 19 | 20 | /** 21 | * @author Matthew T. Adams 22 | * @author Mark Paluch 23 | */ 24 | public interface ExplicitRepository extends CassandraRepository {} 25 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/repository/forcequote/config/ForceQuotedRepositoryXmlConfigIntegrationTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-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.cassandra.repository.forcequote.config; 17 | 18 | import org.junit.jupiter.api.Test; 19 | import org.springframework.test.context.ContextConfiguration; 20 | 21 | /** 22 | * @author Matthew T. Adams 23 | */ 24 | @ContextConfiguration 25 | class ForceQuotedRepositoryXmlConfigIntegrationTests extends ForceQuotedRepositoryIntegrationTests { 26 | 27 | // these values must match the values in 28 | // ForceQuotedRepositoryXmlConfigIntegrationTests-context.xml 29 | 30 | @Test 31 | void testExplicit() { 32 | tests.testExplicit("Zz"); 33 | } 34 | 35 | @Test 36 | void testExplicitPropertiesWithXmlValues() { 37 | tests.testExplicitProperties("XmlStringValue", "XmlPrimaryKey"); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/repository/forcequote/config/ImplicitPropertiesRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-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.cassandra.repository.forcequote.config; 17 | 18 | import org.springframework.data.cassandra.repository.CassandraRepository; 19 | 20 | /** 21 | * @author Matthew T. Adams 22 | * @author Mark Paluch 23 | */ 24 | public interface ImplicitPropertiesRepository extends CassandraRepository {} 25 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/repository/forcequote/config/ImplicitRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-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.cassandra.repository.forcequote.config; 17 | 18 | import org.springframework.data.cassandra.repository.CassandraRepository; 19 | 20 | /** 21 | * @author Matthew T. Adams 22 | * @author Mark Paluch 23 | */ 24 | public interface ImplicitRepository extends CassandraRepository {} 25 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/repository/mapid/MultiPrimaryKeyColumnsRepository.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 | package org.springframework.data.cassandra.repository.mapid; 17 | 18 | import org.springframework.data.cassandra.repository.MapIdCassandraRepository; 19 | 20 | /** 21 | * @author Matthew T. Adams 22 | * @author Mark Paluch 23 | */ 24 | interface MultiPrimaryKeyColumnsRepository extends MapIdCassandraRepository {} 25 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/repository/mapid/SinglePrimaryKecColumnRepository.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 | package org.springframework.data.cassandra.repository.mapid; 17 | 18 | import org.springframework.data.cassandra.repository.MapIdCassandraRepository; 19 | 20 | /** 21 | * @author Matthew T. Adams 22 | */ 23 | interface SinglePrimaryKecColumnRepository extends MapIdCassandraRepository {} 24 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/support/AbstractTestJavaConfig.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 | package org.springframework.data.cassandra.support; 17 | 18 | import org.springframework.context.annotation.Configuration; 19 | import org.springframework.data.cassandra.config.AbstractSessionConfiguration; 20 | import org.springframework.data.cassandra.test.util.CassandraExtension; 21 | 22 | /** 23 | * Java-based configuration for integration tests using defaults for a smooth test run. 24 | * 25 | * @author Matthew T. Adams 26 | * @author Mark Paluch 27 | */ 28 | @Configuration 29 | public abstract class AbstractTestJavaConfig extends AbstractSessionConfiguration { 30 | 31 | @Override 32 | protected int getPort() { 33 | return CassandraExtension.getResources().getPort(); 34 | } 35 | 36 | @Override 37 | protected String getContactPoints() { 38 | return CassandraExtension.getResources().getHost(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/support/KeyspaceTestUtils.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 | package org.springframework.data.cassandra.support; 17 | 18 | import static org.assertj.core.api.Assertions.*; 19 | 20 | import com.datastax.oss.driver.api.core.CqlSession; 21 | 22 | /** 23 | * @author Matthew T. Adams 24 | * @author Mark Paluch 25 | */ 26 | public class KeyspaceTestUtils { 27 | 28 | public static void assertKeyspaceExists(String keyspace, CqlSession session) { 29 | assertThat(session.getMetadata().getKeyspace(keyspace)).isPresent(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/support/RandomKeyspaceName.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-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.cassandra.support; 17 | 18 | import java.util.UUID; 19 | 20 | /** 21 | * Generates a random key space name starting with {@code ks}. 22 | * 23 | * @author Matthew T. Adams 24 | */ 25 | public abstract class RandomKeyspaceName { 26 | 27 | private RandomKeyspaceName() { } 28 | 29 | /** 30 | * Creates a random {@link String keyspace name} starting with {@code ks} based on a random {@link UUID}. 31 | * 32 | * @return a random {@link String keyspace name}. 33 | * @see java.lang.String 34 | * @see java.util.UUID 35 | */ 36 | public static String create() { 37 | return "ks" + UUID.randomUUID().toString().replace("-", ""); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/java/org/springframework/data/cassandra/test/util/TestKeyspace.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.cassandra.test.util; 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 indicating that the test infrastructure should inject the 26 | * {@link com.datastax.oss.driver.api.core.CqlSession} or the keyspace name into the annotated field. 27 | * 28 | * @author Mark Paluch 29 | * @see CassandraExtension 30 | * @see TestKeyspaceName 31 | */ 32 | @Target({ ElementType.FIELD }) 33 | @Retention(RetentionPolicy.RUNTIME) 34 | @Documented 35 | public @interface TestKeyspace { 36 | 37 | } 38 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/kotlin/org/springframework/data/cassandra/core/Person.kt: -------------------------------------------------------------------------------- 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.cassandra.core 17 | 18 | import org.springframework.data.cassandra.core.mapping.* 19 | import java.time.LocalDate 20 | import java.util.* 21 | 22 | @Table("person") 23 | data class Person( 24 | @PrimaryKey("person_id") 25 | val personId: UUID, 26 | @field:Column("first_name") 27 | val firstName: String, 28 | @field:Column("last_name") 29 | val lastName: String, 30 | @field:Column("date_of_birth") 31 | val dateOfBirth: LocalDate, 32 | @field:Column("last_updated_at") 33 | val lastUpdatedAt: LocalDate 34 | ) 35 | 36 | 37 | fun main() { 38 | 39 | 40 | val cctx = CassandraMappingContext() 41 | 42 | val pe = cctx.getRequiredPersistentEntity(Person::class.java) 43 | 44 | pe.doWithProperties { persistentProperty: CassandraPersistentProperty -> println(persistentProperty.columnName) } 45 | 46 | 47 | } 48 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/resources/META-INF/PersonRepositoryWithNamedQueries.properties: -------------------------------------------------------------------------------- 1 | Person.findFolksWithLastnameAsList=select * from person where lastname = ?0 2 | Person.findFolksWithLastnameAsResultSet=select * from person where lastname = ?0 3 | Person.findFolksWithLastnameAsArray=select * from person where lastname = ?0 4 | Person.findSingle=select * from person where lastname = ?0 and firstname = ?1 5 | Person.findFolksWithLastnameAsListOfMapOfStringToObject=select * from person where lastname = ?0 6 | Person.findSingleNickname=select nickname from person where lastname = ?0 and firstname = ?1 7 | Person.findSingleBirthdate=select birthdate from person where lastname = ?0 and firstname = ?1 8 | Person.findSingleCool=select cool from person where lastname = ?0 and firstname = ?1 9 | Person.findSingleNumberOfChildren=select numberofchildren from person where lastname = ?0 and firstname = ?1 10 | Person.findOptionalWithLastnameAndFirstname=select * from person where lastname = ?0 and firstname = ?1 11 | Person.findPeopleWithCreatedDate=select * from person where createddate = ?0 12 | Person.findPeopleWithZoneId=select * from person where zoneid = ?0 13 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/resources/META-INF/cassandra-named-queries.properties: -------------------------------------------------------------------------------- 1 | User.findByNamedQuery=SELECT firstname FROM users WHERE username=?0 2 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/resources/cassandraOperationsTest-cql-cleanup.cql: -------------------------------------------------------------------------------- 1 | DROP KEYSPACE CqlOperationsIntegrationTests; 2 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/resources/cassandraOperationsTest-cql-dataload.cql: -------------------------------------------------------------------------------- 1 | create table if not exists book (isbn text, title text, author text, pages int, PRIMARY KEY (isbn)); 2 | create table if not exists book_alt (isbn text, title text, author text, pages int, PRIMARY KEY (isbn)); 3 | truncate table book; 4 | truncate table book_alt; 5 | insert into book (isbn, title, author, pages) values ('999999999', 'Book of Nines', 'Nine Nine', 999); 6 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/resources/config/cassandra-connection.properties: -------------------------------------------------------------------------------- 1 | # cassandra-connection.properties is needed twice because of enabled random port generation 2 | # Generated ports are only valid for one module 3 | build.cassandra.native_transport_port=@build.cassandra.native_transport_port@ 4 | build.cassandra.mode=@build.cassandra.mode@ 5 | build.cassandra.host=@build.cassandra.host@ 6 | build.cassandra.reuse-cluster=true 7 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/resources/config/spring-data-cassandra-basic.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 15 | 16 | 17 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/resources/integration/cql/generator/CreateIndexCqlGeneratorIntegrationTests-BasicTest-After.cql: -------------------------------------------------------------------------------- 1 | drop table if exists mytable; -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/resources/integration/cql/generator/CreateIndexCqlGeneratorIntegrationTests-BasicTest.cql: -------------------------------------------------------------------------------- 1 | create table if not exists mytable (id uuid primary key, column1 text); -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | %d %5p | %t | %-55logger{55} | %m | %n 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/resources/org/springframework/data/cassandra/config/FullySpecifiedKeyspaceCreatingXmlConfigIntegrationTests.properties: -------------------------------------------------------------------------------- 1 | script2=CREATE KEYSPACE IF NOT EXISTS script2 WITH durable_writes = true AND replication = { 'replication_factor' : 1, 'class' : 'SimpleStrategy' }; 2 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/resources/org/springframework/data/cassandra/config/MinimalKeyspaceCreatingXmlConfigIntegrationTests-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/resources/org/springframework/data/cassandra/config/MinimalXmlConfigIntegrationTests-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/resources/org/springframework/data/cassandra/config/NamespaceAuditingTests-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/resources/org/springframework/data/cassandra/config/cassandra.properties: -------------------------------------------------------------------------------- 1 | cassandra.keyspace=CassandraNamespaceIntegrationTests 2 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/resources/org/springframework/data/cassandra/config/cluster-and-mock-session.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/resources/org/springframework/data/cassandra/config/mock-session-converter.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/resources/org/springframework/data/cassandra/config/mock-session-mapping-converter.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/resources/org/springframework/data/cassandra/config/multiple-converters.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/resources/org/springframework/data/cassandra/config/multiple-mapping-contexts.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/resources/org/springframework/data/cassandra/config/multiple-session-factories.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/resources/org/springframework/data/cassandra/config/multiple-sessions.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/resources/org/springframework/data/cassandra/config/schema.cql: -------------------------------------------------------------------------------- 1 | create table if not exists mytable1 (id uuid primary key, column1 text); 2 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/resources/org/springframework/data/cassandra/config/two-keyspaces-namespace.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/resources/org/springframework/data/cassandra/core/cql/session/init/cleanup-schema.cql: -------------------------------------------------------------------------------- 1 | drop table mytable1; 2 | drop table mytable2; 3 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/resources/org/springframework/data/cassandra/core/cql/session/init/db-test-data-multi-newline.cql: -------------------------------------------------------------------------------- 1 | insert into T_TEST (NAME) 2 | values ('Hank') 3 | 4 | insert into T_TEST (NAME) 5 | values ('Walter') 6 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/resources/org/springframework/data/cassandra/core/cql/session/init/initialize-and-cleanup-keyspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/resources/org/springframework/data/cassandra/core/cql/session/init/initialize-keyspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/resources/org/springframework/data/cassandra/core/cql/session/init/schema.cql: -------------------------------------------------------------------------------- 1 | create table if not exists mytable1 (id uuid primary key, column1 text); 2 | create table if not exists mytable2 (id uuid primary key, column1 text); 3 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/resources/org/springframework/data/cassandra/core/cql/session/init/test-data-with-comments-and-leading-tabs.cql: -------------------------------------------------------------------------------- 1 | -- The next comment line starts with a tab. 2 | -- x, y, z... 3 | 4 | insert into customer (id, name) 5 | values (1, 'Hank Schrader'); 6 | -- This is also a comment with a leading tab. 7 | insert into orders(id, order_date, customer_id) values (1, '2013-06-08', 1); 8 | -- This is also a comment with a leading tab, a space, and a tab. 9 | insert into orders(id, order_date, customer_id) values (2, '2013-06-08', 1); 10 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/resources/org/springframework/data/cassandra/core/cql/session/init/test-data-with-comments.cql: -------------------------------------------------------------------------------- 1 | -- The next comment line has no text after the '--' prefix. 2 | -- 3 | -- The next comment line starts with a space. 4 | -- x, y, z... 5 | 6 | insert into customer (id, name) 7 | values (1, 'Walter; White'), (2, 'Hank Schrader'); 8 | -- This is also a comment. 9 | insert into orders(id, order_date, customer_id) 10 | values (1, '2008-01-02', 2); 11 | insert into orders(id, order_date, customer_id) values (1, '2008-01-02', 2); 12 | INSERT INTO persons( person_id-- 13 | , name) 14 | VALUES( 1 -- person_id 15 | , 'Name' --name 16 | );-- 17 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/resources/org/springframework/data/cassandra/core/cql/session/init/test-data-with-multi-line-comments.cql: -------------------------------------------------------------------------------- 1 | /* This is a multi line comment 2 | * The next comment line has no text 3 | * The next comment line starts with a space. 4 | * x, y, z... 5 | */ 6 | 7 | INSERT INTO users(first_name, last_name) VALUES('Walter', 'White'); 8 | -- This is also a comment. 9 | /* 10 | * Let's add another comment 11 | * that covers multiple lines 12 | */INSERT INTO 13 | users(first_name, last_name) 14 | VALUES( 'Hank' -- first_name 15 | , 'Schrader' -- last_name 16 | );-- 17 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/resources/org/springframework/data/cassandra/core/cql/session/init/test-data-with-multi-line-nested-comments.cql: -------------------------------------------------------------------------------- 1 | /* This is a multi line comment 2 | * The next comment line has no text 3 | * The next comment line starts with a space. 4 | * x, y, z... 5 | */ 6 | 7 | INSERT INTO users(first_name, last_name) VALUES('Walter', 'White'); 8 | -- This is also a comment. 9 | /*------------------------------------------- 10 | -- A fancy multi-line comments that puts 11 | -- single line comments inside of a multi-line 12 | -- comment block. 13 | Moreover, the block comment end delimiter 14 | appears on a line that can potentially also 15 | be a single-line comment if we weren't 16 | already inside a multi-line comment run. 17 | -------------------------------------------*/ 18 | INSERT INTO 19 | users(first_name, last_name) -- This is a single line comment containing the block-end-comment sequence here */ but it's still a single-line comment 20 | VALUES( 'Hank' -- first_name 21 | , 'Schrader' -- last_name 22 | );-- 23 | -------------------------------------------------------------------------------- /spring-data-cassandra/src/test/resources/org/springframework/data/cassandra/core/cql/session/init/test-data-with-multi-prefix-comments.cql: -------------------------------------------------------------------------------- 1 | 2 | -- The next comment line has no text after the '--' prefix. 3 | -- 4 | -- The next comment line starts with a space. 5 | -- x, y, z... 6 | 7 | insert into customer (id, name) 8 | values (1, 'Walter; White'), (2, 'Hank Schrader'); 9 | -- This is also a comment. 10 | insert into orders(id, order_date, customer_id) 11 | values (1, '2008-01-02', 2); 12 | # A comment with a different prefix 13 | insert into orders(id, order_date, customer_id) values (1, '2008-01-02', 2); 14 | INSERT INTO persons( person_id-- 15 | , name) 16 | ^ A comment with yet another different prefix 17 | VALUES( 1 -- person_id 18 | , 'Name' --name 19 | );-- 20 | -------------------------------------------------------------------------------- /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-cassandra' 8 | site: 9 | title: Spring Data Cassandra 10 | url: https://docs.spring.io/spring-data-cassandra/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, 4.0.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-cassandra 2 | version: true 3 | title: Spring Data Cassandra 4 | nav: 5 | - modules/ROOT/nav.adoc 6 | ext: 7 | collector: 8 | - run: 9 | command: ./mvnw validate process-resources -pl :spring-data-cassandra-distribution -am -Pantora-process-resources 10 | local: true 11 | scan: 12 | dir: spring-data-cassandra-distribution/target/classes/ 13 | - run: 14 | command: ./mvnw package -Pdistribute 15 | local: true 16 | scan: 17 | dir: target/antora 18 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/examples/AppConfig.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.cassandra.example; 17 | 18 | import org.springframework.context.annotation.Bean; 19 | import org.springframework.context.annotation.Configuration; 20 | 21 | import com.datastax.oss.driver.api.core.CqlSession; 22 | 23 | // tag::class[] 24 | @Configuration 25 | public class AppConfig { 26 | 27 | /* 28 | * Use the standard Cassandra driver API to create a com.datastax.oss.driver.api.core.CqlSession instance. 29 | */ 30 | public @Bean CqlSession session() { 31 | return CqlSession.builder().withKeyspace("mykeyspace").build(); 32 | } 33 | } 34 | // end::class[] 35 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/examples/CassandraConfiguration.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.cassandra.example; 17 | 18 | import org.springframework.context.annotation.Configuration; 19 | import org.springframework.data.cassandra.config.AbstractCassandraConfiguration; 20 | 21 | // tag::class[] 22 | @Configuration 23 | public class CassandraConfiguration extends AbstractCassandraConfiguration { 24 | 25 | /* 26 | * Provide a contact point to the configuration. 27 | */ 28 | @Override 29 | public String getContactPoints() { 30 | return "localhost"; 31 | } 32 | 33 | /* 34 | * Provide a keyspace name to the configuration. 35 | */ 36 | @Override 37 | public String getKeyspaceName() { 38 | return "mykeyspace"; 39 | } 40 | } 41 | // end::class[] 42 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/examples/CustomizedCassandraConfiguration.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.cassandra.example; 17 | 18 | import org.springframework.context.annotation.Configuration; 19 | import org.springframework.data.cassandra.config.AbstractCassandraConfiguration; 20 | 21 | // tag::class[] 22 | @Configuration 23 | public class CustomizedCassandraConfiguration extends AbstractCassandraConfiguration { 24 | 25 | /* 26 | * Customize the CqlSession through CqlSessionBuilder. 27 | */ 28 | @Override 29 | protected SessionBuilderConfigurer getSessionBuilderConfigurer() { 30 | 31 | Path connectBundlePath = …; 32 | 33 | return builder -> builder 34 | .withCloudSecureConnectBundle(Path.of(connectBundlePath)); 35 | } 36 | 37 | /* 38 | * Provide a keyspace name to the configuration. 39 | */ 40 | @Override 41 | public String getKeyspaceName() { 42 | return "mykeyspace"; 43 | } 44 | 45 | } 46 | // end::class[] 47 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/examples/EntityBasePackagesConfiguration.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.cassandra.example; 17 | 18 | import org.springframework.context.annotation.Configuration; 19 | import org.springframework.data.cassandra.config.AbstractCassandraConfiguration; 20 | 21 | // tag::class[] 22 | @Configuration 23 | public class EntityBasePackagesConfiguration extends AbstractCassandraConfiguration { 24 | 25 | @Override 26 | public String[] getEntityBasePackages() { 27 | return new String[] { "com.foo", "com.bar" }; 28 | } 29 | 30 | // ... 31 | // end::class[] 32 | 33 | @Override 34 | protected String getKeyspaceName() { 35 | return null; 36 | } 37 | // tag::class[] 38 | } 39 | // end::class[] 40 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/examples/FactoryBeanAppConfig.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.cassandra.example; 17 | 18 | import org.springframework.context.annotation.Bean; 19 | import org.springframework.context.annotation.Configuration; 20 | import org.springframework.data.cassandra.config.CqlSessionFactoryBean; 21 | 22 | // tag::class[] 23 | @Configuration 24 | public class FactoryBeanAppConfig { 25 | 26 | /* 27 | * Factory bean that creates the com.datastax.oss.driver.api.core.CqlSession instance 28 | */ 29 | @Bean 30 | public CqlSessionFactoryBean session() { 31 | 32 | CqlSessionFactoryBean session = new CqlSessionFactoryBean(); 33 | session.setContactPoints("localhost"); 34 | session.setKeyspaceName("mykeyspace"); 35 | 36 | return session; 37 | } 38 | } 39 | // end::class[] 40 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/examples/NamingStrategyConfiguration.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.cassandra.example; 17 | 18 | import org.springframework.data.cassandra.core.mapping.CassandraMappingContext; 19 | import org.springframework.data.cassandra.core.mapping.NamingStrategy; 20 | 21 | class NamingStrategyConfiguration { 22 | 23 | public void configurationMethod() { 24 | 25 | // tag::method[] 26 | CassandraMappingContext context = new CassandraMappingContext(); 27 | 28 | // default naming strategy 29 | context.setNamingStrategy(NamingStrategy.INSTANCE); 30 | 31 | // snake_case converted to upper case (SNAKE_CASE) 32 | context.setNamingStrategy(NamingStrategy.SNAKE_CASE.transform(String::toUpperCase)); 33 | 34 | // end::method[] 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/examples/PersonReadConverter.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.cassandra.example; 17 | 18 | import java.io.IOException; 19 | 20 | import org.springframework.core.convert.converter.Converter; 21 | import org.springframework.util.StringUtils; 22 | 23 | import com.fasterxml.jackson.databind.ObjectMapper; 24 | 25 | // tag::class[] 26 | class PersonReadConverter implements Converter { 27 | 28 | public Person convert(String source) { 29 | 30 | if (StringUtils.hasText(source)) { 31 | try { 32 | return new ObjectMapper().readValue(source, Person.class); 33 | } catch (IOException e) { 34 | throw new IllegalStateException(e); 35 | } 36 | } 37 | 38 | return null; 39 | } 40 | } 41 | // end::class[] 42 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/examples/PersonWriteConverter.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.cassandra.example; 17 | 18 | import java.io.IOException; 19 | 20 | import org.springframework.core.convert.converter.Converter; 21 | 22 | import com.fasterxml.jackson.databind.ObjectMapper; 23 | // tag::class[] 24 | class PersonWriteConverter implements Converter { 25 | 26 | public String convert(Person source) { 27 | 28 | try { 29 | return new ObjectMapper().writeValueAsString(source); 30 | } catch (IOException e) { 31 | throw new IllegalStateException(e); 32 | } 33 | } 34 | } 35 | // end::class[] 36 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/examples/ReactiveCassandraConfiguration.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.cassandra.example; 17 | 18 | import org.springframework.context.annotation.Configuration; 19 | import org.springframework.data.cassandra.config.AbstractReactiveCassandraConfiguration; 20 | 21 | // tag::class[] 22 | @Configuration 23 | public class ReactiveCassandraConfiguration extends AbstractReactiveCassandraConfiguration { 24 | 25 | /* 26 | * Provide a contact point to the configuration. 27 | */ 28 | public String getContactPoints() { 29 | return "localhost"; 30 | } 31 | 32 | /* 33 | * Provide a keyspace name to the configuration. 34 | */ 35 | public String getKeyspaceName() { 36 | return "mykeyspace"; 37 | } 38 | } 39 | // end::class[] 40 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/examples/RepositoryClient.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.cassandra.example; 17 | 18 | import jakarta.inject.Inject; 19 | 20 | import java.util.List; 21 | 22 | import org.springframework.data.cassandra.repository.CassandraRepository; 23 | 24 | // tag::class[] 25 | class RepositoryClient { 26 | 27 | @Inject PersonRepository repository; 28 | 29 | public void businessMethod() { 30 | List people = repository.findAll(); 31 | } 32 | } 33 | 34 | // end::class[] 35 | interface PersonRepository extends CassandraRepository {} 36 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/examples/ReversingValueConverter.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.cassandra.example; 18 | 19 | // tag::class[] 20 | class ReversingValueConverter implements PropertyValueConverter { 21 | 22 | @Override 23 | public String read(String value, ValueConversionContext context) { 24 | return reverse(value); 25 | } 26 | 27 | @Override 28 | public String write(String value, ValueConversionContext context) { 29 | return reverse(value); 30 | } 31 | 32 | // end::class[] 33 | private String reverse(String source) { 34 | 35 | if (source == null) { 36 | return null; 37 | } 38 | 39 | return new StringBuilder(source).reverse().toString(); 40 | } 41 | // tag::class[] 42 | } 43 | // end::class[] 44 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/examples/VectorSearchExample.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 | // tag::file[] 17 | package org.springframework.data.cassandra.example; 18 | 19 | import org.springframework.data.cassandra.core.mapping.PrimaryKey; 20 | import org.springframework.data.cassandra.core.mapping.Table; 21 | 22 | // tag::class[] 23 | @Table 24 | class Comments { 25 | 26 | @Id UUID id; 27 | String comment; 28 | 29 | @VectorType(dimensions = 5) 30 | @SaiIndexed Vector vector; 31 | } 32 | 33 | class CommentSearch { 34 | 35 | String comment; 36 | 37 | float similarity; 38 | } 39 | // end::class[] 40 | 41 | // end::file[] 42 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/examples/mapping/Address.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.cassandra.example.mapping; 17 | 18 | import java.util.List; 19 | import java.util.Set; 20 | 21 | import org.springframework.data.cassandra.core.mapping.CassandraType; 22 | import org.springframework.data.cassandra.core.mapping.UserDefinedType; 23 | 24 | // tag::class[] 25 | @UserDefinedType("address") 26 | public class Address { 27 | 28 | @CassandraType(type = CassandraType.Name.VARCHAR) 29 | private String street; 30 | 31 | private String city; 32 | 33 | private Set zipcodes; 34 | 35 | @CassandraType(type = CassandraType.Name.SET, typeArguments = CassandraType.Name.BIGINT) 36 | private List timestamps; 37 | 38 | // other getters/setters omitted 39 | } 40 | // end::class[] 41 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/examples/mapping/BeforeSaveListener.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.cassandra.example.mapping; 17 | 18 | import org.springframework.data.cassandra.core.mapping.event.AbstractCassandraEventListener; 19 | import org.springframework.data.cassandra.core.mapping.event.BeforeSaveEvent; 20 | 21 | // tag::class[] 22 | class BeforeSaveListener extends AbstractCassandraEventListener { 23 | @Override 24 | public void onBeforeSave(BeforeSaveEvent event) { 25 | // … change values, delete them, whatever … 26 | } 27 | } 28 | // end::class[] 29 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/examples/mapping/Coordinates.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.cassandra.example.mapping; 17 | 18 | import org.springframework.data.cassandra.core.mapping.CassandraType; 19 | import org.springframework.data.cassandra.core.mapping.Element; 20 | import org.springframework.data.cassandra.core.mapping.Tuple; 21 | 22 | // tag::class[] 23 | @Tuple 24 | class Coordinates { 25 | 26 | @Element(0) 27 | @CassandraType(type = CassandraType.Name.VARCHAR) 28 | private String description; 29 | 30 | @Element(1) 31 | private long longitude; 32 | 33 | @Element(2) 34 | private long latitude; 35 | 36 | // other getters/setters omitted 37 | } 38 | // end::class[] 39 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/examples/mapping/PersonReadConverter.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.cassandra.example.mapping; 17 | 18 | import org.springframework.core.convert.converter.Converter; 19 | import org.springframework.data.convert.ReadingConverter; 20 | 21 | import com.datastax.oss.driver.api.core.cql.Row; 22 | 23 | // tag::class[] 24 | @ReadingConverter 25 | class PersonReadConverter implements Converter { 26 | 27 | public Person convert(Row source) { 28 | Person person = new Person(source.getInt("id")); 29 | person.setFirstName(source.getString("first_name")); 30 | return person; 31 | } 32 | } 33 | // end::class[] 34 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/cassandra/repositories/cdi-integration.adoc: -------------------------------------------------------------------------------- 1 | [[cassandra.repositories.misc.cdi-integration]] 2 | = CDI Integration 3 | 4 | Instances of the repository interfaces are usually created by a container, and the Spring container is the most natural choice when working with Spring Data. 5 | Spring Data for Apache Cassandra ships with a custom CDI extension that allows using the repository abstraction in CDI environments. 6 | The extension is part of the JAR.To activate it, drop the Spring Data for Apache Cassandra JAR into your classpath. 7 | You can now set up the infrastructure by implementing a CDI Producer for the 8 | `CassandraTemplate`, as the following examlpe shows: 9 | 10 | ==== 11 | [source,java] 12 | ---- 13 | include::example$CassandraTemplateProducer.java[tags=class] 14 | ---- 15 | ==== 16 | 17 | The Spring Data for Apache Cassandra CDI extension picks up `CassandraOperations` as a CDI bean and creates a proxy for a Spring Data repository whenever a bean of a repository type is requested by the container. 18 | Thus, obtaining an instance of a Spring Data repository is a matter of declaring an injected property, as the following example shows: 19 | 20 | ==== 21 | [source,java] 22 | ---- 23 | include::example$RepositoryClient.java[tags=class] 24 | ---- 25 | ==== 26 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/cassandra/repositories/vector-search.adoc: -------------------------------------------------------------------------------- 1 | :vector-search-intro-include: partial$vector-search-intro-include.adoc 2 | :vector-search-model-include: partial$vector-search-model-include.adoc 3 | :vector-search-repository-include: partial$vector-search-repository-include.adoc 4 | :vector-search-scoring-include: partial$vector-search-scoring-include.adoc 5 | :vector-search-method-derived-include: partial$vector-search-method-derived-include.adoc 6 | :vector-search-method-annotated-include: partial$vector-search-method-annotated-include.adoc 7 | 8 | include::partial$vector-search.adoc[] 9 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/cassandra/value-expressions.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$value-expressions.adoc[] 2 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/commons/upgrade.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$upgrade.adoc[] 2 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/index.adoc: -------------------------------------------------------------------------------- 1 | [[spring-data-cassandra-reference-documentation]] 2 | = Spring Data Cassandra 3 | :revnumber: {version} 4 | :revdate: {localdate} 5 | 6 | _Spring Data for Apache Cassandra provides repository support for the Apache Cassandra database. 7 | It eases development of applications with a consistent programming model that need to access Cassandra data sources._ 8 | 9 | [horizontal] 10 | xref:cassandra.adoc[Cassandra] :: Apache Cassandra support and connectivity 11 | xref:repositories.adoc[Repositories] :: Apache Cassandra Repositories 12 | xref:observability.adoc[Observability] :: Observability Integration 13 | xref:kotlin.adoc[Kotlin] :: Kotlin support 14 | xref:migration-guides.adoc[Migration] :: Migration Guides 15 | https://github.com/spring-projects/spring-data-commons/wiki[Wiki] :: What's New, Upgrade Notes, Supported Versions, additional cross-version information. 16 | 17 | David Webb, Matthew Adams, John Blum, Mark Paluch, Jay Bryant 18 | 19 | (C) 2008-{copyright-year} VMware, Inc. 20 | 21 | 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. 22 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/kotlin.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$kotlin.adoc[] 2 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/kotlin/coroutines.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$kotlin/coroutines.adoc[] 2 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/kotlin/extensions.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$kotlin/extensions.adoc[] 2 | 3 | To retrieve a list of `SWCharacter` objects in Java, you would normally write the following: 4 | 5 | [source,java] 6 | ---- 7 | Flux characters = template.query(SWCharacter.class).inTable("star-wars").all() 8 | ---- 9 | 10 | With Kotlin and the Spring Data extensions, you can instead write the following: 11 | 12 | [source,kotlin] 13 | ---- 14 | val characters = template.query().inTable("star-wars").all() 15 | // or (both are equivalent) 16 | val characters : Flux = template.query().inTable("star-wars").all() 17 | ---- 18 | 19 | As in Java, `characters` in Kotlin is strongly typed, but Kotlin's clever type inference allows for shorter syntax. 20 | 21 | Spring Data for Apache Cassandra provides the following extensions: 22 | 23 | * Reified generics support for `CassandraOperations` (including async and reactive variants), `CqlOperations` (including async and reactive variants)`FluentCassandraOperations`, `ReactiveFluentCassandraOperations`, `Criteria`, and `Query`. 24 | * xref:page$kotlin/coroutines.adoc[Coroutines] extensions for `ReactiveFluentCassandraOperations`. 25 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/kotlin/null-safety.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$kotlin/null-safety.adoc[] 2 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/kotlin/object-mapping.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$kotlin/object-mapping.adoc[] 2 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/kotlin/requirements.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$kotlin/requirements.adoc[] 2 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/migration-guide/migration-guide-3.0-to-4.0.adoc: -------------------------------------------------------------------------------- 1 | [[cassandra.migration.3.x-to-4.x]] 2 | = Migration Guide from 3.x to 4.x 3 | 4 | Spring Data for Apache Cassandra 4.0 introduces a set of breaking changes when upgrading from earlier versions. 5 | 6 | [[asynchronous-template-api]] 7 | == Asynchronous Template API 8 | 9 | With the deprecation of `ListenableFuture`, `AsyncCqlOperations` and `AsyncCassandraOperations` and their dependant classes were migrated to `CompletableFuture`. 10 | If your application heavily depends on `ListenableFuture` and you cannot easily migrate to `CompletableFuture` then we suggest switching to the legacy `Async…Operations` types in the `legacy` subpackage. 11 | That is `org.springframework.data.cassandra.core.cql.legacy` for `AsyncCqlOperations` and `org.springframework.data.cassandra.core.legacy` for `AsyncCassandraOperations`. 12 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/migration-guide/migration-guide-4.0-to-4.3.adoc: -------------------------------------------------------------------------------- 1 | [[cassandra.migration.4.x-to-4.3]] 2 | = Migration Guide from 4.x to 4.3 3 | 4 | Spring Data for Apache Cassandra 4.3 has migrated the `com.datastax.oss` groupId to `org.apache.cassandra`. 5 | 6 | [[driver-group-id]] 7 | == Migration of the Datastax driver into Apache 8 | 9 | With the migration of the Datastax driver into the Apache foundation, you need to update coordinates of the driver in your code. Consider the following example showing a potential previous state of a Maven project configuration: 10 | 11 | .`pom.xml` Example up to 4.2.x 12 | ==== 13 | [source,xml] 14 | ---- 15 | 16 | com.datastax.oss 17 | java-driver-core 18 | 19 | 20 | 21 | com.datastax.oss 22 | java-driver-query-builder 23 | 24 | ---- 25 | ==== 26 | 27 | With upgrading the groupId from `com.datastax.oss` to `org.apache.cassandra` your project configuration would look like: 28 | 29 | .`pom.xml` Example since to 4.3.x 30 | ==== 31 | [source,xml] 32 | ---- 33 | 34 | org.apache.cassandra 35 | java-driver-core 36 | 37 | 38 | 39 | org.apache.cassandra 40 | java-driver-query-builder 41 | 42 | ---- 43 | ==== 44 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/migration-guides.adoc: -------------------------------------------------------------------------------- 1 | [[cassandra.migration]] 2 | = Migration Guides 3 | :page-section-summary-toc: 1 4 | 5 | This section contains version-specific migration guides explaining how to upgrade between two versions. 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/observability/conventions.adoc: -------------------------------------------------------------------------------- 1 | [[observability-conventions]] 2 | = Conventions 3 | 4 | Below you can find a list of all `GlobalObservabilityConventions` and `ObservabilityConventions` declared by this project. 5 | 6 | .ObservationConvention implementations 7 | |=== 8 | |ObservationConvention Class Name | Applicable ObservationContext Class Name 9 | |`org.springframework.data.cassandra.observability.DefaultCassandraObservationConvention`|`n/a` 10 | |=== 11 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/observability/spans.adoc: -------------------------------------------------------------------------------- 1 | [[observability-spans]] 2 | = Spans 3 | 4 | Below you can find a list of all spans declared by this project. 5 | 6 | [[observability-spans-cassandra-query-observation]] 7 | == Cassandra Query Observation Span 8 | 9 | > Create an `io.micrometer.observation.Observation` for Cassandra-based queries. 10 | 11 | **Span name** `spring.data.cassandra.query`. 12 | 13 | Fully qualified name of the enclosing class `org.springframework.data.cassandra.observability.CassandraObservation`. 14 | 15 | 16 | 17 | .Tag Keys 18 | |=== 19 | |Name | Description 20 | |`db.cassandra.consistency_level`| 21 | |`db.cassandra.coordinator.dc`| 22 | |`db.cassandra.coordinator.id`| 23 | |`db.cassandra.idempotence`| 24 | |`db.cassandra.page_size`| 25 | |`db.name`|Name of the Cassandra keyspace. 26 | |`db.operation`|The database operation. 27 | |`db.statement`|A key-value containing Cassandra CQL. 28 | |`db.system`|Database system. 29 | |`net.peer.name`|Name of the database host. 30 | |`net.peer.port`|Logical remote port number. 31 | |`net.sock.peer.addr`|Cassandra peer address. 32 | |`net.sock.peer.port`|Cassandra peer port. 33 | |`net.transport`|Network transport. 34 | |`spring.data.cassandra.methodName`|The method name 35 | |`spring.data.cassandra.node[%s].error`|A tag containing error that occurred for the given node. (since the name contains `%s` the final value will be resolved at runtime) 36 | |`spring.data.cassandra.sessionName`|Cassandra session 37 | |=== 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/repositories.adoc: -------------------------------------------------------------------------------- 1 | [[cassandra.repositories]] 2 | = Repositories 3 | :page-section-summary-toc: 1 4 | 5 | This chapter explains the basic foundations of Spring Data repositories and Cassandra specifics. 6 | Before continuing to the Cassandra 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 | [[cassandra.entity-persistence.state-detection-strategies]] 4 | include::{commons}@data-commons::page$is-new-state-detection.adoc[leveloffset=+1] 5 | 6 | NOTE: Cassandra provides no means to generate identifiers upon inserting data. 7 | As consequence, entities must be associated with identifier values. 8 | Spring Data defaults to identifier inspection to determine whether an entity is new. 9 | If you want to use xref:cassandra/auditing.adoc[auditing] make sure to either use xref:cassandra/template.adoc#cassandra.template.optimistic-locking[Optimistic Locking] or implement `Persistable` for proper entity state detection. 10 | -------------------------------------------------------------------------------- /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 | [[cassandra.projections]] 2 | = Projections 3 | 4 | include::{commons}@data-commons::page$repositories/projections.adoc[leveloffset=+1] 5 | -------------------------------------------------------------------------------- /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 | :feature-scroll: 2 | include::{commons}@data-commons::page$repositories/query-methods-details.adoc[] 3 | -------------------------------------------------------------------------------- /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/modules/ROOT/partials/vector-search-intro-include.adoc: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/partials/vector-search-method-annotated-include.adoc: -------------------------------------------------------------------------------- 1 | .Using `@Query` 2 | ==== 3 | [source,java] 4 | ---- 5 | interface CommentRepository extends Repository { 6 | 7 | @Query(""" 8 | SELECT id, description, country, similarity_cosine(embedding,:embedding) AS score 9 | FROM comments 10 | ORDER BY embedding ANN OF :embedding LIMIT :limit 11 | """) 12 | SearchResults searchAnnotatedByEmbeddingNear(Vector embedding, Limit limit); 13 | } 14 | ---- 15 | ==== 16 | 17 | Cassandra does not allow to limit search results by their score. 18 | Declared search methods can include a `score` projection column if you wish to return the score value. 19 | You can declare a `ScoringFunction` argument to specify which scoring function to use to calculate similarity. 20 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/partials/vector-search-method-derived-include.adoc: -------------------------------------------------------------------------------- 1 | .Using `Near` and `Within` Keywords in Repository Search Methods 2 | ==== 3 | [source,java] 4 | ---- 5 | interface CommentRepository extends Repository { 6 | 7 | List searchByEmbeddingNear(Vector vector); 8 | 9 | SearchResults searchByEmbeddingNear(Vector vector, ScoringFunction function); 10 | 11 | } 12 | ---- 13 | ==== 14 | 15 | Cassandra does not allow to limit search results by their score. 16 | You can declare a `ScoringFunction` argument to specify which scoring function to use to calculate similarity. 17 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/partials/vector-search-model-include.adoc: -------------------------------------------------------------------------------- 1 | ==== 2 | [source,java] 3 | ---- 4 | class Comment { 5 | 6 | @Id String id; 7 | String country; 8 | String comment; 9 | 10 | @VectorType(dimensions = 5) 11 | @SaiIndexed 12 | Vector embedding; 13 | 14 | // getters, setters, … 15 | } 16 | ---- 17 | ==== 18 | 19 | `@VectorType` and `@SaiIndexed` annotations are used to help with schema generation and type hints. 20 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/partials/vector-search-repository-include.adoc: -------------------------------------------------------------------------------- 1 | .Using `SearchResults` in a Repository Search Method 2 | ==== 3 | [source,java] 4 | ---- 5 | interface CommentRepository extends Repository { 6 | 7 | SearchResults searchByEmbeddingNear(Vector vector, ScoringFunction function, Limit limit); 8 | 9 | } 10 | 11 | SearchResults results = repository.searchByEmbeddingNear(Vector.of(…), ScoringFunction.cosine(), Limit.of(10)); 12 | ---- 13 | ==== 14 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/partials/vector-search-scoring-include.adoc: -------------------------------------------------------------------------------- 1 | Cassandra reports the score directly as similarity value through `similarity_euclidean`, `similarity_cosine`, and `similarity_dot_product` functions. 2 | 3 | .Using `ScoringFunction` in a Repository Search Methods 4 | ==== 5 | [source,java] 6 | ---- 7 | interface CommentRepository extends Repository { 8 | 9 | SearchResults searchByEmbeddingNear(Vector vector, ScoringFunction function); 10 | } 11 | 12 | repository.searchByEmbeddingNear(Vector.of(…), ScoringFunction.cosine()); <1> 13 | 14 | repository.searchByEmbeddingNear(Vector.of(…), ScoringFunction.euclidean()); <2> 15 | ---- 16 | 17 | <1> Run a search and return results using the Cosine distance function to compute similarity. 18 | <2> Run a search and return results using the Euclidean distance function to compute similarity. 19 | ==== 20 | 21 | -------------------------------------------------------------------------------- /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 | springdocsurl: https://docs.spring.io/spring-framework/reference/{springversionshort} 16 | springjavadocurl: https://docs.spring.io/spring-framework/docs/${spring}/javadoc-api 17 | spring-framework-docs: '{springdocsurl}' 18 | spring-framework-javadoc: '{springjavadocurl}' 19 | springhateoasversion: ${spring-hateoas} 20 | releasetrainversion: ${releasetrain} 21 | store: Cassandra 22 | -------------------------------------------------------------------------------- /src/main/resources/notice.txt: -------------------------------------------------------------------------------- 1 | Spring Data for Apache Cassandra 5.0 M3 (2025.1.0) 2 | Copyright (c) [2010-2021] 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 the these subcomponents is subject to the terms and 10 | conditions of the subcomponent's license, as noted in the LICENSE file. 11 | 12 | 13 | --------------------------------------------------------------------------------