I am trying to find all persons from Hazelcast IMap by given FirsName and LastName.
The name (first and last), must be case insensitive. For example, "John Dow" and "john dow" is the same person.
I tried to use Criteria build to create case insensitive without success.
Code as:
PredicateBuilder.EntryObject eo = Predicates.newPredicateBuilder().getEntryObject();
Predicate fnpredicate = eo.get("personFirstname").equal(firstName.toLowerCase(Locale.ROOT));
Predicate lnpredicate = eo.get("personLastname").equal(lastName.toLowerCase(Locale.ROOT));
Predicate personPredicate = Predicates.and(fnpredicate,lnpredicate);
Collection<Person> persons = getEntityMap().values( personPredicate );
My question is: How I can set predicate's attributes to lower case?