predicate = and(predicate, path.contains(filter));
} else { // if not ranged search
if (filter instanceof String) {
StringPath path = entityPath.getString(key);
String filterString = (String) filter;
predicate = and(predicate, path.startsWithIgnoreCase(filterString));
} else if (filter instanceof Date) {
DatePath path = entityPath.getDate(key, Date.class);
predicate = and(predicate, path.eq(filter));
} else if (filter instanceof Number) {
NumberPath path = createNumberPath(entityPath, key, filter);