You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
select
realizacao0_.id as col_0_0_
from
realizacao_avaliacao realizacao0_
where
((realizacao0_.avaliacao_id ,
realizacao0_.profissional_id) in (? , ? , (? , ?)))
and realizacao0_.reset =?
But the expected is
select
realizacao0_.id as col_0_0_
from
realizacao_avaliacao realizacao0_
where
realizacao0_.reset = false
and (realizacao0_.avaliacao_id , realizacao0_.profissional_id) in ((13 , 3), (13 , 2))
Environment
Docker And Manjaro
Querydsl version: 4.2.1
Database: Mysql
JDK: 1.8
The text was updated successfully, but these errors were encountered:
This is not really a bug, is just improper use of QueryDSL's internal list expressions for tuples. The template for list is simply {0}, {1} (so just comma separated arguments). I was more surprised about the rendered parentheses that do appear than the ones that do not. These are rendered because operation expressions are always wrapped in side parentheses when one of their arguments is an operation that has lower precedence.
So the parents between (realizacao0_.avaliacao_id , realizacao0_.profissional_id) are introduced because IN takes precedence over Querydsl's internal "list" operation. And the parents between the tuples are introduced because the inside and outside list expressions have the same precendence and this needs to be accounted for.
The solution is quite simply: don't use the list expression for this. This use a Template expression.
For example, the following test passes in SQLSerializerTest:
Observed vs. expected behavior
Do the right query
Steps to reproduce
The query output is:
But the expected is
Environment
Docker And Manjaro
Querydsl version: 4.2.1
Database: Mysql
JDK: 1.8
The text was updated successfully, but these errors were encountered: