DATACASS-688 - Add documentation for Kotlin support.

This commit is contained in:
Mark Paluch
2019-09-27 12:12:22 +02:00
parent 3ac03744cd
commit 75f4d76324
3 changed files with 34 additions and 5 deletions

View File

@@ -30,6 +30,7 @@ include::reference/reactive-cassandra-repositories.adoc[leveloffset=+1]
include::{spring-data-commons-docs}/auditing.adoc[leveloffset=+1]
include::reference/cassandra-auditing.adoc[leveloffset=+1]
include::reference/mapping.adoc[leveloffset=+1]
include::reference/kotlin.adoc[leveloffset=+1]
[[appendix]]
= Appendix

View File

@@ -5,15 +5,15 @@ This chapter summarizes changes and new features for each release.
[[new-features.2-2-0]]
== What's new in Spring Data for Apache Cassandra 2.2
* Read-only properties annotated with `@ReadOnlyProperty` to exclude non-writable properties from entity-bound `INSERT` and `UPDATE` operations.
* Support for derived `Between` queries.
* Kotlin Coroutine extensions for `ReactiveFluentCassandraOperations`.
* Lightweight transaction support via `DeleteOptions` using the Template API.
* Filter conditions for lightweight transaction update and delete (`UPDATE … IF <condition>`, `DELETE … IF <condition>`).
* Optimistic Locking support.
* Auditing via `@EnableCassandraAuditing`.
* Idempotency support in `@Query` annotation.
* Lightweight transaction support via `DeleteOptions` using the Template API.
* Support for derived `Between` queries.
* Query derivation for <<cassandra.repositories.queries.delete,`DELETE` queries>>.
* <<kotlin.coroutines, Kotlin Coroutines support>> for `ReactiveFluentCassandraOperations`.
* Idempotency support in `@Query` annotation.
* Read-only properties annotated with `@ReadOnlyProperty` to exclude non-writable properties from entity-bound `INSERT` and `UPDATE` operations.
[[new-features.2-1-0]]
== What's new in Spring Data for Apache Cassandra 2.1

View File

@@ -0,0 +1,28 @@
include::../{spring-data-commons-docs}/kotlin.adoc[]
include::../{spring-data-commons-docs}/kotlin-extensions.adoc[leveloffset=+1]
To retrieve a list of `SWCharacter` objects in Java, you would normally write the following:
[source,java]
----
Flux<SWCharacter> characters = template.query(SWCharacter.class).inTable("star-wars").all()
----
With Kotlin and the Spring Data extensions, you can instead write the following:
[source,kotlin]
----
val characters = template.query<SWCharacter>().inTable("star-wars").all()
// or (both are equivalent)
val characters : Flux<SWCharacter> = template.query().inTable("star-wars").all()
----
As in Java, `characters` in Kotlin is strongly typed, but Kotlin's clever type inference allows for shorter syntax.
Spring Data for Apache Cassandra provides the following extensions:
* Reified generics support for `CassandraOperations` (including async and reactive variants), `CqlOperations` (including async and reactive variants)`FluentCassandraOperations`, `ReactiveFluentCassandraOperations`, `Criteria`, and `Query`.
* <<kotlin.coroutines>> extensions for `ReactiveFluentCassandraOperations`.
include::../{spring-data-commons-docs}/kotlin-coroutines.adoc[leveloffset=+1]