Skip to content

DATAMONGO-2545 - Fix regression in String query SpEL parameter binding. #864

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
wants to merge 3 commits into from

Conversation

christophstrobl
Copy link
Member

The PR includes a fix for parameter binding within a SpEL expression using query parameter placeholders ?0, ?1,... instead of the array index [0],[1],...

@Query("{ 'hidden' : ?#{ hasRole('batman') ? '?0' : '?1' } }"
List<User> findAllUsingSpelBy(String arg0, String arg1);

It also fixes the case where the SpEL expression actually results in the query document to use.

@Query("?#{ hasRole('admin') ? { 'region': 'all' } : { 'user.superviser':  principal.id } }")
List<User> findAllUsingSpelBy();

We reenabled parameter binding within SpEL using query parameter placeholders ?0, ?1,... instead of their array index [0],[1],...
We reenabled annotated queries using a SpEL expression resulting in the actual query document.
mp911de pushed a commit that referenced this pull request May 26, 2020
We reenabled parameter binding within SpEL using query parameter placeholders ?0, ?1,... instead of their array index [0],[1],...

Original pull request: #864.
mp911de pushed a commit that referenced this pull request May 26, 2020
We reenabled annotated queries using a SpEL expression resulting in the actual query document.

Original pull request: #864.
mp911de added a commit that referenced this pull request May 26, 2020
Fix warnings and typos.

Original pull request: #864.
mp911de pushed a commit that referenced this pull request May 26, 2020
We reenabled parameter binding within SpEL using query parameter placeholders ?0, ?1,... instead of their array index [0],[1],...

Original pull request: #864.
mp911de pushed a commit that referenced this pull request May 26, 2020
We reenabled annotated queries using a SpEL expression resulting in the actual query document.

Original pull request: #864.
mp911de added a commit that referenced this pull request May 26, 2020
Fix warnings and typos.

Original pull request: #864.
mp911de pushed a commit that referenced this pull request May 26, 2020
We reenabled parameter binding within SpEL using query parameter placeholders ?0, ?1,... instead of their array index [0],[1],...

Original pull request: #864.
mp911de pushed a commit that referenced this pull request May 26, 2020
We reenabled annotated queries using a SpEL expression resulting in the actual query document.

Original pull request: #864.
mp911de added a commit that referenced this pull request May 26, 2020
Fix warnings and typos.

Original pull request: #864.
@mp911de
Copy link
Member

mp911de commented May 26, 2020

That's merged, polished, and backported now.

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

Successfully merging this pull request may close these issues.

2 participants