Questions tagged [spring-data-r2dbc]

Spring Data R2DBC is a module of Spring Data based on R2DBC R2DBC stands for Reactive Relational Database Connectivity.

See https://spring.io/projects/spring-data-r2dbc for more information.

412 questions
3
votes
0 answers

Spring Data R2DBC Persist Nested Attributes

I've got a List (or Flux if I wanted) where each Order element has a List. I want to persist this object hierarchy into two tables of a relational database using spring-data-r2dbc (and therefore ReactiveCrudRepository) and…
Markus Ratzer
  • 1,292
  • 3
  • 19
  • 29
3
votes
0 answers

Spring data r2dbc mysql can not fetch the inserted id

I am trying to migrate my sample to the lates Spring Data R2dbc 1.0.0.RELEASE. org.springframework.boot.experimental spring-boot-starter-data-r2dbc
Hantsy
  • 8,006
  • 7
  • 64
  • 109
3
votes
0 answers

Spring boot data R2DBC requires transaction for read operations

Im trying to fetch a list of objects from the database using Spring boot Webflux with the postgres R2DBC driver, but I get an error saying: value ignored…
3
votes
1 answer

@enabler2dbcrepositories is unable to find my repository

I m migrating my database management from blocking to non-blocking(asynchronious) api spring data r2dbc.but there are some problems i need to fix? HERES WHAT I VE TRIED: 1.changing dependencies OF R2DBC AND other reactor stuffs. 2.changed springboot…
3
votes
1 answer

Pageable usage with Query Annotation

Can I use Pageable attribute in Spring Data R2dbc repositories with @Query annotation? For example; public interface PartyRepository extends ReactiveCrudRepository { @Query("select * from party order by id") Flux
gbalcisoy
  • 117
  • 3
  • 17
3
votes
1 answer

What is the motivation for using R2DBC?

I am very new to reactive spring stack and currently exploring R2DBC. Could you explain me what are the benefits of using R2dbcRepository over wrapping blocking JpaRepository into Mono/Flux? Let me bring some example of that: val producer:…
Oiew
  • 1,509
  • 1
  • 11
  • 14
3
votes
1 answer

Compatibility version spring cloud, r2dbc

I try to use spring with r2dbc here my build.gradle plugins { id 'org.springframework.boot' version '2.2.0.M4' id 'java' } apply plugin: 'io.spring.dependency-management' group = 'com.example' version = '0.0.1-SNAPSHOT' sourceCompatibility…
robert trudel
  • 5,283
  • 17
  • 72
  • 124
3
votes
2 answers

Overriding array(list) type conversions in Spring Data R2DBC

I'm using Postgres as my datasource and I've created a custom Spring converter for a property that holds a list of my custom objects: @Slf4j @WritingConverter @AllArgsConstructor public class CustomObjectListToStringConverter implements…
NikolaB
  • 4,706
  • 3
  • 30
  • 38
3
votes
4 answers

Spring Data ReactiveCrudRepository save operation not persisting data in Postgres Database

For the below code, Get and update operation in the repository work fine. But save operation is not persisting the data into the tables. It works fine if I implement the Repository myself. After the replaced it with the interface extending…
thaneesh shanand
  • 453
  • 1
  • 5
  • 14
3
votes
1 answer

Mapping complex field of an object to a text field (serialized as JSON) before saving with reactive spring repository

I'm using Spring data r2dbc repositories to save pojo's to Postgres DB. I have a class with complex field definition: // Getters and setters omitted for brevity public class TestType { @Id private Long id; private TestDefinition…
NikolaB
  • 4,706
  • 3
  • 30
  • 38
2
votes
0 answers

Support for exception handling in R2dbcRepository, or how to decorate each method call in R2dbcRepository with my own error handler

Background: I have an application-wide universal exception handler to translate exceptions coming from R2dbcRepository, such as (an excerpt just to show the intended purpose): @Component public class ErrorHandler { public Throwable…
Honza Zidek
  • 9,204
  • 4
  • 72
  • 118
2
votes
0 answers

Exceptions lose context when crossing multiple Reactive/coroutine boundaries

Spring Boot 3, WebFlux, Kotlin 1.8, coroutines 1.7. I've got a simple @RestController with a function like: @PutMapping("/{id}", consumes = [APPLICATION_JSON_VALUE]) suspend fun update(/* ... */): ResponseEntity = service.update(/* ...…
2
votes
0 answers

How to bootstrap spring-data-r2dbc with Jooq : bean of type 'org.jooq.Configuration' could not be found?

I'm trying to bootstrap a test drive with Spring boot, R2DBC and Jooq. Jooq generates my classes properly but my app fails to start with : Parameter 0 of constructor in ...generated.jooq.tables.daos.CountryDao required a bean of type…
Kassec
  • 31
  • 4
2
votes
2 answers

Complex Id for many-to-many relation in Spring R2DBC

I have entity which handles many-to-mane relation between student and tutor tables where primary key is complex key(relation_id and tutor_id). @Getter @Setter @NoArgsConstructor @Table("tutor_student") public class TutorStudentEntity implements…
Andrii Torzhkov
  • 271
  • 1
  • 5
  • 15
2
votes
0 answers

R2DBC DatabaseClient parameter binding

I am unable to bind parameters to my query. The function looks like this: override fun findVenueById(id: Long): Mono { val extended = query + "WHERE v.id = :id " return client .sql(extended) .bind("id", id) …