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.
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.
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);
Introduce ReactiveResultSet.availableRows() to fetch rows without transparent paging. Refactor QueryUtils to extract a Slice from an Iterable. Add slice(Query, Class) to ReactiveCassandraOperations to expose a consistent API. Convert space indentation to tab indentation. Add tests. Add since tags. Add documentation. Reformat code.
Original pull request: #128.
We now provide Kotlin extensions for imperative, asynchronous, and reactive Template API interfaces.
CqlOperations and CassandraOperations expose Kotlin-friendly methods accepting KClasses and leveraging reified generics. We also provide Kotlin-friendly method renames for methods such as in that do not require quoting in Kotlin code.
operations.query(Person::class).inTable("my_table").asType<User>().all()
operations.select<Person>(query(where("firstname").isEqualTo("Walter") and where("lastname").isEqualTo("White")))
We now support Cassandra time columns via LocalTime types (JSR-310, Joda and ThreeTenBackport) in domain classes, queries and updates.
@Table
class Schedule {
@Id String id;
LocalTime scheduledAt;
}
Add AfterConvertEvent, introduce base class for AbstractDeleteEvent. Turn table name in mapping events to non-nullable. Replace guessTableName(…) with getTableName(…) and table name extraction from statements. Pass table name to converter mapper function for event propagation. Refactor tests to base class and test operations accessor.
Introduce lifecycle events and ProjectionFactory to AsyncCassandraTemplate.
Extend JavaDoc, add author and since tags. Reduce copyright year to inception year of new classes. Extend reference documentation.
Original pull request: #123.
We now support persistence lifecycle callbacks via Spring's ApplicationEvents. Events are fired upon select, insert, update, delete, and truncate statements. The following events are available:
* BeforeSaveEvent: Before inserting/updating a row in the database, via insert(…) and update(…).
* AfterSaveEvent: After inserting/updating a row in the database, via insert(…) and update(…).
* BeforeDeleteEvent: Before deleting row from the database, via delete(…) and truncate(…).
* AfterDeleteEvent: After deleting row from the database, via delete(…) and truncate(…).
* AfterLoadEvent: After retrieving a row from the database, via select(…), slice(…), and stream(…).
* AfterConvertEvent: After converting a row from the database to a POJO, via select(…), slice(…), and stream(…).
Original pull request: #123.