Files
spring-data-examples/r2dbc/example
Oliver Drotbohm 4576dc413f #500 - Example for declarative reactive transactions in R2DBC.
Introduced transactional service using @Transactional on the method declaration. Using the experimental Spring Boot integration to get both an H2ConnectionFactory and R2dbcTransactionManager configured. Added test case to show the rollbacks kicking in on an exception in a map operator.
2019-05-09 19:09:34 +02:00
..
2019-03-20 10:10:59 -05:00

== Spring Data R2DBC basics

This projects shows some sample usage of the work-in-progress R2DBC support for Spring Data.

=== Interesting bits to look at

- `InfrastructureConfiguration` - sets up a R2DBC `ConnectionFactory` based on the R2DBC Postgres driver (https://github.com/r2dbc/r2dbc-postgresql[r2dbc-postgresql]), a `DatabaseClient` and a `R2dbcRepositoryFactory` to eventually create a `CustomerRepository`.
- `CustomerRepository` - a standard Spring Data reactive CRUD repository exposing query methods using manually defined queries
- `CustomerRepositoryIntegrationTests` - to initialize the database with some setup SQL and the inserting and reading `Customer` instances.
- `TransactionalService` - uses declarative transaction to apply a transactional boundary to repository operations.