diff --git a/src/main/asciidoc/index.adoc b/src/main/asciidoc/index.adoc index 47d106ae6..8ee6d919c 100644 --- a/src/main/asciidoc/index.adoc +++ b/src/main/asciidoc/index.adoc @@ -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 diff --git a/src/main/asciidoc/new-features.adoc b/src/main/asciidoc/new-features.adoc index 200d64a75..62dcd6581 100644 --- a/src/main/asciidoc/new-features.adoc +++ b/src/main/asciidoc/new-features.adoc @@ -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 `, `DELETE … IF `). * 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 <>. +* <> 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 diff --git a/src/main/asciidoc/reference/kotlin.adoc b/src/main/asciidoc/reference/kotlin.adoc new file mode 100644 index 000000000..e4e0f86e0 --- /dev/null +++ b/src/main/asciidoc/reference/kotlin.adoc @@ -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 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().inTable("star-wars").all() +// or (both are equivalent) +val characters : Flux = 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`. +* <> extensions for `ReactiveFluentCassandraOperations`. + +include::../{spring-data-commons-docs}/kotlin-coroutines.adoc[leveloffset=+1]