cursor.close();
return count;
}
private Criteria prepareExampleCriteria(User exampleUser, String orderByProperty, boolean orderDescending, String... ignoreProperty) {
Example example = Example.create(exampleUser).enableLike(MatchMode.ANYWHERE).ignoreCase();
// Sanitize input
if (orderByProperty != null) {
orderByProperty = orderByProperty.replaceAll("[^a-zA-Z0-9]", "");
}
for (String s : ignoreProperty) example.excludeProperty(s);
Session session = (Session)entityManager.getDelegate();
Criteria crit = session.createCriteria(User.class).add(example);
if (orderByProperty != null)