Interface BetweenBuilder<T>

  • Type Parameters:
    T - The builder type that is returned on terminal operations

    public interface BetweenBuilder<T>
    The builder interface for between predicates.

    This builder allows the specification of the upper bound of the between predicate. The left hand side expression of the between predicate as well as the lower bound expression are already known to the builder and the methods of this builder either terminate the building process or start a SubqueryInitiator.

    Since:
    1.0.0
    Author:
    Moritz Becker
    • Method Detail

      • and

        T and​(Object end)
        Constructs a between predicate with a parameter as upper bound.
        Parameters:
        end - The parameter for the upper bound
        Returns:
        The parent predicate container builder
      • andLiteral

        T andLiteral​(Object end)
        Constructs a between predicate with a parameter as upper bound rendered as literal.
        Parameters:
        end - The parameter for the upper bound
        Returns:
        The parent predicate container builder
        Since:
        1.4.0
      • andExpression

        T andExpression​(String end)
        Constructs a between predicate with an expression as upper bound.
        Parameters:
        end - The upper bound expression
        Returns:
        The parent predicate container builder
      • andSubqery

        SubqueryInitiator<T> andSubqery()
        Constructs a between predicate with a subquery as upper bound.
        Returns:
        The SubqueryInitiator for building the upper bound subquery.
      • andSubqery

        SubqueryInitiator<T> andSubqery​(String subqueryAlias,
                                        String expression)
        Constructs a between predicate with an expression containing a subquery as upper bound.

        All occurrences of subqueryAlias in expression will be replaced by the subquery. This allows to build expressions containing subqueries like following example shows:

        andSubquery("x", "x * 2 + 1").from(Person.class, "p").select("COUNT(p)").end();

        results in:

        (SELECT COUNT(p) FROM Person p) * 2 + 1

        Parameters:
        subqueryAlias - The alias for the subquery which will be replaced by the actual subquery
        expression - The expression which will be used as left hand side of a predicate. This expression contains the subqueryAlias to define the insertion points for the subquery.
        Returns:
        The SubqueryInitiator for building the upper bound subquery.
      • andSubqueries

        MultipleSubqueryInitiator<T> andSubqueries​(String expression)
        Constructs a between predicate with an expression containing the given expression as upper bound.

        All occurrences of subsequently defined subqueryAliases in expression will be replaced by the respective subquery. When the builder finishes, the resulting expression is used for the upper bound of the between predicate.

        Parameters:
        expression - The expression which will be used as upper bound of a the between predicate
        Returns:
        The subquery initiator for building multiple subqueries for their respective subqueryAliases
        Since:
        1.2.0
      • andSubqery

        SubqueryBuilder<T> andSubqery​(FullQueryBuilder<?,​?> criteriaBuilder)
        Constructs a between predicate with a subquery based on the given criteria builder as upper bound.
        Parameters:
        criteriaBuilder - The criteria builder to base the subquery on
        Returns:
        The subquery builder for building the upper bound subquery
        Since:
        1.2.0
      • andSubqery

        SubqueryBuilder<T> andSubqery​(String subqueryAlias,
                                      String expression,
                                      FullQueryBuilder<?,​?> criteriaBuilder)
        Constructs a between predicate with an expression containing a subquery as upper bound.

        All occurrences of subqueryAlias in expression will be replaced by the subquery. This allows to build expressions containing subqueries like following example shows:

        andSubquery("x", "x * 2 + 1").from(Person.class, "p").select("COUNT(p)").end();

        results in:

        (SELECT COUNT(p) FROM Person p) * 2 + 1

        Parameters:
        subqueryAlias - The alias for the subquery which will be replaced by the actual subquery
        expression - The expression which will be used as left hand side of a predicate. This expression contains the subqueryAlias to define the insertion points for the subquery.
        criteriaBuilder - The criteria builder to base the subquery on
        Returns:
        The subquery builder for building the upper bound subquery
        Since:
        1.2.0