Ehcache 2.10.6 | Product Documentation | Ehcache Developer Guide | Searching a Cache | Options for Working with Nulls
 
Options for Working with Nulls
The Search API supports using the presence of a null as search criteria.
myQuery.addCriteria(cache.getAttribute("middle_name").isNull());
It also supports using the absence of a null as search criteria:
myQuery.addCriteria(cache.getAttribute("middle_name").notNull());
Which is equivalent to:
myQuery.addCriteria(cache.getAttribute("middle_name").isNull().not());
Alternatively, you can call constructors to set up equivalent logic:
Criteria isNull = new IsNull("middle_name");
Criteria notNull = new NotNull("middle_name");

Copyright © 2010-2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.