Skip to content

QuerydslPredicateBuilder and QuerydslBindings do not consider owning type #2418

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
huisezhiwei opened this issue Jul 20, 2021 · 1 comment
Closed
Assignees
Labels
type: bug A general bug

Comments

@huisezhiwei
Copy link

huisezhiwei commented Jul 20, 2021

Spring data commons version : 1.13.23

I am currently maintaining an old project using Spring Boot 1.5.x .when I use @QueryDSLPredicate to bind query parameters, there is a problem with multiple different objects interfering with each other.
during debug, i found QuerydslPredicateBuilder.getPath() method interal using cache.
PropertyPathInformation will compare thier path property , and PropertyPath.equals() method not check owningType.
so when i query by id params will hit wrong cache (their name and type is same).
I find same question in spring data jpa default controller(RepositoryEntityController)

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 20, 2021
@mp911de mp911de changed the title PathInformation cache error QuerydslBindings.getBindingForPath(…) does not consider owning type Jul 26, 2021
@mp911de mp911de changed the title QuerydslBindings.getBindingForPath(…) does not consider owning type QuerydslPredicateBuilder and QuerydslBindings do not consider owning type Jul 26, 2021
@mp911de
Copy link
Member

mp911de commented Jul 26, 2021

Note that the 1.13.x development line is end of life since August 2019. However, the issue persists also in the current version.

The issue is related to both, QuerydslBindings and QuerydslPredicateBuilder.

@mp911de mp911de added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 26, 2021
@mp911de mp911de self-assigned this Jul 29, 2021
mp911de added a commit that referenced this issue Jul 29, 2021
We now consider a qualified property path when registering and querying QuerydslBindings to ensure that paths matching various domain types do not accidentally get applied for a different type than they were registered for.
Previously, a binding for Address.description would be also applied to User.description as only the property path description was considered when looking up bindings.

Closes #2418
mp911de added a commit that referenced this issue Jul 29, 2021
We now consider a qualified property path when registering and querying `QuerydslBindings` to ensure that paths matching various domain types do not accidentally get applied for a different type than they were registered for.
Previously, a binding for `Address.description` would be also applied to `User.description` as only the property path `description` was considered when looking up bindings.

Closes #2418
christophstrobl pushed a commit that referenced this issue Sep 14, 2021
We now consider a qualified property path when registering and querying `QuerydslBindings` to ensure that paths matching various domain types do not accidentally get applied for a different type than they were registered for.
Previously, a binding for `Address.description` would be also applied to `User.description` as only the property path `description` was considered when looking up bindings.

Closes: #2418
Original Pull Request: #2422
@christophstrobl christophstrobl added this to the 2.5.5 (2021.0.5) milestone Sep 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants