Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R2DBC ORM Relationships Support #99

Closed
Kotlin-GDE opened this issue Apr 23, 2019 · 10 comments
Closed

R2DBC ORM Relationships Support #99

Kotlin-GDE opened this issue Apr 23, 2019 · 10 comments
Labels
type: enhancement A general enhancement

Comments

@Kotlin-GDE
Copy link

hi

there any support for orm relationships in r2dbc ??

@mp911de mp911de added the type: enhancement A general enhancement label Apr 23, 2019
@mp911de
Copy link
Member

mp911de commented Apr 23, 2019

There is no relationship support so far. We might want to consider a certain degree of relationships (e.g. aggregate-scoped relations that are fetchable with a single query).

@Kotlin-GDE
Copy link
Author

thanks

@gabkov
Copy link

gabkov commented Feb 14, 2020

Hi,

Can I ask for an update on this please? Thanks!

@CrBatista
Copy link

Hello,

I completely know all the R2DBC suite libraries requires a lot of new functionality, but IMHO, this issue is the only one left for many projects in order to be production-ready with an stable full reactive flow. Has this development been considered?

Thanks a lot.

@mp911de
Copy link
Member

mp911de commented Apr 8, 2020

Likely the definition of being production-ready varies.

Right now we're blocked by relation fetching. When constructing an entity using its constructor, we require the reference to be materialized beforehand. Since constructing entities and reading those is an imperative bit, we cannot reach out to the database otherwise we would introduce blocking behavior. Another aspect is that while consuming the result stream of data, we cannot issue queries until the entire result is fully consumed, otherwise we would wait for queries that never complete. To fix the issue, we need to collect all entities into a List and post-process these later on. This arrangement clearly removes the streaming functionality which is a strong value proposition of a reactive data access layer.

Until we (or someone else) can solve both issues, we cannot provide read-relation mapping.

@hantsy
Copy link

hantsy commented May 13, 2020

I have encountered the same problem when I was using Spring Data R2dbc, I hope to provide a solution like what is done in Spring Data Jdbc, https://spring.io/blog/2018/09/24/spring-data-jdbc-references-and-aggregates.

This issue should not be closed when it is not resolved.

@dJani97
Copy link

dJani97 commented Sep 5, 2020

Up!
Relational mapping would be really nice to have.

For people who are here for a workaround: DZone has a tutorial on mapping using a functional interface

@doctore
Copy link

doctore commented Nov 8, 2020

Not sure why this task is closed.

dJani97, thanks but the provided workaround only works in a X-ToOne relation.

I miss a way to manage X-ToMany ones. With Jdbc you can use ResultSetExtractor to deal with all information returned by the query, is there a way to do the same with R2dbc? As far as I know, Mappers or Converters can only be used to work with one row every time.

@tiagobmarques
Copy link

tiagobmarques commented Nov 30, 2020

For me yet have a problem with this. Don't have a mapper in entity class turn the code very confuses.
image
I would like have something similar below.

@derTobsch
Copy link

more informaton in #356

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

9 participants