Class CteSupport

java.lang.Object
org.hibernate.dialect.sql.ast.spi.CteSupport

@SPI({USE,SUPPLY}) public final class CteSupport extends Object

Immutable description of a Dialect's common-table-expression (CTE) capabilities.

Placement levels are hierarchical. Recursive and mutation refinements are validated against their prerequisites when a profile is built.

Providers supply a profile by overriding Dialect.getCteSupport(). The profile is immutable and thread-safe, has no initialization or shutdown lifecycle, and may be cached and reused by Hibernate. A Dialect may return the same instance or equivalent instances, but its capabilities must remain stable for the lifetime of the Dialect. Invalid combinations fail during construction with an IllegalArgumentException.

Since:
8.0
See Also:
  • Field Details

    • NONE

      public static final CteSupport NONE
      A profile for a database with no WITH-clause support.
    • STANDARD

      public static final CteSupport STANDARD
      The base Dialect profile: nested WITH clauses, without recursive or mutation features.
  • Method Details

    • builder

      public static CteSupport.Builder builder()
      Create a builder initialized with the base Dialect profile.
    • builder

      public static CteSupport.Builder builder(CteSupport base)
      Create a builder initialized as a copy of the given profile.
    • getPlacement

      public CteSupport.Placement getPlacement()
      The strongest supported WITH-clause placement.
    • getRecursiveFeatures

      public Set<CteSupport.RecursiveFeature> getRecursiveFeatures()
      The immutable set of recursive features.
    • supports

      public boolean supports(CteSupport.RecursiveFeature feature)
      Whether the given recursive feature is supported.
    • getMutationFeatures

      public Set<CteSupport.MutationFeature> getMutationFeatures()
      The immutable set of mutation features.
    • supports

      public boolean supports(CteSupport.MutationFeature feature)
      Whether the given mutation feature is supported.
    • supportsWithClause

      public boolean supportsWithClause()
      Whether a WITH clause is supported in any placement.
    • supportsWithClauseInSubquery

      public boolean supportsWithClauseInSubquery()
      Whether a WITH clause may be used in a subquery.
    • supportsNestedWithClause

      public boolean supportsNestedWithClause()
      Whether a WITH clause may be nested inside another CTE.
    • supportsCteHeaderColumnList

      public boolean supportsCteHeaderColumnList()
      Whether CTE column names may be declared in the CTE header.
    • requiresRecursiveKeyword

      public boolean requiresRecursiveKeyword()
      Whether recursive CTE syntax requires a recursive keyword.
    • supportsRecursiveClauseArrayAndRowEmulation

      public boolean supportsRecursiveClauseArrayAndRowEmulation()
      Whether SEARCH/CYCLE emulation may use array and row constructors.