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

Add support for exists projection in repository query derivation [DATACMNS-875] #1240

Closed
spring-projects-issues opened this issue Jun 26, 2016 · 3 comments
Assignees
Labels
in: repository type: enhancement

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Jun 26, 2016

Ruben Pahino opened DATACMNS-875 and commented

While parsing a method name with PartTree it doesn't have in count the possible Subject "exists". The solutions seems to be as simple as applying the same changes as with the "count/delete" additions


Issue Links:

  • DATAJPA-920 Add support for exists projection in repository query derivation
    ("is depended on by")
  • DATAMONGO-1454 Add support for exists projection in repository query derivation
    ("is depended on by")

Referenced from: pull request #171

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jun 26, 2016

Oliver Drotbohm commented

Parsing is only the start of the story as individual stores have to actually turn the expression into an actual query. Note, that as a workaround you could go ahead and manually declare a JPQL query select case when (count(*) >0) then true else false end from …

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jun 28, 2016

Mark Paluch commented

Spiked at the implementation for commons and pushed the code to https://github.com/spring-projects/spring-data-commons/tree/issue/DATACMNS-875.

The implementation in JPA requires a bit more thought, whether to solve exists projections via count or tuple-queries with LIMIT 1 and how that could into Spring Data JPA

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Jun 28, 2016

Ruben Pahino commented

In my case I use it for my own implementation using the same approach as JPA but for jdbc, using JdbcTemplate. In this case I also have in count how to implement the exists clause, but had to implement a temporal fix by using the method return type and not the PartTree. Now I can move on with the good implementation.

Thank you

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

No branches or pull requests

2 participants