Commit Graph

819 Commits

Author SHA1 Message Date
Mark Paluch
870337d00a DATACASS-436 - Updated changelog. 2017-06-07 12:23:34 +02:00
Mark Paluch
d09e8d6e3f DATACASS-448 - Update Javadoc references to relocated packages.
Fix Javadoc leftovers after package relocation.
2017-06-06 13:43:06 +02:00
Mark Paluch
61d9910048 DATACASS-456 - Polishing.
Switch instance methods to static methods where possible. Reduce method visibility in CassandraMappingContext and CassandraSimpleTypeHolder.

Reorder methods in MappingCassandraConverter. Remove unused CassandraPersistentProperty.isIndexed/getOwner methods and PropertyToFieldNameConverter type.

Remove CassandraPersistentEntity.getApplicationContext() and inject application context to BasicCassandraPersistentProperty from CassandraMappingContext.
2017-06-06 13:43:06 +02:00
Mark Paluch
88d962b261 DATACASS-456 - Refactor CassandraPersistentProperty to single-column.
CassandraPersistentProperty can now map only to a single column. Previously, CassandraPersistentProperty covered composite primary key mapping which required the mapping context in BasicCassandraPersistentProperty to resolve composite primary key entities. Composite primary keys are now resolved upfront without the need of indirection through CassandraPersistentProperty.
2017-06-06 13:43:06 +02:00
Mark Paluch
c0892b4aef DATACASS-455 - Polishing.
Remove unused caches in CassandraMappingContext. Use CqlIdentifier instead of driver types (TableMetadata, UserType) to look up table/user type usage.
2017-06-06 13:43:06 +02:00
Mark Paluch
820fef2ecd DATACASS-455 - Refactor BasicCassandraMappingContext to CassandraMappingContext.
Remove CassandraMappingContext interface and replace it with BasicCassandraMappingContext. CassandraPersistentEntity is no longer required to declare MutablePersistentEntity but it's sufficient to implement PersistentEntity. Fall back to MappingContext instead of CassandraMappingContext use where just MappingContext is required.

Reintroduce BasicCassandraMappingContext extending from CassandraMappingContext to reduce breaking changes and ease migration.
2017-06-06 13:43:02 +02:00
Mark Paluch
cf2ce9f0cd DATACASS-446 - Resolve package cycles.
* Resolve cycle between o.s.d.c.cql.core and o.s.d.c.cql.support via CassandraAccessor.
* Resolve cycle between o.s.d.c.cql.core.support and o.s.d.c.cql.support via CQLExceptionTranslator.
* Resolve cycle between o.s.d.c.cql.config and o.s.d.c.cql.core.keyspace via KeyspaceAttributes/DataCenterReplication.
2017-06-02 11:16:19 +02:00
Mark Paluch
caf4160604 DATACASS-452 - Align naming scheme for CassandraRepository.
We now follow a more consistent naming scheme for cassandra repository interfaces.

* The basic, store-specific interface is now named CassandraRepository
* An extended variant, using MapId's is named MapIdCassandraRepository

That results in the following renames:

* CassandraRepository -> MapIdCassandraRepository
* TypedIdCassandraRepository -> CassandraRepository

TypedIdCassandraRepository was re-introduced as deprecated variant now extending CassandraRepository to preserve a majority of existing repository declarations.
2017-06-01 11:43:32 +02:00
Mark Paluch
86c510a8c5 DATACASS-453 - Upgrade to Reactor 3.1 M2.
Adopt to API change from Publisher.subscribe() to Publisher.toProcessor(). Adopt to changed reactor-test groupId. Provide mocks for calls that allowed previously null Publishers.
2017-06-01 10:04:33 +02:00
Mark Paluch
0503d6362f DATACASS-445 - Polishing.
Reorder fields. Reduce visibility.
2017-05-29 09:29:12 +02:00
Mark Paluch
aa0ce818b4 DATACASS-445 - Insert entire object on CassandraRepository.save(…).
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.
2017-05-29 09:25:51 +02:00
Mark Paluch
cc4625f492 DATACASS-448 - Polishing.
Reformat code. Extend year range in license headers.
2017-05-24 11:48:39 +02:00
Mark Paluch
2b3f70ea92 DATACASS-448 - Relocate CQL, mapping and convert packages.
We relocated packages of the former Spring CQL module and mapping/convert packages of the Spring Data Cassandra module:

