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
DATAJPA-433 - added workaround to allow parameterized IN with eclipselink #185
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…lection for eclipselink which seems to have worked accidentally before
schauder
pushed a commit
that referenced
this pull request
Jul 4, 2019
…Link. We now convert parameter to collections and use `ParameterExpression<Collection<?>>` to declare the parameter. This utilises the fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=349477. It does break empty collections in EclipseLink which so far worked in 2.6 but didn't work 2.7 but support for only empty collection isn't of much use. Original pull request: #185.
schauder
added a commit
that referenced
this pull request
Jul 4, 2019
Extracted conversion of iterable into a method and added a shortcut for the likely case that we already have a collection. Original pull request: #185.
schauder
pushed a commit
that referenced
this pull request
Jul 4, 2019
…Link. We now convert parameter to collections and use `ParameterExpression<Collection<?>>` to declare the parameter. This utilises the fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=349477. It does break empty collections in EclipseLink which so far worked in 2.6 but didn't work 2.7 but support for only empty collection isn't of much use. Original pull request: #185.
schauder
added a commit
that referenced
this pull request
Jul 4, 2019
Extracted conversion of iterable into a method and added a shortcut for the likely case that we already have a collection. Original pull request: #185.
That is merged and polished. Thank you. |
@Mobe91 I tried and failed to create a simple reproducer in order to create a new issue with EclipseLink so they can fix the problems on their side. I wonder if you could provide a reproducer, possible as a PR to this repo: https://github.com/schauder/issue-eclipselink-in-collection |
stsypanov
pushed a commit
to stsypanov/spring-data-jpa
that referenced
this pull request
Dec 13, 2019
…Link. We now convert parameter to collections and use `ParameterExpression<Collection<?>>` to declare the parameter. This utilises the fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=349477. It does break empty collections in EclipseLink which so far worked in 2.6 but didn't work 2.7 but support for only empty collection isn't of much use. Original pull request: spring-projects#185.
stsypanov
pushed a commit
to stsypanov/spring-data-jpa
that referenced
this pull request
Dec 13, 2019
Extracted conversion of iterable into a method and added a shortcut for the likely case that we already have a collection. Original pull request: spring-projects#185.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This workaround changes calls to
to calls to
by adding the required casts.
Eclipselink is missing some logic in
javax.persistence.criteria.Expression#in(javax.persistence.criteria.Expression<?>...)
to handle single collection valued parameters.Note: This pull request breaks IN with empty collection parameter values for eclipselink which seems to have been working accidentally before. While eclipselink users have not been able to use parameterized IN at all before this fix, they can now use parameterized IN at least with non-empty collection parameter values.
To make parameterized IN work with empty collections, a fix in eclipselink's sql generation is required. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=349477.