Commit Graph

1101 Commits

Author SHA1 Message Date
Mark Paluch
e295e615bd DATACASS-638 - Skip properties that are not part of the result.
We now skip properties during mapping (assign a null value) if the backing result (Row, UDT) does not contain a particular column.

Resultsets with limited columns are common for projections, in interface projections we use the actual entity to back calls to the projection.
2019-03-12 14:30:15 +01:00
Mark Paluch
a704df7ec8 DATACASS-636 - Enable CriteriaExtensionsUnitTests after MockK bugfix. 2019-03-11 11:15:50 +01:00
Christoph Strobl
cc4bfebbf2 DATACASS-614 - After release cleanups. 2019-03-07 10:07:29 +01:00
Christoph Strobl
9323214b3f DATACASS-614 - Prepare next development iteration. 2019-03-07 10:07:28 +01:00
Christoph Strobl
7ff4d07530 DATACASS-614 - Release version 2.2 M2 (Moore). 2019-03-07 09:42:21 +01:00
Christoph Strobl
1d368a8c44 DATACASS-614 - Prepare 2.2 M2 (Moore). 2019-03-07 09:41:17 +01:00
Christoph Strobl
16a72f1525 DATACASS-614 - Updated changelog. 2019-03-07 09:41:10 +01:00
Mark Paluch
afad1bf5c9 DATACASS-634 - Upgrade to Cassandra Driver 3.7.1. 2019-03-07 07:09:02 +01:00
Greg Turnquist
2a2281372f DATACASS-619 - Polishing. 2019-03-01 09:59:51 -06:00
Greg Turnquist
7672e221d1 DATACASS-619 - Use full 8-jdk Docker image. 2019-03-01 09:34:47 -06:00
John Blum
159c678f29 DATACASS-576 - Polish.
Resolves gh-136.
2019-02-28 17:38:21 -08:00
Mark Paluch
16268f101f DATACASS-576 - Formatting.
Reorder methods for consistent method ordering.
2019-02-28 17:38:01 -08:00
Mark Paluch
7a8f91ade3 DATACASS-576 - Add support for Optimistic Locking.
We now support Optimistic Locking for insert, update and delete operations leveraging Cassandra's lightweight transaction support. Modifying statements are enhanced with IF conditions to conditionally insert and modify rows and to prevent concurrent modifications by throwing OptimisticLockingFailureException.

@Table
class Person {

  @Id String id;
  String firstname;
  String lastname;
  @Version Long version;
}

Person daenerys = template.insert(new Person("Daenerys"));

Person tmp = template.findOne(query(where("id").is(daenerys.getId())), Person.class);

daenerys.setLastname("Targaryen");
template.save(daenerys);

template.save(tmp); // throws OptimisticLockingFailureException
2019-02-28 17:22:12 -08:00
Greg Turnquist
b01e1fc144 DATACASS-619 - Polishing. 2019-02-28 09:44:31 -06:00
Greg Turnquist
e58e0ce6ef DATACASS-619 - Introduce Concourse. 2019-02-28 09:37:16 -06:00
John Blum
d0ba389cae DATACASS-631 - Polish.
Resolves gh-138.
2019-02-26 18:46:22 -08:00
Mark Paluch
ccb15af88b DATACASS-631 - Deprecate Kotlin extensions providing a KClass overload.
We promote the usage of reified Kotlin API usage (myMethod<Person>() instead of myMethod(Person::class)) to facilitate a single and more idiomatic approach to Kotlin API usage.

Extension methods accepting KClass are deprecated now.
2019-02-26 18:46:15 -08:00
John Blum
101ee2aee7 DATACASS-575 - Polish.
Resolves gh-135.
2019-02-26 18:45:32 -08:00
Mark Paluch
0e624c9cc4 DATACASS-575 - Support IF conditions in lightweight transactions with UPDATE and DELETE.
We now support conditions in lightweight transactions for UPDATE and DELETE statements. Conditions are Filter objects similar to the WHERE clause. Conditions are supported for entity and query-based update/delete methods.

UpdateOptions options = UpdateOptions.builder().ifCondition(where("firstname").is("Walter")).build();
User user = new User("heisenberg", "Walter", "White");
template.update(user, options);

DeleteOptions options = DeleteOptions.builder().ifCondition(where("counter").is(42)).build();
Query query = Query.query(where("id").is("heisenberg")).queryOptions(options);
template.delete(query, User.class);
2019-02-26 17:45:10 -08:00
Mark Paluch
314bbb1261 DATACASS-633 - Silently traverse CassandraPersistentEntity associations.
BasicCassandraPersistentEntity.doWithAssociations(…) now no longer throws UnsupportedCassandraOperationException when trying to traverse associations. Calling doWithAssociations results in a no-op as there are no associations.

Related ticket: DATAREST-1337.
2019-02-26 14:51:03 +01:00
Mark Paluch
00734b67ea DATACASS-632 - Add ReactiveFluentCassandraOperations Coroutines extensions.
This commit introduces Coroutines support for ReactiveFluentCassandraOperations API via Kotlin extensions that provide suspendable functions prefixed by `await` or suffixed by `AndAwait` for Mono based APIs.

Extensions for Flux will be added when Kotlin/kotlinx.coroutines#254 is fixed.
2019-02-22 15:07:32 +01:00
Mark Paluch
dd3a5a680a DATACASS-627 - Add support for derived Between queries.
We now support derived queries using the Between keyword. Between query parts map to either two simple parameters (findByAgeBetween(int from, int to)) or a Range<T> parameter that defines inclusive/exclusive boundary comparison (findByAgeBetween(Range<Integer> age)).

