I´ve got a filter configuration with two date conditions, this configuration works great, it apply the selected dates over the dataLoader. However when I add a JPQL condition (to select only items presents in a list) to that configuration, the dates don´t apply to query so the result is a list of entities that exist in the list I passed as JPQL condition but since start of the time instead between DATE 1 and DATE 2.
Hope this clarify the problem if not I will try to recreate the problem in a small project.
I conducted an investigation and found out that the problem is in the filterComponent. As a result, your original query looked like this:
select e from Prueba e
where (
e.marcaTiempoTerminal >= :marcaTiempoTerminalcHRSmFVB
and e.marcaTiempoTerminal <= :marcaTiempoTerminalewUgGAWe
and e.codigoCentro LIKE 'T030%' OR e.codigoCentro LIKE 'T050%' OR e.codigoCentro LIKE 'T070%'
)
This is actually not the expected behavior. Logically, it is expected that each condition will be fulfilled separately.
Thus, the following request was expected:
select e from Prueba e
where (
e.marcaTiempoTerminal >= :marcaTiempoTerminalcHRSmFVB
and e.marcaTiempoTerminal <= :marcaTiempoTerminalewUgGAWe
and (e.codigoCentro LIKE 'T030%' OR e.codigoCentro LIKE 'T050%' OR e.codigoCentro LIKE 'T070%')
)
You can wrap your JPQL query condition in parentheses to make it work now: