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

Projections referring to collection attributes don't create a proper selection (missing joins) [DATAJPA-974] #1323

Closed
spring-projects-issues opened this issue Sep 28, 2016 · 3 comments
Assignees
Labels
type: bug

Comments

@spring-projects-issues
Copy link

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

Pramoth Suwanpech opened DATAJPA-974 and commented

I have model entity as below
Document <--1-------M---> Document
and repository method is "public List<DocumentWithoutParent> findByParentIsNull()"
where 'DocumentWithoutParent' is projection
sql that hibernate generate is incorrect. but when I change List<DocumentWithoutParent> to List<Document> it is OK.
So I think problem come from spring data jpa.

Below is a test project on this problem.
https://github.com/pramoth/hibernate-generate-wrong-sql-with-projection


Affects: 1.10.3 (Hopper SR3)

Issue Links:

  • DATACMNS-921 ResultProcessor should create approximate collection instead of exact one

Referenced from: commits 19eca5f, 44d9bf8

Backported to: 1.10.4 (Hopper SR4)

@spring-projects-issues
Copy link
Author

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

Oliver Drotbohm commented

Looks like we need to use a dedicated join for plural attributes. Fix coming in a bit

@spring-projects-issues
Copy link
Author

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

Oliver Drotbohm commented

Fix available in master and the bugfix branch for Hopper. Feel free to give the snapshots a try. We plan to publish a service release tomorrow

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Sep 29, 2016

Pramoth Suwanpech commented

Awesome. Test pass.
Thank you

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

No branches or pull requests

2 participants