There is another way to do search using Full Text Search in MySQL which is the database I'm using. Although I need to do some testing to make sure I get what I want but seems like it might be possible to do search without breaking the string which is highly desirable as I want to use spring boot and jpa and query would be hardcoded. I found this video which shows how to use FTS on one table.
https://www.youtube.com/watch?v=WPMQdnwPJLc
using this I modified my query by indexing both tables like the video describes and made the following query. Need to test to make sure it returns what I want.
Note: watch video on how to create FTS index in MYSQL workbench queries don't work without indexes
Query using one table
select * from Product where
MATCH (productName, productDescription, about)
AGAINST ('Plain-woven Navy');
Query using multiple tables
select *
from Product a
inner join
productItem b on (a.productId=b.productId)
inner join
ProductColor c on (b.productColorId=c.productColorId)
where
MATCH (a.productName, a.productDescription, a.about)
AGAINST ('Plain-woven Navy')
and
MATCH (c.colorName)
AGAINST ('Plain-woven Navy');