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 Details

    • 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 CTE
      criteriaBuilder - The criteria builder to copy the query from
      Returns:
      The CTE builder
      Since:
      1.4.1
    • with

      FullSelectCTECriteriaBuilder<T> with​(Class<?> cteClass, boolean inline)
      Like with(Class) but with the option to define whether the query should be inlined.
      Parameters:
      cteClass - The type of the CTE
      inline - 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)
      Like with(Class, CriteriaBuilder) but with the option to define whether the query should be inlined.
      Parameters:
      cteClass - The type of the CTE
      criteriaBuilder - The criteria builder to copy the query from
      inline - 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

      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

      Like withStartSet(Class) but with the option to define whether the query should be inlined.
      Parameters:
      cteClass - The type of the CTE
      inline - 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