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.
TypedIdCassandraRepository redeclares save() and findAll(…) methods returning List. Propagating the more specialized return type allows easier use of the collection result.
We now issue individual statements to save and delete each element of a collection of objects when used with CassandraRepository.save(Iterable) and CassandraRepository.delete(Iterable). Previously, the collection argument was considered an entity.
Save/delete do not use batch operations to prevent accidental wrong use of Cassandra batches.
We now issue individual statements to save and delete each element of a collection of objects when used with CassandraRepository.save(Iterable) and CassandraRepository.delete(Iterable). Previously, the collection argument was considered an entity.
Save/delete do not use batch operations to prevent accidental wrong use of Cassandra batches.
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.
We now support Session routing with AbstractRoutingSessionFactory. Session routing is based on a map, keyed by a lookup key that is supplied by an implementing class upon Session lookup.
Extend JavaConfig to configure a SessionFactory bean and configure CqlTemplate and CassandraAdminTemplate accordingly.
We now support SessionFactory to obtain Cassandra Session's on a per-request basis. CassandraAccessor is configured primarily with a SessionFactory now, the existing initialization configures a DefaultSessionFactory that returns the initially given Session instance.
Sessions should not be acquired directly by getSession but inside a callback-block so it's guaranteed to operate on the same session within a particular operation. That's especially relevant when preparing and executing prepared statements.
PreparedStatementCallback was changed in a breaking way as it now accepts additionally a Session to retain the session context.
Related ticket: DATACASS-32
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.