R2DBC
The Spring Data R2DBC module applies core Spring concepts to the development of solutions that use R2DBC database drivers aligned with Domain-driven design principles. We provide a “template” as a high-level abstraction for storing and querying aggregates.
This document is the reference guide for Spring Data R2DBC support. It explains the concepts and semantics and syntax.
This chapter points out the specialties for repository support for JDBC. This builds on the core repository support explained in Working with Spring Data Repositories. You should have a sound understanding of the basic concepts explained there.
R2DBC contains a wide range of features:
-
Spring configuration support with Java-based
@Configuration
classes for an R2DBC driver instance. -
R2dbcEntityTemplate
as central class for entity-bound operations that increases productivity when performing common R2DBC operations with integrated object mapping between rows and POJOs. -
Feature-rich object mapping integrated with Spring’s Conversion Service.
-
Annotation-based mapping metadata that is extensible to support other metadata formats.
-
Automatic implementation of Repository interfaces, including support for custom query methods.
For most tasks, you should use R2dbcEntityTemplate
or the repository support, which both use the rich mapping functionality.
R2dbcEntityTemplate
is the place to look for accessing functionality such as ad-hoc CRUD operations.