Skip to content

Support of query derivation #282

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

Closed
rchigvintsev opened this issue Jan 22, 2020 · 12 comments
Closed

Support of query derivation #282

rchigvintsev opened this issue Jan 22, 2020 · 12 comments
Labels
type: enhancement A general enhancement

Comments

@rchigvintsev
Copy link
Contributor

I have a simple conceptual implementation of query derivation partly based on corresponding code in spring-data-jpa and Hibernate projects. For now it looks a bit messy and needs to be put in order. I could clean the code, write several test and then create a pull request so you could review a solution.

Is it worth doing or you guys are already in the middle of developing such feature?

@mp911de mp911de added the type: enhancement A general enhancement label Jan 22, 2020
@mp911de
Copy link
Member

mp911de commented Jan 22, 2020

Thanks for reaching out. We want to add query derivation to Spring Data R2DBC. We're currently in the planning so we can add query derivation to both projects, Spring Data JDBC and R2DBC to keep both projects in sync, time- and feature-wise. Check out the corresponding ticket DATAJDBC-318.

@rchigvintsev
Copy link
Contributor Author

I've made a quick look at James Clark's solution (from discussion in ticket it seems like a major solution) and compared it with mine. My approach is similar: PartTree-based implementation of AbstractR2dbcQuery and query generation using classes from spring-data-relational.

For now I don't understand how spring-data-jdbc and spring-data-r2dbc are going to be in sync. Classes like AbstractJdbcRepositoryQuery or JdbcQueryCreator should obviously be project-specific. Is synchronization only related to features that will be added to spring-data-relational and spring-data-commons projects?

@mp911de
Copy link
Member

mp911de commented Jan 22, 2020

The synchronization is mostly to keep both SQL-based projects on the same level of functionality (i.e. timing-wise and what the query derivation is capable of). Paging @schauder as Jens is involved already in Spring Data JDBC.

I'm not sure, probably the only thing that is holding us from building query derivation in Spring Data JDBC is the required dialect support.

@rchigvintsev
Copy link
Contributor Author

OK. Thanks for clarification! But I still don't see an answer to the question that I asked above: is it worth for me to keep going and provide a PR or you are going to wait for finishing of DATAJDBC-318 and then adopt it to this project?

@mp911de
Copy link
Member

mp911de commented Jan 22, 2020

Probably it makes the most sense that a single contributor takes care of both changes. Alternatively, we can move forward with R2DBC and adapt that functionality in JDBC as it seems that we can make more progress with Spring Data R2DBC right now.

@schauder
Copy link
Contributor

The situation of DATAJDBC-318 is a little unfortunate, since there exist two solutions but no proper PR and I did not get a reply on my request to receive such a PR. If you @rchigvintsev would provide a PR for DATAJDBC-318 I (and maybe @mp911de ) would review it in a timely fashion. And once that is done we could move forward and port it to Spring Data R2DBC.

How does that sound for a plan?

@mp911de
Copy link
Member

mp911de commented Jan 22, 2020

I think porting works either way. Either from JDBC to R2DBC or vice versa. In any case, I like the idea and I'm happy that we can progress here.

@rchigvintsev
Copy link
Contributor Author

@schauder For me it is easer to stick to R2DBC (since I've already done some work on this feature) and provide a PR here possibly looking at the solutions from DATAJDBC-318 to make future porting simpler.

On the other side single contributor is definitely a good option and it seems like work on DATAJDBC-318 is almost done.

@schauder
Copy link
Contributor

@rchigvintsev then please go ahead and create a proper PR for R2DBC. DATAJDBC is in an unhealthy state right now as I tried to explain above.

@rchigvintsev
Copy link
Contributor Author

@schauder OK, I will try to prepare basic solution as soon as possible.

@rchigvintsev
Copy link
Contributor Author

PR: #295

rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 14, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 14, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 14, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 14, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 14, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 14, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 14, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 14, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 14, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 14, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 14, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 14, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 14, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 14, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 14, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 14, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 14, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 14, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 14, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 14, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 14, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 14, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 14, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 14, 2020
…ry explicitly associated with repository method
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 14, 2020
…ntation of 'io.r2dbc.spi.Statement' may not support binding
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 14, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 14, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 14, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 16, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 16, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 16, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 16, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 17, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 19, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 19, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 23, 2020
rchigvintsev added a commit to rchigvintsev/spring-data-r2dbc that referenced this issue Mar 23, 2020
@mp911de mp911de added this to the 1.1 RC1 (Neumann) milestone Mar 27, 2020
mp911de pushed a commit that referenced this issue Mar 27, 2020
We now support query derivation for R2DBC repositories:

interface ReactivePersonRepository extends ReactiveSortingRepository<Person, String> {

  Flux<Person> findByFirstname(String firstname);

  Flux<Person> findByFirstname(Publisher<String> firstname);

  Mono<Person> findByFirstnameAndLastname(String firstname, String lastname);

  Flux<Person> findFirstByLastnameLike(String pattern);
}

Original pull request: #295.
mp911de added a commit that referenced this issue Mar 27, 2020
Move query derivation infrastructure to Spring Data Relational. Adapt to newly introduced ValueFunction for deferred value mapping. Use query derivation in integration tests.

Tweak javadoc, add since and author tags, reformat code.

Related ticket: https://jira.spring.io/browse/DATAJDBC-514
Original pull request: #295.
mp911de added a commit that referenced this issue Mar 27, 2020
Original pull request: #295.
@mp911de
Copy link
Member

mp911de commented Mar 27, 2020

The PR is merged now.

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

3 participants