| | |
| | | Set<Predicate> set = new HashSet<>(); |
| | | |
| | | param.getCommunicationStyles().forEach((communicationStyle) -> { |
| | | set.add(criteriaBuilder.like(root.get("concept"), "%" + param.getCommunicationStyles() + "%")); |
| | | set.add(criteriaBuilder.like(root.get("communicationStyle"), "%" + communicationStyle + "%")); |
| | | }); |
| | | |
| | | if(Objects.nonNull(param.getGender())) { |
| | |
| | | |
| | | Predicate[] predicates = new Predicate[set.size()]; |
| | | predicates = set.toArray(predicates); |
| | | return criteriaBuilder.or(predicates); |
| | | return criteriaBuilder.and(predicates); |
| | | } |
| | | }; |
| | | } |