spring-projects / spring-data-cassandra

Provides support to increase developer productivity in Java when using Apache Cassandra. Uses familiar Spring concepts such as a template classes for core API usage and lightweight repository style data access.
https://spring.io/projects/spring-data-cassandra/
Apache License 2.0
381 stars 311 forks source link

Return value of `BeforeConvertCallback.onBeforeConvert()` is not used when actually saving #1295

Closed idemockle closed 2 years ago

idemockle commented 2 years ago

When I create a copy of the entity passed into BeforeConvertCallback.onBeforeConvert(), make changes to the copy, then return the copy, the original entity object is used to generate the insert query instead of the modified copy. I would expect the copy to be used instead, otherwise it's hard for me to see why onBeforeConvert() would return a value.

mp911de commented 2 years ago

This is a bug in the CassandraTemplate and AsyncCassandraTemplate classes where the insert of non-versioned entities is affected.