DATACASS-688 - Add documentation for Kotlin support.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
28
src/main/asciidoc/reference/kotlin.adoc
Normal file
28
src/main/asciidoc/reference/kotlin.adoc
Normal 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]
|
||||
Reference in New Issue
Block a user