Interface SyntheticTableGroupSupport

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@SPI({USE,IMPLEMENT,SUPPLY}) @FunctionalInterface public interface SyntheticTableGroupSupport

Determines whether resolving a grouping or ordering expression requires a synthetic table root in the current SQL AST query specification.

Implementations must be immutable or thread-safe and should return a stable descriptor for all triggering expressions in one query specification. The standard SQM converter adds at most one root per query specification and rejects incompatible descriptors returned for that specification.

Since:
8.0
See Also:
  • Field Details

    • NONE

      static final SyntheticTableGroupSupport NONE
      A strategy which never requests a synthetic table root.
    • SELECT_ONE_FOR_LITERALS

      static final SyntheticTableGroupSupport SELECT_ONE_FOR_LITERALS
      The standard derived-table root used by databases which require a from clause for literal grouping and ordering expressions.
  • Method Details

    • forLiteralExpressions

      static SyntheticTableGroupSupport forLiteralExpressions(String tableExpression, @Nullable String identificationVariable)
      Create a strategy which requests the given table root whenever a resolved grouping or ordering expression is a SQL AST literal.
    • resolveSyntheticTableGroup

      @Nullable SyntheticTableGroupDescriptor resolveSyntheticTableGroup(Clause clause, @Nullable Expression expression)

      Return the synthetic table root required for the resolved expression, or null when the current query specification requires no synthetic root.

      The clause is the converter context in which the grouping or ordering expression was resolved. The expression may be null when a positional reference resolves to multiple selections; this does not require a root. Implementations may use the clause to distinguish normal grouping and ordering from ordering within a window.