some filter conditions

This commit is contained in:
Michele Artini 2022-10-10 11:20:27 +02:00
parent 7a2ce6b2ad
commit bf11721159
1 changed files with 2 additions and 4 deletions

View File

@ -132,17 +132,15 @@ public class DatasourceSpecs {
private static Predicate likeSearchList(final Root<?> r, final CriteriaBuilder cb, final Entry<FilterName, Object> e) {
final String key = e.getKey().name();
log.info("key : " + key);
log.info("val : " + e.getValue());
final Predicate[] arr =
Arrays.stream(e.getValue().toString().split(","))
.map(String::trim)
.map(String::toLowerCase)
.filter(StringUtils::isNotBlank)
.map(s -> cb.like(cb.lower(r.get(key)), WILDCARD + s + WILDCARD))
.toArray(size -> new Predicate[size]);
return cb.or(arr);
}
// search by ID, managed. exact match