Trying to find multiple fields with ExampleMatcher query. in below class we have 4 field:
public class contact {
private String name;
private long phoneNumber; //primary
private String email;
private String organization;
}
Now for example I want to search with name and email fields and other fields request are null. result should be list of contacts that contain name and email request. My search request get unknown number of fields.
ExampleMatcher userExampleMatcher = ExampleMatcher.matchingAll()
.withNullHandler(ExampleMatcher.NullHandler.IGNORE);
Iterable<Contact> contacts = dao.findAll(Example.of(contactObject, userExampleMatcher));
This config just for phone number return true result and for other fields return null.