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

spring jpa nested projection generating incorrect query [DATAJPA-1218] #1555

Closed
spring-projects-issues opened this issue Nov 7, 2017 · 4 comments
Assignees
Labels
in: core Issues in core support type: enhancement A general enhancement

Comments

@spring-projects-issues
Copy link

spring-projects-issues commented Nov 7, 2017

Zain Mansoor opened DATAJPA-1218 and commented

Just check this stackoverflow.com question


Affects: 1.11.8 (Ingalls SR8)

Reference URL: https://stackoverflow.com/questions/47159647/spring-jpa-nested-projection-generating-incorrect-query

@spring-projects-issues
Copy link
Author

spring-projects-issues commented Jan 19, 2018

Jens Schauder commented

If understand correctly the concern is that more attributes/columns get selected than necessary to fill the projections for projection interfaces referenced by the root projection.

I don't think we should consider this a bug as long as the result is correct.

Currently, we don't optimize the query for referenced entities by only selecting the required properties, but we'll consider this an improvement request

@spring-projects-issues
Copy link
Author

spring-projects-issues commented Feb 2, 2018

Jens Schauder commented

I take the fact that my answer was accepted on SO as an indication that my assumption was correct

@spring-projects-issues
Copy link
Author

spring-projects-issues commented Sep 15, 2018

Bukaj Sytlos commented

Jens Schauder: Hello. Why is this issue closed as "feature" instead of fixing this issue?

@spring-projects-issues
Copy link
Author

spring-projects-issues commented Sep 15, 2018

Jens Schauder commented

  1. It is a feature request because Spring Data JPA doesn't do anything wrong. The result is correct. It's just that one might wish for a more optimal way to select.
  2. I'm actually not 100% sure why I closed it instead of leaving it open. I didn't do a good job in explaining that, did I?

Anyway, the chances of us being able to implement that are rather low since it is basically impossible to convince JPA to exactly select the columns you want without doing the creation of entities yourself.

These kinds of things get rather complex really fast and there are many issues which offer more value for the money.

If you are interested in this feel free to open a new issue (since reopening closed issues create weird artifacts). But it is not likely that anything will happen on that soon. Sorry

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

No branches or pull requests

2 participants