BigMemory 4.3.7 | Product Documentation | BigMemory Max 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());
BigMemory SQL also supports using the presence or absence of null as search criteria:
select * from searchable where birthDate is null
select * from searchable where birthDate is not null
Alternatively, you can call constructors to set up equivalent logic:
Criteria isNull = new IsNull("middle_name");
Criteria notNull = new NotNull("middle_name");