org.springframework.cassandra -> org.springframework.data.cql
org.springframework.cassandra.core.cql.generator -> org.springframework.data.cql.core.generator
org.springframework.cassandra.core.cql -> org.springframework.data.cql.core
org.springframework.data.cassandra.convert -> org.springframework.data.cassandra.core.convert
org.springframework.data.cassandra.mapping -> org.springframework.data.cassandra.core.mapping
2017-05-24 11:48:35 +02:00
Adam Holmberg
206999725a DATACASS-449 - Remove redundant paragraph in preface.
Original pull request: #104.
2017-05-24 10:28:34 +02:00
Mark Paluch
4e30a54da0 DATACASS-443 - Polishing.
Add author tags. Extend year range in license headers. Enhance javadoc. Reformat code. Add assertions and minor cleanups.

Original pull request: #102.
2017-05-24 09:44:47 +02:00
asabbi
001dc0749e DATACASS-443 - Added TTL support for batch insert and update.
We now support setting TTL with batch insert/update operations via WriteOptions in CassandraBatchOperations.

Original pull request: #102.
2017-05-24 09:41:28 +02:00
Mark Paluch
ade33b06c7 DATACASS-447 - Polishing.
Cleanup tests, remove duplications and reduce type scope of involved tables.
2017-05-23 16:27:16 +02:00
Mark Paluch
a5bcc7d4b8 DATACASS-447 - Introduce AbstractCassandraConfiguration.getInitialEntitySet.
Introduce hook method to declare a set of initial entities to bypass entity scan.
2017-05-23 16:22:31 +02:00
Mark Paluch
19c1e35a01 DATACASS-265 - Merge Spring CQL into Spring Data Cassandra module. 2017-05-23 16:22:31 +02:00
Mark Paluch
319b7ce3d7 DATACASS-343 - Polishing.
Remove merge artifacts.
2017-05-23 09:23:48 +02:00
John Blum
2f4767d80f DATACASS-343 - Polish. 2017-05-16 11:02:03 -07:00
Mark Paluch
3e4016da42 DATACASS-343 - Provide reference documentation. 2017-05-15 16:16:15 -07:00
Mark Paluch
36ba47e5fc DATACASS-343 - Introduce Query and Update objects.
We now support fluent query creation for Cassandra queries via Query. Query predicates are built with Criteria and Query that also take QueryOptions, Sort and limiting. Query accepts a column specification to specify column inclusion/exclusion along with function specification (TTL, WRITETIME).

Query query = Query.query(Criteria.where("userId").in("heisenberg", "mike")).and(Criteria.where("age").gt("51"));

query = query.columns(Columns.from("userId", "age").include("firstname"))
		.with(new Sort("age"))
		.with(QueryOptions.builder().fetchSize(10).build())
		.withAllowFiltering()
		.limit(10);

List<Person> people = operations.select(query, Person.class);

Query can be used with select, stream, update and delete Template API methods.

We now support fluent update creation via Update to specify individual update actions for a selection of rows.

Update supports the common Cassandra update assignments for singular, collection and map-typed columns and can increment/decrement counter columns.

Update update = Update.update("lastname", "White")
    .addTo("firearms").appendAll("Ruger LCR", "M60")
    .remove("propertiesSet", "trust")
    .clear("friends");

Query query = Query.query(Criteria.where("id").is("heisenberg"));

template.update(query, update, Person.class);

Update can be used with the update Template API methods.
2017-05-15 16:16:07 -07:00
Mark Paluch
08f1e66160 DATACASS-426 - After release cleanups. 2017-05-09 11:34:42 +02:00
Mark Paluch
7323f4ab69 DATACASS-426 - Prepare next development iteration. 2017-05-09 11:34:41 +02:00
Mark Paluch
29d42f0866 DATACASS-426 - Release version 2.0 M3 (Kay). 2017-05-09 11:23:00 +02:00
Mark Paluch
11777321b5 DATACASS-426 - Prepare 2.0 M3 (Kay). 2017-05-09 11:22:12 +02:00
Mark Paluch
f3dc41b040 DATACASS-426 - Updated changelog. 2017-05-09 11:22:03 +02:00
Mark Paluch
b8f9876ea6 DATACASS-282 - Polishing.
Encapsulate fields in BasicCassandraMappingContext, BasicCassandraPersistentEntity, BasicCassandraPersistentProperty, and refactor to immutable fields where possible.
2017-05-04 17:57:57 +02:00
Mark Paluch
14b7b8d56c DATACASS-282 - Include only valid entities in BasicCassandraMappingContext caches.
We now only cache verified entities (by CassandraPersistentEntityMetadataVerifier) after adding PersistingEntities to the mapping context.

