Interface QueryFilter


  • @Role
    public interface QueryFilter
    Query Filter interface. A filter can be added to a query through Query.addFilter(QueryFilter), it will be called by the QueryExecutor before the query is executed. Queries can be filtered during 2 stages:
    • Before the execution, by modifying the statement
    • After the execution, by modifying list of results
    An example of this is the UniqueDocumentFilter which transform statements in order to make them return distinct documents names and which also filters query results in order to return only those names.
    Since:
    4.0RC1
    Version:
    $Id: 8294910720622e482cd4762dccc604f59d4a108f $
    • Method Detail

      • filterStatement

        String filterStatement​(String statement,
                               String language)
        Transform a query statement. The statement can be returned without modification.
        Parameters:
        statement - the query statement to transform.
        language - the language of the query statement.
        Returns:
        the transformed statement.
      • filterResults

        List filterResults​(List results)
        Filter a list of query results. The result list can be returned without modification.
        Parameters:
        results - the original result list.
        Returns:
        a filtered result list.
      • filterQuery

        default Query filterQuery​(Query query)
        Transforms a query. The query can be returned without modification. This allows for example to also transform parameters.

        Note: executes before filterStatement(String, String).

        Parameters:
        query - the query to transform
        Returns:
        the transformed query
        Since:
        8.4.5, 9.3RC1