Skip to content
Advertisement

Tag: spring-data-r2dbc

Auditing (@CreatedDate) does not work for WebFlux Spring Boot with reactive MongoDB

Does WebFlux Spring Boot with reactive MongoDB supports Auditing? I tried to use @CreatedDate and it did not work for me. Here is my configuration: Here is my document class Here is Message repository When I save message messageRepository.save(message) I always have createdDate=null Do I miss something or Auditing does not work with reactive MongoDB? Answer I resolved the issue

ReactiveCrudRepository vs. R2dbcRepository

I am learning the reactive stack starting with R2DBC and this is what I don’t understand: What are the differences between these, when to use them, and how relevant the @Repository stereotype annotation is to them? org.springframework.data.r2dbc.repository.R2dbcRepository org.springframework.data.repository.reactive.ReactiveCrudRepository; As far as I understand, both of them are @NoRepositoryBean and both are shipped together through the org.springframework.boot:spring-boot-starter-data-r2dbc dependency. Answer There is

How to implement ManyToMany in r2dbc

R2DBC does not support composite keys currently. I wonder how we may implement a many-to-many relationship for now? For example, given the two entities: and their schemas: I can create a table for the many-to-many mapping: But how should we define the mapping class ItemTag in kotlin/java? Or is it fine to omit the @Id? Then there cannot be any

Obtaining a nested objects using Spring Data R2DBC

I’m new to Project Reactor and R2DBC. How to receive and merge Flux<Child> with Mono<Parent> properly using Spring Data R2DBC reactive repositories? Parent: ParentRepository: Child: ChildRepository: ParentPersistenceAdapter: My solution is: Answer Assuming the existence of a withChildren(Flux<Child> children) type method, you can just do: However, this is a bit odd – you wouldn’t usually have a Flux on a DAO

Advertisement