code: private QueryBuilder getFilter(FilterClause clause, final EntityMetadata metadata)
      {
          String condition = clause.getCondition();
          Object value = condition.equals(Expression.IN) ? clause.getValue() : clause.getValue().get(0);
          String name = ((AbstractAttribute) ((MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
                  metadata.getPersistenceUnit())).entity(metadata.getEntityClazz()).getAttribute(clause.getProperty()))
                  .getJPAColumnName();
  
          QueryBuilder filterBuilder = null;
  
          if (condition.equals(Expression.EQUAL))
          {
              filterBuilder = new TermQueryBuilder(name, value);
          }
          else if (condition.equals(Expression.GREATER_THAN))
          {
              filterBuilder = new RangeQueryBuilder(name).gt(value);
          }
          else if (condition.equals(Expression.LOWER_THAN))
          {
              filterBuilder = new RangeQueryBuilder(name).lt(value);
          }
          else if (condition.equals(Expression.GREATER_THAN_OR_EQUAL))
          {
              filterBuilder = new RangeQueryBuilder(name).gte(value);
          }
          else if (condition.equals(Expression.LOWER_THAN_OR_EQUAL))
          {
              filterBuilder = new RangeQueryBuilder(name).lte(value);
          }
          else if (condition.equals(Expression.DIFFERENT))
          {
              filterBuilder = new NotQueryBuilder(new TermQueryBuilder(name, value));
          }
          else if (condition.equals(Expression.IN))
          {
              filterBuilder = new TermsQueryBuilder(name, clause.getValue());
          }
  
          return filterBuilder;
      }
docs: Gets the filter.
  
  @param clause
  the clause
  @param metadata
  the metadata
  @param entityType
  the entity type
  @return the filter