List of usage examples for org.hibernate.criterion Example.PropertySelector Example.PropertySelector
Example.PropertySelector
From source file:net.firejack.platform.core.store.BaseStore.java
License:Apache License
private Example createExample(Object value) { return Example.create(value).enableLike(MatchMode.ANYWHERE).ignoreCase() .setPropertySelector(new Example.PropertySelector() { private static final long serialVersionUID = 1L; public boolean include(Object obj, String property, Type type) { boolean include = obj != null; if (include && (obj instanceof String)) { include = !"".equals(obj); }//from ww w . ja v a 2s . co m if (include && (obj instanceof Number)) { include = !new Long(0l).equals(((Number) obj).longValue()); } // dates are searched by search pattern if (include && (obj instanceof Date)) { include = false; } return include; } }); }