melistik / vaadin-grid-util

simplify the use of vaadin's grid and add features
https://vaadin.com/directory/component/gridutil
MIT License
32 stars 21 forks source link

Filter does not work for columns of joined tables #38

Closed rbuchli closed 7 years ago

rbuchli commented 7 years ago

If I filter a joined column a syntactically incorrect query will be generated. In my case (explanation: a gemeinde (location) has 1-n coordinates and a coordinate has zero or one ereignis (event)) the generated query looks like this:

SELECT COUNT(t0.IDEREIGNIS) FROM tblereignis t0, tblkoord t2, tblgemeinde t1 WHERE (UPPER() LIKE UPPER(?) AND ((t2.IDEREIGNIS = t0.IDEREIGNIS) AND (t1.GEMEINDE = t2.gemeinde)))

Correct would be:

SELECT COUNT(t0.IDEREIGNIS) FROM tblereignis t0, tblkoord t2, tblgemeinde t1 WHERE (UPPER(t1.GEMEINDE) LIKE UPPER(?) AND ((t2.IDEREIGNIS = t0.IDEREIGNIS) AND (t1.GEMEINDE = t2.gemeinde)))

The error also occurs without UPPER() (if numeric) and also for two joined tables. I don't know why there is a count query generated. But with the missing field name it fails and I can't use the filter for joined attributes.