The following code to search a particulate data in the map is not working when the searchWord contains %,',_, etc
StringBuilder fullQuery= new StringBuilder().
append("Name like \'").append(searchWord).
append("%\'");
List<Person> persons = (List<Person>) personMap
.values(new SqlPredicate(fullQuery));
How can I use those symbols for actual match.
Hazelcast SQL like queries do not have Variable binding like Hibernate. You would have to do that on your own. You might want to store the statement in a constant and use String::format to replace variables.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With