CassandraAdminTemplate can now be constructed by passing either just a Session or CqlOperations and CassandraConverter to consistently expose the same constructors as its superclass CassandraTemplate.
We now allow configuration of CodecRegistry in CassandraMappingContext to reuse the configured instance instead of using the default CodecRegistry instance.
Replace AtTest(expected = …) and ExpectedException with the corresponding AssertJ assertThatExceptionOfType(…) and assertThatIllegalArgumentException().isThrownBy(…).
We now properly populate composite key properties when the key object is set through the entity constructor. Previously, key properties where left uninitialized (properties were not populated) when the key object was created in the code path to be injected as entity constructor argument. Key properties were only set in the case where the key also was be constructed with constructor arguments.
We now support query derivation for delete queries using delete…By in method declarations.
interface PersonRepository extends Repository<Person, String> {
void deleteWithoutResultByLastname(String lastname);
boolean deleteByLastname(String lastname);
}
String-based queries can now be marked as idempotent. Also, SELECT queries defined via @Query are also considered idempotent to make these retryable.
interface PersonRepository extends Repository<Person, String> {
@Query("SELECT * FROM person WHERE lastname = ?0;") // idempotent by default
Person findByLastname(String lastname);
@Query(value = "UPDATE person SET lastname = ?0", idempotent = Query.Idempotency.IDEMPOTENT)
void updatePerson(String name);
}
We now support auditing using Spring's IsNewAwareAuditingHandler. Entities that are saved are processed before persisting these through auditing EntityCallbacks.
@Table
class Entity {
@Id Long id;
@CreatedDate
LocalDateTime created;
@LastModifiedDate
LocalDateTime modified;
// …
}
@EnableCassandraAuditing
@Configuration
class MyConfiguration extends AbstractReactiveCassandraConfiguration {
// …
}
We now correctly resolve Map key and value types if they are raw/mapped tuple values. Previously, we inspected only the first type without considering whether the property is a map/collection.
Resolution of types is now recursive and considers whether the property is a map or a collection.
We also consistently use MappingException to indicate type resolution failures.
We now detect the Id property repositories using MapId with single keys. Cassandra supports only single keys with IN queries so we reject composite keys using imperative repositories with MapId in findAllById(findAllById).
The reactive findAllById(…) repository method fetched rows one-by-one. We now optimize the query using IN queries with a single roundtrip if possible. Composite MapId keys are fetched one-by-one as previously done as fallback.