Filter configuration error

Hi,

In 2.1.2 version, I have a filter with several conditions.

The problem is when I apply the filter and select a date, it selects all the records that contain the jpql condition without applying the dates.

image

This is the “desde” condition:

image

This is the “hasta” condition:

image

Finally, this is the “David” condition:

image

Is a filter error or is a role issue?

Thanks.

Hi!

Unfortunately, the current issue description is unclear.

Could you please attach a small test project and reproduction steps?
What behaviour did you expect and what did you get as a result?

Hello

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.

Thank you.

Hi!

I still haven’t been able to reproduce your problem. Could you provide a small test project? This would speed up the solution of the problem.

Best regards,
Dmitriy

Hi,

Here you have a small test project with the filter configuration that gives me an error.

FilterConfiguration.rar (3.4 MB)

Thanks.

Hi!

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:
image

To solve this issue, I created a ticket in our GitHub bug tracking system: The JPQL filter can be misleading when used in a group filter · Issue #2949 · jmix-framework/jmix · GitHub

Best regards,
Dmitriy