Error when using parameter as both a select function argument and in where clause
Description
Using a parameter in select inside a function and in where clause results in an exception: JDBC parameter value not bound
A similar issue was already reported and fixed. But it is still happening if the parameter is itself a parameter of a function. Minimal Spring Boot project reproducing the problem: , same example with hibernate 5.6.15 where it was working:
A small example query which causes the exception:
select DATEDIFF(e.date, :date) from SomeEntity e where :date < e.date
Those queries work fine:
select DATEDIFF(e.date, :date) from SomeEntity e
select :date from SomeEntity e where :date < e.date
Using a parameter in
select
inside a function and inwhere
clause results in an exception: JDBC parameter value not boundA similar issue was already reported and fixed. But it is still happening if the parameter is itself a parameter of a function. Minimal Spring Boot project reproducing the problem: , same example with hibernate 5.6.15 where it was working:
A small example query which causes the exception:
select DATEDIFF(e.date, :date) from SomeEntity e where :date < e.date
Those queries work fine:
select DATEDIFF(e.date, :date) from SomeEntity e
select :date from SomeEntity e where :date < e.date
Related issue: