Package com.blazebit.persistence
Interface BasePredicateBuilder<T extends BasePredicateBuilder<T>>
- Type Parameters:
T
- The concrete builder type
- All Known Subinterfaces:
PredicateAndBuilder<T>
,PredicateBuilder
,PredicateOrBuilder<T>
public interface BasePredicateBuilder<T extends BasePredicateBuilder<T>>
A base interface for builders that support filtering.
This is related to the fact, that a query builder supports predicate clauses.
- Since:
- 1.6.8
- Author:
- Christian Beikov
-
Method Summary
Modifier and TypeMethodDescriptionexists()
Starts an exists predicate for the where clause with a subquery on the right hand side.exists
(FullQueryBuilder<?, ?> criteriaBuilder) Starts an exists predicate for the where clause with a subquery on the right hand side based on the given criteria builder.expression
(String expression) Starts aRestrictionBuilder
for a where predicate with the given expression as left hand expression.Starts an not exists predicate for the where clause with a subquery on the right hand side.notExists
(FullQueryBuilder<?, ?> criteriaBuilder) Starts an exists predicate for the where clause with a subquery on the right hand side based on the given criteria builder.Starts aCaseWhenBuilder
for a where predicate.selectCase
(String expression) Starts aSimpleCaseWhenBuilder
for a where predicate.subqueries
(String expression) Starts aMultipleSubqueryInitiator
for the left hand side of a predicate.subquery()
Starts aSubqueryInitiator
for the left hand side of a predicate.subquery
(FullQueryBuilder<?, ?> criteriaBuilder) Starts aSubqueryBuilder
based on the given criteria builder for the left hand side of a predicate.Starts aSubqueryInitiator
for the left hand side of a predicate.subquery
(String subqueryAlias, String expression, FullQueryBuilder<?, ?> criteriaBuilder) Starts aSubqueryBuilder
based on the given criteria builder for the left hand side of a predicate.withExpression
(String expression) Adds the given expression as expression for the where clause.withExpressionSubqueries
(String expression) Starts aMultipleSubqueryInitiator
for expression of the where clause.
-
Method Details
-
subquery
SubqueryInitiator<RestrictionBuilder<T>> subquery()Starts aSubqueryInitiator
for the left hand side of a predicate. When the subquery builder and the restriction builder for the right hand side are finished, the predicate is added to the parent predicate container represented by the typeT
.- Returns:
- The subquery initiator for building a subquery
-
subquery
Starts aSubqueryInitiator
for the left hand side of a predicate.All occurrences of
subqueryAlias
inexpression
will be replaced by the subquery. When the subquery builder and the restriction builder for the right hand side are finished, the predicate is added to the parent predicate container represented by the typeT
.- 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 subquery initiator for building a subquery
-
subqueries
Starts aMultipleSubqueryInitiator
for the left hand side of a predicate.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 left hand side of the predicate.- Parameters:
expression
- The expression which will be used as left hand side of a predicate- Returns:
- The subquery initiator for building multiple subqueries for their respective subqueryAliases
-
subquery
Starts aSubqueryBuilder
based on the given criteria builder for the left hand side of a predicate. When the subquery builder and the restriction builder for the right hand side are finished, the predicate is added to the parent predicate container represented by the typeT
.- Parameters:
criteriaBuilder
- The criteria builder to base the subquery on- Returns:
- The subquery builder for building a subquery
-
subquery
SubqueryBuilder<RestrictionBuilder<T>> subquery(String subqueryAlias, String expression, FullQueryBuilder<?, ?> criteriaBuilder) Starts aSubqueryBuilder
based on the given criteria builder for the left hand side of a predicate. All occurrences ofsubqueryAlias
inexpression
will be replaced by the subquery. When the subquery builder and the restriction builder for the right hand side are finished, the predicate is added to the parent predicate container represented by the typeT
.- 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 predicatecriteriaBuilder
- The criteria builder to base the subquery on- Returns:
- The subquery builder for building a subquery
-
withExpression
Adds the given expression as expression for the where clause.- Parameters:
expression
- The where expression- Returns:
- The builder
-
withExpressionSubqueries
Starts aMultipleSubqueryInitiator
for expression of the where clause.All occurrences of subsequently defined
subqueryAlias
es inexpression
will be replaced by the respective subquery. When the builder finishes, the resulting expression is added as expression to the parent predicate container represented by the typeT
.- Parameters:
expression
- The where expression- Returns:
- The subquery initiator for building multiple subqueries for their respective subqueryAliases
-
expression
Starts aRestrictionBuilder
for a where predicate with the given expression as left hand expression. When the builder finishes, the predicate is added to the parent predicate container represented by the typeT
.- Parameters:
expression
- The left hand expression for a where predicate- Returns:
- The restriction builder for the given expression
-
selectCase
CaseWhenStarterBuilder<RestrictionBuilder<T>> selectCase()Starts aCaseWhenBuilder
for a where predicate. When theCaseWhenBuilder
and the restriction builder for the right hand side are finished, the predicate is added to the parent predicate container represented by the typeT
.- Returns:
- A
CaseWhenBuilder
-
selectCase
Starts aSimpleCaseWhenBuilder
for a where predicate. When theCaseWhenBuilder
and the restriction builder for the right hand side are finished, the predicate is added to the parent predicate container represented by the typeT
.- Parameters:
expression
- Case operand expression- Returns:
- A
CaseWhenBuilder
-
exists
SubqueryInitiator<T> exists()Starts an exists predicate for the where clause with a subquery on the right hand side. When the builder finishes, the predicate is added to the parent predicate container represented by the typeT
.- Returns:
- The subquery initiator for building a subquery
-
notExists
SubqueryInitiator<T> notExists()Starts an not exists predicate for the where clause with a subquery on the right hand side. When the builder finishes, the predicate is added to the parent predicate container represented by the typeT
.- Returns:
- The subquery initiator for building a subquery
-
exists
Starts an exists predicate for the where clause with a subquery on the right hand side based on the given criteria builder. When the builder finishes, the predicate is added to the parent predicate container represented by the typeT
.- Parameters:
criteriaBuilder
- The criteria builder to base the subquery on- Returns:
- The subquery builder for building a subquery
-
notExists
Starts an exists predicate for the where clause with a subquery on the right hand side based on the given criteria builder. When the builder finishes, the predicate is added to the parent predicate container represented by the typeT
.- Parameters:
criteriaBuilder
- The criteria builder to base the subquery on- Returns:
- The subquery builder for building a subquery
-