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
1
vote
1 answer

How to setup SpEL contextProvider for @Query

How can I setup the context provider to make my SpEL extension available in a @Query("...")? We use r2dbc with postgres. From what I understand I would need to register my extension with a ReactiveExtensionAwareQueryMethodEvaluationContextProvider…
Stuck
  • 11,225
  • 11
  • 59
  • 104
1
vote
1 answer

My simple project BiFunction problem Java

Hi everyone How can I use more than 3 arguments in a Bifunction? So I will use both a label and a project public Flux findAll() { Flux taskFlux = tasksRepository.findAll(); Flux dueFlux =…
user15460636
1
vote
1 answer

Java multiple data Jdbc and R2dbc problem

I wrote a project and I used r2dbc and jdbc there. Now there is a problem with the database. How can I separate them? The information comes but gives an error Operator called default onErrorDropped Application.yml spring: liquibase: …
1
vote
1 answer

How to mock method in Mono.flatMap()?

I write unit tests for some service and I don't understand , why some method that i mock don't call. I try to test testDeleteDeviceWhenDeviceNotFound() method and it's pass, but when I try testDeleteDeviceSuccess() I have…
1
vote
2 answers

Spring data reactive repository - r2dbc not working

The query is getting executed but not getting any result. router :- api/v1/service/appt/usr/{usr_id} private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); public Mono
user1578872
  • 7,808
  • 29
  • 108
  • 206
1
vote
1 answer

Extending ReactiveQueryByExampleExecutor throws PropertyReferenceException

I'm having an issue with trying to implement ReactiveQueryByExampleExecutor into my repository in my application Stack trace: Caused by: java.lang.IllegalArgumentException: Failed to create query for method public abstract…
1
vote
0 answers

spring data R2DBC change @Table dynamiclly or another strategy

I have a problem about spring data R2DBC with sql server, I've used @Table annotation and a value of this is e.g. @Table("myschema.mytable") and this works well. The problem is, when we move to another environment like prod, the database has another…
chavalife17
  • 162
  • 1
  • 2
  • 10
1
vote
2 answers

postgres r2dbc gives ssl error but connects using jpa

r2dbc config: spring: profiles: default r2dbc: url: r2dbc:postgresql://testserver.dev.net:1234/test?ssl=true&sslmode=require username: test password: test connection_timeout: 20000 jpa config: spring: profiles: default datasource: …
1
vote
2 answers

Using reactive(r2dbc) batch with transaction

I am trying to use create a batch using reactive r2dbc and use transactional to annotate the method. But it looks like that if I use both @Transactional and batch code the code just hangs and doesn't work. Below is the…
Monish Das
  • 383
  • 2
  • 12
  • 28
1
vote
1 answer

Losing event when reactor is switching scheduler

Context: Loading and streaming Excel file as Flux. Processing Flux records and inserting them into database using R2DBC. implementation("org.apache.poi:poi:4.1.2") - apache lib which has excel domain of…
Aubergine
  • 5,862
  • 19
  • 66
  • 110
1
vote
0 answers

Reactive and Non Reactive repository in a Spring Boot application with H2 database

In addition to a non-reactive JPA repository, I introduced a reactive repository in my Spring Boot app with H2 database. com.app.respository.BusinessRepository extends JpaRepository com.app.respository.r2dbc.PendingBusinessRepository extends…
user2918640
  • 473
  • 1
  • 7
  • 25
1
vote
2 answers

How to prevent Null pointer exception when query result is null in case of Spring Data CRUD repository using Spring WebFlux

I am using Spring WebFlux to build a sample WebApplication. I am interacting with the postgres database using spring data's non blocking reactive library r2dbc. I am able to fetch the data and return to the user when the query is returning some…
user3553913
  • 373
  • 3
  • 17
1
vote
1 answer

Multiple conditional inserts of a new entity gives duplicate entry error in R2DBC

Let's consider this function @Transactional fun conditionalInsertEntity(dbEntity: DBEntity): Mono { return fetchObjectByPublicId(dbEntity.publicId) .switchIfEmpty { r2DatabaseClient.insert() …
1
vote
1 answer

How to return generated ID with Fluent Data Access API in Spring Data R2DBC

My database automatically generate IDs when new records are inserted, and I want to use the generated ID in my code once the insertion completed. When using Statement, it can be achieved by the following approach. db.execute("INSERT INTO table…
choasia
  • 10,404
  • 6
  • 40
  • 61
1
vote
1 answer

Compare two arrays using QueryDSL

Need assistance with QueryDSL predicate composition - how to write QueryDSL predicate to compare two arrays(find any UUID matches between two arrays) using && operator like this: select '{e48f54d5-9845-4987-a53d-e0ecfe3dbb43}'::uuid[] &&…
Viktor M.
  • 4,393
  • 9
  • 40
  • 71