Class RelevantCharacteristicQueryHook

  • All Implemented Interfaces:
    Prioritizable, AdvancedQueryBuilderHook

    @Dependent
    public class RelevantCharacteristicQueryHook
    extends Object
    implements AdvancedQueryBuilderHook
    This hooks allows to build the joins, filters and order by clauses for those queries that use a property path that points to a relevant characteristic property.
    • Constructor Detail

      • RelevantCharacteristicQueryHook

        public RelevantCharacteristicQueryHook()
    • Method Detail

      • parseSimpleFilterClause

        public String parseSimpleFilterClause​(AdvancedQueryBuilder queryBuilder,
                                              String fieldName,
                                              String operator,
                                              Object value)
        Description copied from interface: AdvancedQueryBuilderHook
        This method is used to provide an alternative way of parsing a simple filter clause. Note that this method may return null which means that the filter clause may be parsed by another AdvancedQueryBuilderHook with less priority, if exists. In case there is no hook returning a not null value, then the filter clause will be parsed with the standard logic of the AdvancedQueryBuilder.
        Specified by:
        parseSimpleFilterClause in interface AdvancedQueryBuilderHook
        Parameters:
        queryBuilder - The AdvancedQueryBuilder instance. It can be used to access to information related to the query being built
        fieldName - The name (it can be a path) of the property being filtered
        operator - The filtering operator
        value - The value to filter the property
        Returns:
        a String containing the parsed filter clause or null in case this hook is not able to parse the filter clause
      • parseOrderByClausePart

        public String parseOrderByClausePart​(AdvancedQueryBuilder queryBuilder,
                                             String orderByPart)
        Description copied from interface: AdvancedQueryBuilderHook
        This method is used to provide an alternative way of parsing a part of the order by clause. Note that this method may return null which means that the part of the order by may be parsed by another AdvancedQueryBuilderHook with less priority, if exists. In case there is no hook returning a not null value, then the order by clause will be parsed with the standard logic of the AdvancedQueryBuilder.
        Specified by:
        parseOrderByClausePart in interface AdvancedQueryBuilderHook
        Parameters:
        queryBuilder - The AdvancedQueryBuilder instance. It can be used to access to information related to the query being built
        orderByPart - One of the parts of order by clause of the query being built
        Returns:
        a String with the parsed filter clause or null in case this hook is not able to parse the filter clause