@SuppressWarnings("rawtypes")
public static List<Criterion> getEntityCriterions(String nestedName, Object entity,
String[] excludePropertes, MatchMode mode, boolean ignoreZero) {
if (null == entity) { return Collections.emptyList(); }
List<Criterion> criterions = CollectUtils.newArrayList();
BeanMap map = new BeanMap(entity);
Set keySet = map.keySet();
Collection properties = null;
if (null == excludePropertes) {
List proList = CollectUtils.newArrayList();
proList.addAll(keySet);
properties = proList;
} else {
properties = CollectionUtils.subtract(keySet, Arrays.asList(excludePropertes));
}
properties.remove("class");
for (Iterator iter = properties.iterator(); iter.hasNext();) {
String propertyName = (String) iter.next();
if (!PropertyUtils.isWriteable(entity, propertyName)) {
continue;
}
Object value = map.get(propertyName);
addCriterion(nestedName, entity, excludePropertes, propertyName, value, criterions, mode,
ignoreZero);
}
return criterions;
}