Interface ContentQueryBuilder


  • public interface ContentQueryBuilder
    A builder used to configure and build a new ContentQuery.

    The builder is a throwaway-object; you can only build a single query using the same builder.

    • Method Detail

      • build

        ContentQuery build()
        Returns a ContentQuery built from parameters set on this builder.
        Returns:
        a ContentQuery built from parameters set on this builder
      • select

        ContentQueryBuilder select​(Collection<?> expressions)
        Adds multiple fields or functions to the query, using Expressions or external keys.
      • select

        ContentQueryBuilder select​(String... externalKeys)
        Adds multiple fields or functions to the query, using their external keys.
      • select

        <T> ContentQueryBuilder select​(Class<T> clazz)
        Adds multiple fields to the query, based on an annotated java class.
      • where

        ContentQueryBuilder where​(Predicate predicate)
        Adds a where-clause to the query, using a Predicate.
        Parameters:
        predicate - the predicate to add
        Returns:
        this ContentQueryBuilder
      • where

        ContentQueryBuilder where​(Predicate... predicates)
        Adds multiple where-clauses to the query, using Predicates.
        Parameters:
        predicates - the predicates to add
        Returns:
        this ContentQueryBuilder
      • where

        ContentQueryBuilder where​(String externalKey,
                                  String operator,
                                  String... values)
        Adds a where clause to the query, using an external key, and operator, and one or more values.

        If possible, use the Predicate-based method, since this ensures a valid where-clause.

        Parameters:
        externalKey - the external key of the field to search in
        operator - the operator to use
        values - one or more values to search for
        Returns:
        this ContentQueryBuilder
      • orderBy

        ContentQueryBuilder orderBy​(ContentQueryOrderByClause orderByClause)
        Adds an order by clause.

        Not applicable for rows retrieved during traversal.

        Order by-clauses are typically generated by using methods on Expression-objects

        Parameters:
        orderByClause - the order by clause
        Returns:
        this ContentQueryBuilder
      • orderBy

        ContentQueryBuilder orderBy​(ContentQueryOrderByClause... orderByClauses)
        Adds multiple order by clauses.

        Not applicable for rows retrieved during traversal.

        Order by-clauses are typically generated by using methods on Expression-objects

        Parameters:
        orderByClauses - the order by clauses
        Returns:
        this ContentQueryBuilder
      • orderBy

        ContentQueryBuilder orderBy​(OrderableExpression expression)
        Adds an order by clause using an expression.

        Not applicable for rows retrieved during traversal.

        It is normally preferred to use an Expression object to generate (and configure) a ContentQueryOrderByClause instead.

        Parameters:
        expression - the expression to sort
        Returns:
        this ContentQueryBuilder
      • orderBy

        ContentQueryBuilder orderBy​(OrderableExpression... expressions)
        Adds multiple order by clause using expressions.

        Not applicable for rows retrieved during traversal.

        It is normally preferred to use an Expression object to generate (and configure) a ContentQueryOrderByClause instead.

        Parameters:
        expressions - the expressions to sort
        Returns:
        this ContentQueryBuilder
      • orderBy

        ContentQueryBuilder orderBy​(String externalKey)
        Adds an order by clause to the query, using an external key.

        Not applicable for rows retrieved during traversal.

        It is normally preferred to use an Expression object to generate (and configure) a ContentQueryOrderByClause instead.

        Parameters:
        externalKey - external key of the field to sort
        Returns:
        this ContentQueryBuilder
      • orderBy

        ContentQueryBuilder orderBy​(String... externalKeys)
        Adds multiple order by clause to the query, using external keys.

        Not applicable for rows retrieved during traversal.

        It is normally preferred to use an Expression object to generate (and configure) a ContentQueryOrderByClause instead.

        Parameters:
        externalKeys - external keys of the fields to sort
        Returns:
        this ContentQueryBuilder
      • traverseDown

        ContentQueryBuilder traverseDown()
        Specifies that the query shall include all descendant documents.
        Returns:
        this ContentQueryBuilder
      • traverseDown

        ContentQueryBuilder traverseDown​(int levels)
        Specifies that the query shall include descendant documents, limited to level number of levels. You must specify a number higher than zero for this to have any effect.
        Parameters:
        levels - number of levels to traverse. levels=1 means top level + one level of descendants.
        Returns:
        this ContentQueryBuilder
      • traverseUp

        ContentQueryBuilder traverseUp()
        Specifies that the query shall include all ancestor documents.
        Returns:
        this ContentQueryBuilder
      • traverseUp

        ContentQueryBuilder traverseUp​(int levels)
        Specifies that the query shall include ancestor documents, limited to level number of levels. You must specify a number higher than zero for this to have any effect.
        Parameters:
        levels - number of levels to traverse. levels=1 means top level + one level of ancestors.
        Returns:
        this ContentQueryBuilder
      • traversalOrderBy

        ContentQueryBuilder traversalOrderBy​(ContentQueryOrderByClause orderByClause)
        Adds an order by clause.

        Applicable for rows retrieved during traversal.

        Order by-clauses are typically generated by using methods on Expression-objects

        Parameters:
        orderByClause - the order by clause
        Returns:
        this ContentQueryBuilder
      • traversalOrderBy

        ContentQueryBuilder traversalOrderBy​(ContentQueryOrderByClause... orderByClauses)
        Adds multiple order by clauses.

        Applicable for rows retrieved during traversal.

        Order by-clauses are typically generated by using methods on Expression-objects

        Parameters:
        orderByClauses - the order by clauses
        Returns:
        this ContentQueryBuilder
      • traversalOrderBy

        ContentQueryBuilder traversalOrderBy​(Expression expression)
        Adds an order by clause using an expression.

        Applicable for rows retrieved during traversal.

        It is normally preferred to use an Expression object to generate (and configure) a ContentQueryOrderByClause instead.

        Parameters:
        expression - the expression to sort
        Returns:
        this ContentQueryBuilder
      • traversalOrderBy

        ContentQueryBuilder traversalOrderBy​(Expression... expressions)
        Adds multiple order by clause using expressions.

        Applicable for rows retrieved during traversal.

        It is normally preferred to use an Expression object to generate (and configure) a ContentQueryOrderByClause instead.

        Parameters:
        expressions - the expressions to sort
        Returns:
        this ContentQueryBuilder
      • traversalOrderBy

        ContentQueryBuilder traversalOrderBy​(String externalKey)
        Adds an order by clause to the query, using an external key.

        Applicable for rows retrieved during traversal.

        It is normally preferred to use an Expression object to generate (and configure) a ContentQueryOrderByClause instead.

        Parameters:
        externalKey - external key of the field to sort
        Returns:
        this ContentQueryBuilder
      • traversalOrderBy

        ContentQueryBuilder traversalOrderBy​(String... externalKeys)
        Adds multiple order by clause to the query, using external keys.

        Applicable for rows retrieved during traversal.

        It is normally preferred to use an Expression object to generate (and configure) a ContentQueryOrderByClause instead.

        Parameters:
        externalKeys - external keys of the fields to sort
        Returns:
        this ContentQueryBuilder
      • includingVersionedDocuments

        ContentQueryBuilder includingVersionedDocuments()
        Specifies that the query shall return versioned documents for a given document.

        Note that a versioned document-query must always specify a single document to search for, as attribute predicates do not consider the versioned attributes.

        Note that this will automatically include selecting IKB$VERSION_STATUS

        Returns:
        this ContentQueryBuilder
      • includingRowCount

        ContentQueryBuilder includingRowCount()
        Specifies that the query shall include row count.

        Including a row count will generally slow down the query, so use this only when you really need the value.

        Returns:
        this ContentQueryBuilder
      • includingSpecialFunctions

        ContentQueryBuilder includingSpecialFunctions()
        Specifies that the query shall prepare information required for special functions.

        Certain actions provided directly by the ContentQueryRow, such as edit-actions, check in-actions and the like, require extra information to be queried. Requesting special functions ensures that all required information is present.

        Including special functions will generally slow down the query, so only use this when required.

        Returns:
        this ContentQueryBuilder
      • contentOperation

        ContentQueryBuilder contentOperation​(GetOperationEnumeration contentOperation)
        Specifies whether LOB content (TEXT, XML, FILE) will be loaded into Document.Content object.
        Parameters:
        contentOperation - one of the valid GetOperationEnumeration values
        Returns:
        this ContentQueryBuilder
      • attributeOperation

        ContentQueryBuilder attributeOperation​(GetOperationEnumeration attributeOperation)
        Specifies the amount of details to be loaded for the document attributes.
        Parameters:
        attributeOperation - one of the valid GetOperationEnumeration values
        Returns:
        this ContentQueryBuilder
      • limit

        ContentQueryBuilder limit​(long rows)
        Specifies the number of rows to be returned by the query.

        Not applicable for rows retrieved during traversal.

        Note that the limit can be overridden by the ContentQueryRunner, if required.

        Parameters:
        rows - the number of rows to return
        Returns:
        this ContentQueryBuilder
      • configure

        ContentQueryBuilder configure​(Consumer<ContentQueryBuilder> configurator)
        Calls a configuration function with this builder, to allow reusable configuration logic.

        This function calls a separate configurator function with this builder as a parameter. The configurator can then configure this builder as it sees fit. The main use case of this is to include a shared configuration as part of a fluent builder-pattern.

        Parameters:
        configurator - the configurator function
        Returns:
        this ContentQueryBuilder
      • configure

        <U> ContentQueryBuilder configure​(BiConsumer<ContentQueryBuilder,​U> configurator,
                                          U parameter)
        Calls a configuration function with this builder, to allow reusable configuration logic.

        This function calls a separate configurator function with this builder as the first parameter, and a user specified value as the second. The configurator can then configure this builder as it sees fit. The main use case of this is to include a shared configuration as part of a fluent builder-pattern.

        Parameters:
        configurator - the configurator function
        Returns:
        this ContentQueryBuilder