We now insert the entire object including null values again in Cassandra using the repository save method. Objects that are saved through the repository are expected to be returned the same when retrieved again.
Cassandra entities don't have any indicator whether these entities are new to optimize null value handling and prevent tombstones in Cassandra. CassandraRepository exposes insert(…) to insert objects without inserting null values.
Previously, we attempted to execute insert/update conditionally on the entity structure which ended up issuing update statements containing all null values. Entities were not created and save(…) failed silently.
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.
Related ticket: DATACASS-428.
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.
Extend year range in copyright headers. Reformat code. Add JavaDoc. Add ticket references to test methods. Remove unused code. Add guard to test to not call UserTypeResolver during type creation. Rename UserDataTypeProvider to DataTypeProvider and the individual constants to reflect what they provide.
Original pull request: #100.
Works for simple user defined types and those used in Lists or Sets.
It does not work yet for maps and other collection-like types.
Related tickets: DATACASS-409.
Original pull request: #100.
Add id attribute to XML schema for Spring Data Cassandra Namespace support. Rename CassandraMappingBeanFactoryPostProcessorTests to CassandraMappingBeanFactoryPostProcessorUnitTests to execute the test in the build.
Original pull request: #94.
We now provide a more fine-grained exception translation for exceptions that previously mapped to CassandraUncategorizedException. Existing translation to more specific exception does not change. The following translation rules are introduced by this change:
* OverloadedException and BootstrappingException map to TransientDataAccessResourceException
* NoHostAvailableException, BusyPoolException, ConnectionException, BusyConnectionException map to CassandraConnectionFailureException
* QueryConsistencyException, FunctionExecutionException map to DataAccessResourceFailureException
We now apply custom conversion and UDT mapping to the value provider that is used with entity instantiators. This allows entities to be instantiated with mapped UDTs and using custom conversion with properties that are provided using a constructor.
Previously, columns were not converted which caused a parameter mismatch so entities couldn't be instantiated.
Align declared type of CassandraCqlTemplateFactoryBean to CqlTemplate and the type of CassandraTemplateFactoryBean to CassandraTemplate to report consistent bean types. Add JavaDoc.
Original pull request: #76.
We now support multiple Cassandra keyspaces by allowing multiple definitions of Sessions, Mapping Contexts, Converters and CassandraTemplates.
Added support for id attribute for converter and mapping context elements and adopt CassandraMappingBeanFactoryPostProcessor to scan with eager initialization for existing infrastructure components. We are lenient about the source (factory bean or concrete bean definition) for infrastructure beans (Session, Converter, Mapping Context, Template) and register only the necessary beans.
Original pull request: #76.
Reuse Thread pools during integration test runs to not recreate and dispose Threads multiple times. Increase build and Cassandra memory. Use an external Cassandra instance for TravisCI build jobs.