Exactly and it surely has nothing to do with NULL ;)
meta attribute is something you can apply to class'es and assocations, e.g.
Code:
<property name="prop">
<meta attribute="criteria-all-value">0</meta>
</property>
and now that stuff is available via Property.getMetaAttributes()
PropertySelector is what is used to tell hibernate which attributes to consider in Criteria/Example queries:
s.createCriteria(Account.class)
.add( Example.create(accountBean). setPropertySelector(new YourCustomSelector());
Then your propery selector is passed each property name and the example value on which you can decide wether you want it included or not.
Hibernate already has a few built in which is activated by calling excludeZeroes(), and excludeNone().
So an example for your usecase would be:
class NotNullOrMinusPropertySelector implements PropertySelector {
public boolean include(Object object, String propertyName, Type type) {
return object!=null && (
!(object instanceof Number) || ( (Number) object ).longValue()!=-1
);
}
}