I have a SearchApp with few text inputs for a user (name, lastName, address etc.) to filter the database. In my connector I have a huge query with few table joins and a lot of conditions. Point is I added all those conditions, because if user inputs value to all of the fields then they are necessary, but if user inputs only a name and leaves every other field empty then those conditions are unnecessary and I could send just a simple query to the database, instead I’m doing 5 joins with 10 conditions that are gonna evaluate to true anyway.
I want to dynamically change query of the connector, something like:
if (nameTextInput != null) query.append("WHERE name = " + nameTextInput);
You get the idea. Is that possible?