I want to query the DB based on user input. For instance, if this input is "long red wire", the query must be:
SELECT * FROM foo WHERE tag ILIKE 'long' OR tag ILIKE 'red' OR tag ILIKE 'wire';
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
As you can see, the structure of the query changes with the input, it is not just the data.
Does Spring offer any functionality to cope with queries with variable structures? Or should I construct the string by myself?
This is somewhat what I have in mind.
SELECT * FROM foo WHERE {{tag = '?'} OR};