Id types for entities are no longer required to implement Serializable. This requirement originates from ancient ORM patterns and had never a technical requirements for Cassandra. Id types are required to map either directly or convert to a Cassandra-supported data type.
Removal of deprecated and obsolete types and members. Listeners became obsolete by providing AsynCqlTemplate/AsyncCassandraTemplate as async operations return futures that allow synchronization. Other types are not used anymore.
Strict mode is no longer used. Switching to a lenient verification can be achieved with a custom verifier. Made VerifierMappingExceptions immutable by removing VerifierMappingExceptions.add(…).
Introduce CassandraCustomConversions extending o.s.d.convert.CustomConversions.
Remove o.s.d.cassandra.convert.CustomConversions implementation and utility classes, extend CassandraCustomConversions. Replace references to o.s.d.c.c.CustomConversions with o.s.d.convert.CustomConversions. Adapt tests and MappingCassandraConverter to CassandraCustomConversions.
Related ticket: DATACMNS-1035.
Replace Flux/Mono.onErrorResumeWith(…) with Flux/Mono.onErrorMap(…) and turn translateException into a method returning a mapping function instead of a Mono emitting the mapped exception.
We now test compatibility with Apache Cassandra's duration type (introduced with Apache Cassandra 3.10). Duration requires a driver version >= 3.2.0 so we drop build profiles against earlier driver versions and use Apache Cassandra 3.10 for integration tests.
Enforce frozen user types in collection types when creating tables and frozen user types when referencing a user type from another type. Previously, the driver returned frozen user-types and no interaction from our side was required. Move user-type specifics to UserTypeUtil.
Introduce compatibility code within the tests to build against different driver versions.
We now no longer insert null values via CassandraOperations.insert(…). Inserting null values creates tombstones in Cassandra which are likely unwanted and impact performance. Omitting null values simply does not create values in Cassandra. Setting properties to null with UPDATE remains unchanged and updating an object containing null values will propagate all null values to Cassandra as part of the UPDATE clause.
SimpleCassandraRepository.save(…) needs to consider whether the entity is new or whether it consists only of primary key properties to propagate the optimization. New entities and entities consisting only of primary key columns are saved via INSERT. All other entities are saved via UPDATE.
We now support configuration of a CqlTemplate reference when creating CassandraTemplate via XML namespace configuration. Configuring a reference allows reusing an existing CqlOperations instance via CassandraTemplateFactoryBean. Additionally, CassandraTemplateFactoryBean now supports setting a SessionFactory.
<cql:template id="my-cql-template" />
<cassandra:template cql-template-ref="my-cql-template"/>
We now use the correct bean name `cassandraTemplate` when configuring a CassandraTemplate instance via XML namespace support. Previously, the bean name defaulted to `cqlTemplate`. CassandraTemplate and CqlTemplate no longer share the same type hierarchy but are separated since 2.0.x.
Original pull request: #96.
Related ticket: DATACASS-292.
We now consider the element type and property component type when reading Cassandra collections (sets and lists). Inspecting every collection element regarding its source and target type allows a fine grained conversion of elements to the target type.
Previously, we just applied conversion if custom converters were registered. This change also considers the declared collection type of the property.