code: @Transactional
      public <T> List<T> findProperty(Class<T> propertyType, E entity, SearchParameters sp, List<Attribute<?, ?>> attributes) {
          if (sp.hasNamedQuery()) {
              return byNamedQueryUtil.findByNamedQuery(sp);
          }
          CriteriaBuilder builder = entityManager.getCriteriaBuilder();
          CriteriaQuery<T> criteriaQuery = builder.createQuery(propertyType);
          if (sp.getDistinct()) {
              criteriaQuery.distinct(true);
          }
          Root<E> root = criteriaQuery.from(type);
          Path<T> path = jpaUtil.getPath(root, attributes);
          criteriaQuery.select(path);
  
          // predicate
          Predicate predicate = getPredicate(criteriaQuery, root, builder, entity, sp);
          if (predicate != null) {
              criteriaQuery = criteriaQuery.where(predicate);
          }
  
          // fetches
          fetches(sp, root);
  
          // order by
          // we do not want to follow order by specified in search parameters
          criteriaQuery.orderBy(builder.asc(path));
  
          TypedQuery<T> typedQuery = entityManager.createQuery(criteriaQuery);
          applyCacheHints(typedQuery, sp);
          jpaUtil.applyPagination(typedQuery, sp);
          List<T> entities = typedQuery.getResultList();
          log.fine("Returned " + entities.size() + " elements");
  
          return entities;
      }
docs: /*
  Find a list of E property.
  
  @param propertyType type of the property
  @param entity       a sample entity whose non-null properties may be used as search hints
  @param sp           carries additional search information
  @param attributes   the list of attributes to the property
  @return the entities property matching the search.