Previously invalid entities were included in the cache and calls to methods using caching returned invalid entities that were cached but not part of the mapping context.
2017-05-04 17:42:46 +02:00
Mark Paluch
a596e1db4e DATACASS-395 - Polishing.
Add Javadoc and static constants of converters. Fix static final modifier keyword order.
2017-05-04 14:50:38 +02:00
Mark Paluch
8737126725 DATACASS-395 - Refactor to immutable converters.
Mutable ResultSet to List/Array converters are now immutable.
2017-05-04 14:38:47 +02:00
Christoph Strobl
438c6ae9e2 DATACASS-423 - Remove obsolete build profiles.
Remove Spring 4.x build profiles form travis.yml.
2017-05-04 14:26:18 +02:00
Mark Paluch
48120151fd DATACASS-367 - Drop Serializable requirement on Id types.
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.
2017-05-03 17:56:56 +02:00
Mark Paluch
552c5464c4 DATACASS-441 - Adapt to API changes in repository interfaces.
Related ticket: DATACMNS-944.
2017-05-03 17:56:52 +02:00
Mark Paluch
fee427e46c DATACASS-440 - Remove support for JodaTime's deprecated DateMidnight.
Related ticket: DATACMNS-1014.
2017-05-03 08:36:28 +02:00
Mark Paluch
9679506278 DATACASS-439 - Polishing.
Refactor static converter instances to enum types with a single instance.
2017-04-26 13:59:35 +02:00
Mark Paluch
69e4ddd3cc DATACASS-439 - Remove deprecated types and members.
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.
2017-04-26 13:45:08 +02:00
Mark Paluch
b5763bc696 DATACASS-434 - Remove own ConsistencyLevel and RetryPolicy types.
Remove own ConsistencyLevel and RetryPolicy types in favor of driver types.
2017-04-26 13:30:38 +02:00
Mark Paluch
b175953ff9 DATACASS-435 - Remove strict mode in BasicCassandraPersistentEntityMetadataVerifier.
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(…).
2017-04-26 13:16:12 +02:00
Mark Paluch
f92ce6ebe8 DATACASS-438 - Adapt to moved CustomConversions to Spring Data Commons.
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.
2017-04-24 08:40:10 +02:00
Oliver Gierke
3991e2ef17 DATACASS-433 - Updated changelog. 2017-04-19 21:04:13 +02:00
Oliver Gierke
4a519655e3 DATACASS-432 - Updated changelog. 2017-04-19 20:01:42 +02:00
Mark Paluch
41dc6e739f DATACASS-430 - Polishing.
Move off deprecated API usage in tests.
2017-04-19 14:25:16 +02:00
Mark Paluch
dd697dff26 DATACASS-430 - Adopt changed Mono and Flux error handling API.
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.
2017-04-19 14:25:16 +02:00
Mark Paluch
352dfd6879 DATACASS-431 - Disable tests for ALTER TYPE support on Apache Cassandra 3.10.
Apache Cassandra does not allow altering column/field types since version 3.10. We don't run these tests anymore for version 3.10 and later.
2017-04-19 14:24:59 +02:00
Mark Paluch
0ff0f2348b DATACASS-429 - Assert compatibility with Duration type.
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.
2017-04-19 14:24:59 +02:00
Mark Paluch
dfc53b635a DATACASS-424 - Upgrade to Cassandra driver 3.2.0.
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.
2017-04-19 14:24:59 +02:00
Oliver Gierke
ca32108d8b DATACASS-411 - Updated changelog. 2017-04-19 13:04:03 +02:00
Oliver Gierke
fec80a10ce DATACASS-410 - Updated changelog. 2017-04-19 11:50:42 +02:00