For the latest stable version, please use Spring Data Relational 3.4.0!spring-doc.cn

Kotlin

This part of the reference documentation explains the specific Kotlin functionality offered by Spring Data R2DBC. See Kotlin Support for the general functionality provided by Spring Data.spring-doc.cn

To retrieve a list of SWCharacter objects in Java, you would normally write the following:spring-doc.cn

Flux<SWCharacter> characters = client.select().from(SWCharacter.class).fetch().all();

With Kotlin and the Spring Data extensions, you can instead write the following:spring-doc.cn

val characters =  client.select().from<SWCharacter>().fetch().all()
// or (both are equivalent)
val characters : Flux<SWCharacter> = client.select().from().fetch().all()

As in Java, characters in Kotlin is strongly typed, but Kotlin’s clever type inference allows for shorter syntax.spring-doc.cn

Spring Data R2DBC provides the following extensions:spring-doc.cn