Interface BetweenBuilder<T>
- Type Parameters:
T
- The builder type that is returned on terminal operations
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 Summary
Modifier and TypeMethodDescriptionConstructs a between predicate with a parameter as upper bound.andExpression
(String end) Constructs a between predicate with an expression as upper bound.andLiteral
(Object end) Constructs a between predicate with a parameter as upper bound rendered as literal.Constructs a between predicate with a subquery as upper bound.andSubqery
(FullQueryBuilder<?, ?> criteriaBuilder) Constructs a between predicate with a subquery based on the given criteria builder as upper bound.andSubqery
(String subqueryAlias, String expression) Constructs a between predicate with an expression containing a subquery as upper bound.andSubqery
(String subqueryAlias, String expression, FullQueryBuilder<?, ?> criteriaBuilder) Constructs a between predicate with an expression containing a subquery as upper bound.andSubqueries
(String expression) Constructs a between predicate with an expression containing the given expression as upper bound.
-
Method Details
-
and
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
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
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
Constructs a between predicate with an expression containing a subquery as upper bound.All occurrences of
subqueryAlias
inexpression
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 subqueryexpression
- The expression which will be used as left hand side of a predicate. This expression contains thesubqueryAlias
to define the insertion points for the subquery.- Returns:
- The
SubqueryInitiator
for building the upper bound subquery.
-
andSubqueries
Constructs a between predicate with an expression containing the given expression as upper bound.All occurrences of subsequently defined
subqueryAlias
es inexpression
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
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
inexpression
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 subqueryexpression
- The expression which will be used as left hand side of a predicate. This expression contains thesubqueryAlias
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
-