Between queries use are issued by default as exclusive ranges so findByAgeBetween(int from, int to) maps to age > from AND age < to.
2019-02-22 11:12:45 +01:00
Mark Paluch
8acc6d2111 DATACASS-630 - Remove version for managed Kotlin dependencies.
Versions are managed by kotlin-bom.
2019-02-21 10:06:39 +01:00
Mark Paluch
a1438bbae4 DATACASS-629 - Disable CriteriaExtensionsUnitTests.
See mockk/mockk#259.
2019-02-20 13:06:24 +01:00
Mark Paluch
78635b954c DATACASS-629 - Polishing.
Remove superfluous files.
2019-02-20 12:50:22 +01:00
Mark Paluch
1a02109681 DATACASS-629 - Migrate Kotlin tests to Mockk. 2019-02-20 12:50:22 +01:00
Mark Paluch
a7a104e1fd DATACASS-628 - Polishing.
Add synchronization to inserts to properly await completion before querying data.
2019-02-15 11:28:21 +01:00
Mark Paluch
1437bf347c DATACASS-628 - Adapt tests to AssertJ 3.12.0. 2019-02-15 11:27:51 +01:00
Mark Paluch
aa3ed4e22b DATACASS-622 - Updated changelog. 2019-02-13 11:47:52 +01:00
Mark Paluch
f34982a223 DATACASS-625 - Upgrade to Apache Cassandra 3.11.4. 2019-02-12 10:39:32 +01:00
Mark Paluch
a23d14277c DATACASS-599 - Polishing.
Add executor to other Futures.transform(…) and Futures.addCallback(…) invocations.

Original pull request: #137.
2019-02-06 13:26:55 +01:00
Mateusz Stefek
dcae89029c DATACASS-599 - Restore compatibility with Guava 26+.
Guava has removed Futures#transform method without the Executor parameter in version 26.0-jre
DefaultBridgeReactiveSession fails with NoSuchMethod exception when used with Guava 26.0-jre+.

Original pull request: #137.
2019-02-06 13:26:53 +01:00
Mark Paluch
3a062afafb DATACASS-623 - Add support for read-only properties.
We now support read-only properties by annotating such properties with @ReadOnlyProperty. Read-only properties are read from results but never written (i.e. through INSERT or UPDATE) back to Cassandra.

Read-only properties can still be updated by using the Update/Query API.

class Person {

  @Id String id;

  String firstname;
  String lastname;
  @ReadOnlyProperty String externallyUpdatedProperty;
}

CassandraTemplate template = …
Person person = …
template.insert(person);
2019-01-31 10:01:30 +01:00
Mark Paluch
9e825d376e DATACASS-585 - Document relationship between @PrimaryKeyColumn and @Id.
Document that using PrimaryKeyColumn does not mark properties as Id properties.
2019-01-30 09:51:08 +01:00
Mark Paluch
0deec5eb96 DATACASS-313 - Polishing.
Remove superfluous throws declaration in tests.
2019-01-28 16:14:29 +01:00
Mark Paluch
1be26f9612 DATACASS-313 - Limit queried fields for projections.
We now limit the selected fields when using projections in repository query methods and by using query operations. Queries that return either a closed interface projection or DTO projection are inspected for the select fields and only these fields are included in the SELECT list.
2019-01-28 16:13:15 +01:00
Mark Paluch
9e4c603d17 DATACASS-189 - Add test for transient properties. 2019-01-28 14:01:08 +01:00
Mark Paluch
b1879b2e4c DATACASS-617 - Accept WriteOptions in imperative and reactive delete(…) through batch operations.
CassandraBatchOperations.delete(…) and ReactiveCassandraBatchOperations.delete(…) methods now accept WriteOptions and subclasses (such as DeleteOptions) to adjust delete behavior.

Related ticket: DATACASS-606.
2019-01-28 13:52:26 +01:00
Mark Paluch
005c9a7078 DATACASS-606 - Support LWT for delete operations (DELETE .. IF EXISTS).
We now support lightweight transactions for entity deletion through DeleteOptions.

User user = …

DeleteOptions options = DeleteOptions.builder().withIfExists().build();
boolean applied = template.delete(user, options);
2019-01-28 13:52:26 +01:00
Mark Paluch
aa54b8a9a1 DATACASS-610 - Updated changelog. 2019-01-10 14:15:39 +01:00
Mark Paluch
d917c7ec40 DATACASS-609 - Updated changelog. 2019-01-10 12:26:31 +01:00
Mark Paluch
1612cfb001 DATACASS-608 - Updated changelog. 2019-01-10 11:01:17 +01:00
Mark Paluch
e6b5c5e7a2 DATACASS-616 - Update copyright years to 2019. 2019-01-02 12:22:19 +01:00
Christoph Strobl
c43783de22 DATACASS-612 - After release cleanups. 2018-12-11 11:07:52 +01:00
Christoph Strobl
dfdb2fb394 DATACASS-612 - Prepare next development iteration. 2018-12-11 11:07:51 +01:00
Christoph Strobl
b3e1f81358 DATACASS-612 - Release version 2.2 M1 (Moore). 2018-12-11 10:53:53 +01:00
Christoph Strobl
f64e851ac2 DATACASS-612 - Prepare 2.2 M1 (Moore). 2018-12-11 10:53:11 +01:00
Christoph Strobl
42a833887f DATACASS-612 - Updated changelog. 2018-12-11 10:53:07 +01:00
Mark Paluch
63747cef1f DATACASS-613 - Simplify reference documentation setup. 2018-12-10 10:04:26 +01:00
Mark Paluch
7c08eba31d DATACASS-605 - Updated changelog. 2018-11-27 14:54:05 +01:00