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>,StartOngoingSetOperationSubqueryBuilder<X,Y>,SubqueryBuilder<T>,UpdateCriteriaBuilder<T>
public interface CTEBuilder<T extends CTEBuilder<T>> extends ServiceProvider
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanhasCte(Class<?> cte)Returns whether a CTE for the given type is defined.FullSelectCTECriteriaBuilder<T>with(Class<?> cteClass)Creates a builder for a CTE with the given CTE type.FullSelectCTECriteriaBuilder<T>with(Class<?> cteClass, boolean inline)Likewith(Class)but with the option to define whether the query should be inlined.FullSelectCTECriteriaBuilder<T>with(Class<?> cteClass, CriteriaBuilder<?> criteriaBuilder)Creates a builder for a CTE with the given CTE type with the given criteria builder as basis.FullSelectCTECriteriaBuilder<T>with(Class<?> cteClass, CriteriaBuilder<?> criteriaBuilder, boolean inline)Likewith(Class, CriteriaBuilder)but with the option to define whether the query should be inlined.TwithCtesFrom(CTEBuilder<?> cteBuilder)Copies the CTEs from the given CTE builder into this CTE builder.SelectRecursiveCTECriteriaBuilder<T>withRecursive(Class<?> cteClass)Creates a builder for a recursive CTE with the given CTE type.ReturningModificationCriteriaBuilderFactory<T>withReturning(Class<?> cteClass)Creates a builder for a modification CTE with the given CTE type.StartOngoingSetOperationCTECriteriaBuilder<T,LeafOngoingFinalSetOperationCTECriteriaBuilder<T>>withStartSet(Class<?> cteClass)Creates a builder for a CTE with a nested set operation builder.StartOngoingSetOperationCTECriteriaBuilder<T,LeafOngoingFinalSetOperationCTECriteriaBuilder<T>>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 Detail
-
with
FullSelectCTECriteriaBuilder<T> with(Class<?> cteClass)
Creates a builder for a CTE with the given CTE type.- Parameters:
cteClass- The type of the CTE- Returns:
- The CTE builder
-
with
FullSelectCTECriteriaBuilder<T> with(Class<?> cteClass, CriteriaBuilder<?> criteriaBuilder)
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
FullSelectCTECriteriaBuilder<T> with(Class<?> cteClass, boolean inline)
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
T withCtesFrom(CTEBuilder<?> cteBuilder)
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
SelectRecursiveCTECriteriaBuilder<T> withRecursive(Class<?> cteClass)
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
ReturningModificationCriteriaBuilderFactory<T> withReturning(Class<?> cteClass)
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
boolean hasCte(Class<?> cte)
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
-
-