code: public <T> List<Predicate> byExample(ManagedType<T> mt, Path<T> mtPath, T mtValue, SearchParameters sp, CriteriaBuilder builder) {
          List<Predicate> predicates = newArrayList();
          for (SingularAttribute<? super T, ?> attr : mt.getSingularAttributes()) {
              if (attr.getPersistentAttributeType() == MANY_TO_ONE //
                      || attr.getPersistentAttributeType() == ONE_TO_ONE //
                      || attr.getPersistentAttributeType() == EMBEDDED) {
                  continue;
              }
  
              Object attrValue = jpaUtil.getValue(mtValue, attr);
              if (attrValue != null) {
                  if (attr.getJavaType() == String.class) {
                      if (isNotEmpty((String) attrValue)) {
                          predicates.add(jpaUtil.stringPredicate(mtPath.get(jpaUtil.stringAttribute(mt, attr)), attrValue, sp, builder));
                      }
                  } else {
                      predicates.add(builder.equal(mtPath.get(jpaUtil.attribute(mt, attr)), attrValue));
                  }
              }
          }
          return predicates;
      }
docs: /*
  Add a predicate for each simple property whose value is not null.