code: public <T, Y> List<T> getListByAttribute(Class<T> entityCls,
              QueryPathProvider<T, Y> provider, Y value) {
          if (entityCls == null) {
              throw new IllegalArgumentException("entityCls cannot be null");
          }
          if (provider == null) {
              throw new IllegalArgumentException("provider cannot be null");
          }
          TypedQuery<T> typedQuery
                  = createTypedQuery(entityCls, provider, value);
          return typedQuery.getResultList();
      }
docs: Executes a query for entities that match the given path value. The path
  may traverse one or more entity relationships, and is followed through to
  get the resulting attribute. That attribute's value is compared to the
  given target value.
  
  @param <T> the type of the entity class.
  @param <Y> the type of the target value and resulting attribute/column
  value.
  @param entityCls the entity class. Cannot be <code>null</code>.
  @param provider provides the path from the entity to the target
  attribute/column. Cannot be <code>null</code>.
  @param value the target value to compare with the resulting attribute
  value.
  @return the matching entities. Guaranteed not <code>null</code>.