Package com.blazebit.persistence
Interface CTEBuilder<T extends CTEBuilder<T>>
- Type Parameters:
T
- The concrete builder type
- All Superinterfaces:
ServiceProvider
- All Known Subinterfaces:
BaseSubqueryBuilder<X>
,CriteriaBuilder<T>
,DeleteCriteriaBuilder<T>
,InsertCriteriaBuilder<T>
,LeafOngoingSetOperationSubqueryBuilder<X>
,ModificationCriteriaBuilder<X>
,OngoingSetOperationSubqueryBuilder<T,
,Y> StartOngoingSetOperationCriteriaBuilder<X,
,Y> StartOngoingSetOperationSubqueryBuilder<X,
,Y> SubqueryBuilder<T>
,UpdateCriteriaBuilder<T>
An interface for builders that support CTEs.
This is related to the fact, that a query builder supports the with clause.
- Since:
- 1.1.0
- Author:
- Christian Beikov
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether a CTE for the given type is defined.Creates a builder for a CTE with the given CTE type.Likewith(Class)
but with the option to define whether the query should be inlined.with
(Class<?> cteClass, CriteriaBuilder<?> criteriaBuilder) Creates a builder for a CTE with the given CTE type with the given criteria builder as basis.with
(Class<?> cteClass, CriteriaBuilder<?> criteriaBuilder, boolean inline) Likewith(Class, CriteriaBuilder)
but with the option to define whether the query should be inlined.withCtesFrom
(CTEBuilder<?> cteBuilder) Copies the CTEs from the given CTE builder into this CTE builder.withRecursive
(Class<?> cteClass) Creates a builder for a recursive CTE with the given CTE type.withReturning
(Class<?> cteClass) Creates a builder for a modification CTE with the given CTE type.withStartSet
(Class<?> cteClass) Creates a builder for a CTE with a nested set operation builder.withStartSet
(Class<?> cteClass, boolean inline) LikewithStartSet(Class)
but with the option to define whether the query should be inlined.Methods inherited from interface com.blazebit.persistence.spi.ServiceProvider
getService
-
Method Details
-
with
Creates a builder for a CTE with the given CTE type.- Parameters:
cteClass
- The type of the CTE- Returns:
- The CTE builder
-
with
Creates a builder for a CTE with the given CTE type with the given criteria builder as basis.- Parameters:
cteClass
- The type of the CTEcriteriaBuilder
- The criteria builder to copy the query from- Returns:
- The CTE builder
- Since:
- 1.4.1
-
with
Likewith(Class)
but with the option to define whether the query should be inlined.- Parameters:
cteClass
- The type of the CTEinline
- Whether to inline the query defined by the CTE- Returns:
- The CTE builder
- Since:
- 1.4.1
-
with
FullSelectCTECriteriaBuilder<T> with(Class<?> cteClass, CriteriaBuilder<?> criteriaBuilder, boolean inline) Likewith(Class, CriteriaBuilder)
but with the option to define whether the query should be inlined.- Parameters:
cteClass
- The type of the CTEcriteriaBuilder
- The criteria builder to copy the query frominline
- Whether to inline the query defined by the CTE- Returns:
- The CTE builder
- Since:
- 1.4.1
-
withCtesFrom
Copies the CTEs from the given CTE builder into this CTE builder.- Parameters:
cteBuilder
- The CTE builder from which to copy CTEs- Returns:
- This for method chaining
- Since:
- 1.3.0
-
withStartSet
StartOngoingSetOperationCTECriteriaBuilder<T,LeafOngoingFinalSetOperationCTECriteriaBuilder<T>> withStartSet(Class<?> cteClass) Creates a builder for a CTE with a nested set operation builder. Doing this is like starting a nested query that will be connected via a set operation.- Parameters:
cteClass
- The type of the CTE- Returns:
- The CTE set operation builder
-
withStartSet
StartOngoingSetOperationCTECriteriaBuilder<T,LeafOngoingFinalSetOperationCTECriteriaBuilder<T>> withStartSet(Class<?> cteClass, boolean inline) LikewithStartSet(Class)
but with the option to define whether the query should be inlined.- Parameters:
cteClass
- The type of the CTEinline
- Whether to inline the query defined by the CTE- Returns:
- The CTE set operation builder
- Since:
- 1.4.1
-
withRecursive
Creates a builder for a recursive CTE with the given CTE type.- Parameters:
cteClass
- The type of the CTE- Returns:
- The recursive CTE builder
-
withReturning
Creates a builder for a modification CTE with the given CTE type.- Parameters:
cteClass
- The type of the CTE- Returns:
- A factory to create a modification query that returns/binds attributes to the CTE.
-
hasCte
Returns whether a CTE for the given type is defined.- Parameters:
cte
- The type of the CTE to check- Returns:
- true when a CTE for the given type is defined
- Since:
- 1.4.0
-