Skip to content

SpEL parsing does not consider multiple usages and nested object references #373

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
dkulig opened this issue May 23, 2020 · 2 comments
Closed
Assignees
Labels
type: bug A general bug

Comments

@dkulig
Copy link

dkulig commented May 23, 2020

A @Query with multiple parameters evaluated by SPeL doesn't work

@Modifying
@Query("INSERT IGNORE INTO table (x, y) VALUES (:#{#dto.x}, :#{#dto.y})")
fun saveIgnoringDuplicate(@Param("dto") dto: Dto): Mono<Void>

Exception:

org.springframework.expression.spel.SpelParseException: EL1041E: After parsing a valid expression, there is still more data in the expression: 'rcurly(})'
	at org.springframework.expression.spel.standard.InternalSpelExpressionParser.doParseExpression(InternalSpelExpressionParser.java:135)

After some debugging, looks like parses evaluates only one expression:

binding = {ExpressionQuery$ParameterBinding@11505} 
 parameterName = "__synthetic_0__"
 expression = "#dto.x}, :#{#dto.y"
@mp911de mp911de added the type: bug A general bug label May 26, 2020
@mp911de
Copy link
Member

mp911de commented May 26, 2020

Good catch, we need to fix this bug.

@mp911de mp911de added this to the 1.1.1 (Neumann SR1) milestone May 26, 2020
mp911de added a commit that referenced this issue May 27, 2020
mp911de added a commit that referenced this issue May 27, 2020
We now use SpelQueryContext and SpelExtractor for analysis and rewrite of queries using SpEL.
@mp911de mp911de linked a pull request May 27, 2020 that will close this issue
@mp911de mp911de changed the title SPeL doesn't work as expected SpEL parsing does not consider multiple usages and nested object references May 27, 2020
mp911de added a commit that referenced this issue Jul 20, 2020
This commit deprecates API that has been moved to Spring R2DBC.
mp911de added a commit that referenced this issue Jul 21, 2020
We now use Spring R2DBC DatabaseClient and utilities to implement Spring Data R2DBC functionality.
schauder pushed a commit that referenced this issue Jul 22, 2020
We now use SpelQueryContext and SpelExtractor for analysis and rewrite of queries using SpEL.

Original pull request: #376.
schauder pushed a commit that referenced this issue Jul 22, 2020
schauder added a commit that referenced this issue Jul 22, 2020
Using soft assertions for more expressive test failures.

Original pull request: #376.
schauder pushed a commit that referenced this issue Jul 22, 2020
We now use SpelQueryContext and SpelExtractor for analysis and rewrite of queries using SpEL.

Original pull request: #376.
schauder pushed a commit that referenced this issue Jul 22, 2020
schauder added a commit that referenced this issue Jul 22, 2020
Using soft assertions for more expressive test failures.

Original pull request: #376.
@schauder
Copy link
Contributor

This is fixed.

mp911de added a commit that referenced this issue Jul 23, 2020
This commit deprecates API that has been moved to Spring R2DBC.
mp911de added a commit that referenced this issue Jul 23, 2020
We now use Spring R2DBC DatabaseClient and utilities to implement Spring Data R2DBC functionality.
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.

3 participants