Class AbstractSqlAstTranslator<T extends JdbcOperation>
- All Implemented Interfaces:
Appendable
,SqlAppender
,SqlAstTranslator<T>
,SqlAstWalker
- Direct Known Subclasses:
CockroachSqlAstTranslator
,DB2SqlAstTranslator
,HANASqlAstTranslator
,HSQLSqlAstTranslator
,MariaDBSqlAstTranslator
,MySQLSqlAstTranslator
,SpannerSqlAstTranslator
,SqlAstTranslatorWithMerge
,SqlAstTranslatorWithUpsert
,StandardSqlAstTranslator
,SybaseASESqlAstTranslator
,SybaseSqlAstTranslator
,TiDBSqlAstTranslator
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
protected static enum
protected static interface
-
Field Summary
Fields inherited from interface org.hibernate.sql.ast.spi.SqlAppender
CLOSE_PARENTHESIS, COMMA_SEPARATOR, COMMA_SEPARATOR_CHAR, NO_SEPARATOR, NULL_KEYWORD, OPEN_PARENTHESIS, PARAM_MARKER, WHITESPACE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractSqlAstTranslator
(SessionFactoryImplementor sessionFactory, Statement statement) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addAdditionalWherePredicate
(Predicate predicate) protected void
addAppliedParameterBinding
(JdbcParameter parameter, JdbcParameterBinding binding) append
(char c) append
(CharSequence csq) append
(CharSequence csq, int start, int end) protected void
appendBackslashEscapedLikeLiteral
(SqlAppender appender, String literal, boolean noBackslashEscapes) void
void
void
appendSql
(boolean value) void
appendSql
(char fragment) void
appendSql
(int value) void
appendSql
(long value) void
Add the passed fragment into the in-flight bufferprotected void
applyParameter
(ColumnValueParameter parameter) protected boolean
areAllResultsParameters
(CaseSearchedExpression caseSearchedExpression) protected boolean
areAllResultsParameters
(CaseSimpleExpression caseSimpleExpression) protected void
assertRowsOnlyFetchClauseType
(QueryPart queryPart) protected FunctionRenderer
protected Expression
castNumberToString
(Expression expression, int precision, int scale) Casts a number expression to a string with the given precision and scale.protected void
cleanup()
protected Predicate
createRowMatchingPredicate
(TableGroup dmlTargetTableGroup, String lhsAlias, String rhsAlias) protected String
determineColumnReferenceQualifier
(ColumnReference columnReference) protected String
protected Predicate
determineLateralEmulationPredicate
(TableGroup tableGroup) protected AbstractSqlAstTranslator.LockStrategy
determineLockingStrategy
(QuerySpec querySpec, AbstractSqlAstTranslator.ForUpdateClause forUpdateClause, Boolean followOnLocking) protected Predicate
protected Predicate
determineWhereClauseRestrictionWithJoinEmulation
(AbstractUpdateOrDeleteStatement statement, String dmlTargetAlias) protected void
emulateCycleClauseWithRowAndArray
(SelectClause selectClause) protected void
emulateFetchOffsetWithWindowFunctions
(QueryPart queryPart, boolean emulateFetchClause) protected void
emulateFetchOffsetWithWindowFunctions
(QueryPart queryPart, Expression offsetExpression, Expression fetchExpression, FetchClauseType fetchClauseType, boolean emulateFetchClause) protected void
protected void
emulateQuantifiedTupleSubQueryPredicate
(Predicate predicate, SelectStatement selectStatement, SqlTuple lhsTuple, ComparisonOperator tupleComparisonOperator) An optimized emulation for relational tuple sub-query comparisons.protected void
emulateQueryPartTableReferenceColumnAliasing
(QueryPartTableReference tableReference) protected void
emulateSearchClauseOrderWithRowAndArray
(SelectClause selectClause) protected void
emulateSelectTupleComparison
(List<SqlSelection> lhsSelections, List<? extends SqlAstNode> rhsExpressions, ComparisonOperator operator, boolean indexOptimized) protected void
emulateSortSpecificationNullPrecedence
(Expression sortExpression, Nulls nullPrecedence) protected <X extends Expression>
voidemulateSubQueryRelationalRestrictionPredicate
(Predicate predicate, boolean negated, SelectStatement selectStatement, X lhsTuple, AbstractSqlAstTranslator.SubQueryRelationalRestrictionEmulationRenderer<X> renderer, ComparisonOperator tupleComparisonOperator) protected void
emulateTupleComparison
(List<? extends SqlAstNode> lhsExpressions, List<? extends SqlAstNode> rhsExpressions, ComparisonOperator operator, boolean indexOptimized) A tuple comparison like(a, b) > (1, 2)
can be emulated through it logical definition:a > 1 or a = 1 and b > 2
.protected void
emulateValuesTableReferenceColumnAliasing
(ValuesTableReference tableReference) Not the best spot for this.protected Map<JdbcParameter,
JdbcParameterBinding> protected String
Returns the name of thearray_contains(array, element)
function, which is used for emulating the cycle clause.static String
getCastTypeName
(SqlTypedMapping castTarget, TypeConfiguration typeConfiguration) protected CteStatement
getCteStatement
(String cteName) protected CteStatement
Returns the current query part that is translated.protected String
getDual()
Returns a table expression that has one row.protected LockMode
getEffectiveLockMode
(String alias) protected LockMode
getEffectiveLockMode
(String alias, boolean isRoot) protected int
getEffectiveLockTimeout
(LockMode lockMode) protected FetchClauseType
getFetchClauseTypeForRowNumbering
(QueryPart queryPartForRowNumbering) protected String
getForShare
(int timeoutMillis) protected String
protected String
protected String
protected JdbcLockStrategy
protected JdbcParameterBindings
protected JdbcServices
protected Expression
getLeftHandExpression
(Predicate predicate) protected Limit
getLimit()
protected JdbcParameter
<X> X
getLiteralValue
(Expression expression) Returns the literal value of the given expression, inlining a parameter value if necessary.protected LockOptions
protected int
getMaxRows
(SelectStatement sqlAstSelect, JdbcParameterBindings jdbcParameterBindings, int rowsToSkip) protected String
protected JdbcParameter
protected Object
getParameterBindValue
(JdbcParameter parameter) protected SqlAstNodeRenderingMode
protected QueryPart
protected int
getRowsToSkip
(SelectStatement sqlAstSelect, JdbcParameterBindings jdbcParameterBindings) protected final SqlSelectionExpression
getSelectItemReference
(Expression expression) protected String
protected List<SortSpecification>
getSortSpecificationsRowNumbering
(SelectClause selectClause, QueryPart queryPart) getSql()
protected SqlAppender
static String
getSqlTypeName
(SqlTypedMapping castTarget, TypeConfiguration typeConfiguration) protected Statement
protected String
protected WrapperOptions
protected boolean
hasAggregateFunctions
(QuerySpec querySpec) protected boolean
hasLimit()
protected boolean
protected boolean
hasNestedTableGroupsToRender
(List<TableGroupJoin> nestedTableGroupJoins) protected static boolean
hasNonTrivialFromClause
(FromClause fromClause) protected boolean
protected void
inlineCteTableGroup
(TableGroup tableGroup, LockMode lockMode) protected boolean
protected <R> R
interpretExpression
(Expression expression, JdbcParameterBindings jdbcParameterBindings) protected boolean
isCorrelated
(CteStatement cteStatement) protected boolean
protected boolean
protected boolean
protected final boolean
isLiteral
(Expression expression) static final boolean
isParameter
(Expression expression) protected boolean
protected boolean
isRowsOnlyFetchClauseType
(QueryPart queryPart) protected boolean
isStruct
(JdbcMappingContainer expressionType) protected boolean
Whether CTEs should be inlined rather than rendered as CTEs.protected boolean
needsLocking
(QuerySpec querySpec) protected boolean
protected boolean
Whether the SQL with clause requires the "recursive" keyword for recursive CTEs.protected boolean
protected void
protected void
processNestedTableGroupJoins
(TableGroup source, List<TableGroupJoin> tableGroupJoinCollector) protected void
processTableGroupJoin
(TableGroupJoin tableGroupJoin, List<TableGroupJoin> tableGroupJoinCollector) protected void
processTableGroupJoins
(TableGroup source) protected void
registerAffectedTable
(String tableExpression) protected void
registerAffectedTable
(NamedTableReference tableReference) void
render
(SqlAstNode sqlAstNode, SqlAstNodeRenderingMode renderingMode) Renders the given SQL AST node with the given rendering mode.protected void
renderAsLiteral
(JdbcParameter jdbcParameter, Object literalValue) protected void
renderBackslashEscapedLikePattern
(Expression pattern, Expression escapeCharacter, boolean noBackslashEscapes) protected void
renderCaseInsensitiveLikeEmulation
(Expression lhs, Expression rhs, Expression escapeCharacter, boolean negated) protected void
renderCasted
(Expression expression) protected void
renderCombinedLimitClause
(Expression offsetExpression, Expression fetchExpression) protected void
renderCombinedLimitClause
(QueryPart queryPart) protected final void
renderCommaSeparated
(Iterable<? extends SqlAstNode> expressions) protected final void
renderCommaSeparatedSelectExpression
(Iterable<? extends SqlAstNode> expressions) protected final void
renderCommaSeparatedSelectExpression
(Iterable<? extends SqlAstNode> expressions, Iterable<String> aliases) protected void
renderComparison
(Expression lhs, ComparisonOperator operator, Expression rhs) protected void
renderComparisonDistinctOperator
(Expression lhs, ComparisonOperator operator, Expression rhs) protected void
renderComparisonEmulateCase
(Expression lhs, ComparisonOperator operator, Expression rhs) protected void
renderComparisonEmulateDecode
(Expression lhs, ComparisonOperator operator, Expression rhs) protected void
renderComparisonEmulateDecode
(Expression lhs, ComparisonOperator operator, Expression rhs, SqlAstNodeRenderingMode firstArgRenderingMode) protected void
renderComparisonEmulateIntersect
(Expression lhs, ComparisonOperator operator, Expression rhs) protected void
renderComparisonStandard
(Expression lhs, ComparisonOperator operator, Expression rhs) protected void
protected void
protected void
renderDeleteClause
(DeleteStatement statement) protected void
renderDerivedTableReference
(DerivedTableReference tableReference) protected void
protected void
renderDmlTargetTableExpression
(NamedTableReference tableReference) protected void
renderDmlTargetTableGroup
(TableGroup tableGroup) protected void
renderExpressionAsClauseItem
(Expression expression) protected void
renderExpressionAsLiteral
(Expression expression, JdbcParameterBindings jdbcParameterBindings) protected void
renderExpressionsAsSubquery
(List<? extends Expression> expressions) protected void
renderFetch
(Expression fetchExpression, Expression offsetExpressionToAdd, FetchClauseType fetchClauseType) protected void
renderFetchExpression
(Expression fetchExpression) protected void
renderFetchPlusOffsetExpression
(Expression fetchClauseExpression, Expression offsetClauseExpression, int offset) protected void
renderFetchPlusOffsetExpressionAsLiteral
(Expression fetchClauseExpression, Expression offsetClauseExpression, int offset) protected void
renderFetchPlusOffsetExpressionAsSingleParameter
(Expression fetchClauseExpression, Expression offsetClauseExpression, int offset) protected void
renderFirstClause
(Expression offsetExpression, Expression fetchExpression) protected void
renderFirstClause
(QuerySpec querySpec) protected void
renderFirstSkipClause
(Expression offsetExpression, Expression fetchExpression) protected void
renderFirstSkipClause
(QuerySpec querySpec) protected void
renderForUpdateClause
(QuerySpec querySpec, AbstractSqlAstTranslator.ForUpdateClause forUpdateClause) protected void
renderFromClauseAfterUpdateSet
(UpdateStatement statement) protected void
protected void
protected void
renderFromClauseSpaces
(FromClause fromClause) protected void
renderInsertIntoNoColumns
(TableInsertStandard tableInsert) Handle rendering an insert with no columnsprotected void
renderInterval
(Duration duration) protected void
renderIntervalLiteral
(Literal literal, TemporalUnit unit) protected void
renderIntoIntoAndTable
(TableInsertStandard tableInsert) Renders theinsert into <table name>
portion of an insertprotected void
renderLimitOffsetClause
(Expression offsetExpression, Expression fetchExpression) protected void
renderLimitOffsetClause
(QueryPart queryPart) protected void
renderLiteral
(Literal literal, boolean castParameter) protected void
renderMaterializationHint
(CteMaterialization materialization) protected void
renderMergeUpdateClause
(List<Assignment> assignments, Predicate wherePredicate) void
renderNamedSetReturningFunction
(String functionName, List<? extends SqlAstNode> sqlAstArguments, AnonymousTupleTableGroupProducer tupleType, String tableIdentifierVariable, SqlAstNodeRenderingMode argumentRenderingMode) Renders a named set returning function.protected boolean
renderNamedTableReference
(NamedTableReference tableReference, LockMode lockMode) protected void
renderNull
(Literal literal) protected void
renderOffset
(Expression offsetExpression, boolean renderOffsetRowsKeyword) protected void
renderOffsetExpression
(Expression offsetExpression) protected void
renderOffsetFetchClause
(Expression offsetExpression, Expression fetchExpression, FetchClauseType fetchClauseType, boolean renderOffsetRowsKeyword) protected void
renderOffsetFetchClause
(QueryPart queryPart, boolean renderOffsetRowsKeyword) protected void
renderOrderBy
(boolean addWhitespace, List<SortSpecification> sortSpecifications) protected void
renderParameterAsParameter
(int position, JdbcParameter jdbcParameter) Renders a parameter marker for the given positionprotected final void
renderParameterAsParameter
(JdbcParameter jdbcParameter) protected void
renderPartitionItem
(Expression expression) protected boolean
renderPrimaryTableReference
(TableGroup tableGroup, LockMode lockMode) protected void
renderQueryGroup
(QueryGroup queryGroup, boolean renderOrderByAndOffsetFetchClause) protected void
renderRecursiveCteVirtualSelections
(SelectClause selectClause) protected void
renderRootTableGroup
(TableGroup tableGroup, List<TableGroupJoin> tableGroupJoinCollector) protected void
renderRowNumber
(SelectClause selectClause, QueryPart queryPart) protected void
renderRowNumberingSelectItems
(SelectClause selectClause, QueryPart queryPart) protected void
renderRowsToClause
(Expression offsetClauseExpression, Expression fetchClauseExpression) protected void
renderRowsToClause
(QuerySpec querySpec) protected void
protected void
renderSelectExpression
(Expression expression) protected void
protected void
renderSelectSimpleComparison
(List<SqlSelection> lhsExpressions, Expression expression, ComparisonOperator operator) protected void
renderSelectTupleComparison
(List<SqlSelection> lhsExpressions, SqlTuple tuple, ComparisonOperator operator) protected void
renderSetClause
(List<Assignment> assignments) protected final void
renderSimpleNamedFunction
(String functionName, List<? extends SqlAstNode> sqlAstArguments, SqlAstNodeRenderingMode argumentRenderingMode) protected void
renderSkipFirstClause
(Expression offsetExpression, Expression fetchExpression) protected void
renderSkipFirstClause
(QuerySpec querySpec) protected void
renderSortExpression
(Expression sortExpression, boolean ignoreCase) protected void
protected void
protected void
renderStringContainsExactlyPredicate
(Expression haystack, Expression needle) protected void
renderTableGroup
(TableGroup tableGroup, Predicate predicate, List<TableGroupJoin> tableGroupJoinCollector) protected void
renderTableGroupJoin
(TableGroupJoin tableGroupJoin, List<TableGroupJoin> tableGroupJoinCollector) protected void
renderTableReferenceIdentificationVariable
(TableReference tableReference) protected void
renderTableReferenceJoins
(TableGroup tableGroup) protected void
renderTableReferenceJoins
(TableGroup tableGroup, int swappedJoinIndex, boolean forceLeftJoin) protected void
renderTopClause
(Expression offsetExpression, Expression fetchExpression, FetchClauseType fetchClauseType, boolean addOffset, boolean needsParenthesis) protected void
renderTopClause
(QuerySpec querySpec, boolean addOffset, boolean needsParenthesis) protected void
renderTopStartAtClause
(Expression offsetExpression, Expression fetchExpression, FetchClauseType fetchClauseType) protected void
renderTopStartAtClause
(QuerySpec querySpec) protected void
renderTupleComparisonStandard
(List<SqlSelection> lhsExpressions, SqlTuple tuple, ComparisonOperator operator) protected void
renderUpdateClause
(UpdateStatement updateStatement) protected void
renderVirtualSelections
(SelectClause selectClause) protected void
renderWrappedParameter
(JdbcParameter jdbcParameter) protected Expression
resolveAliasedExpression
(List<SqlSelection> sqlSelections, Expression expression) protected Expression
resolveAliasedExpression
(Expression expression) protected Expression
resolveExpressionToAlias
(Expression expression) protected void
setLimitParameter
(JdbcParameter limitParameter) protected void
setOffsetParameter
(JdbcParameter offsetParameter) protected boolean
shouldEmulateLateralWithIntersect
(QueryPart queryPart) protected boolean
shouldInlineCte
(TableGroup tableGroup) Whether CTEs should be inlined rather than rendered as CTEs.protected void
simpleColumnWriteFragmentRendering
(ColumnWriteFragment columnWriteFragment) protected boolean
Whether the SQL array constructor is supported.protected boolean
Is this SQL dialect known to support some kind of distinct from predicate.protected boolean
boolean
Whether the FILTER clause for aggregate functions is supported.protected boolean
protected boolean
If the dialect supports using joins in mutation statement subquery that could also use columns from the mutation target tableprotected boolean
protected boolean
protected boolean
Whether the SQL with clause is supported within a CTE.protected boolean
protected boolean
Is this dialect known to support quantified predicates.protected boolean
Whether the recursive search and cycle clause emulations based on the array and row constructor is supported.protected boolean
Whether the SQL cycle clause is supported, which can be used for recursive CTEs.protected boolean
Whether the SQL cycle clause supports the using sub-clause.protected boolean
Whether the SQL search clause is supported, which can be used for recursive CTEs.protected boolean
Whether the SQL row constructor is supported.protected boolean
Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax; sometimes called tuple syntax withis distinct from
andis not distinct from
operators.protected boolean
Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax; sometimes called tuple syntax with<
,>
,≤
and≥
operators.protected boolean
Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax; sometimes called tuple syntax.protected boolean
If the dialect supportsrow values
, does it offer such support in IN lists as well?protected boolean
If the dialect supportsrow values
, does it offer such support in IN subqueries as well?protected boolean
Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax; sometimes called tuple syntax with quantified predicates.protected boolean
Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax, sometimes called tuple syntax, in the SET clause;protected boolean
protected boolean
Whether the SQL with clause is supported.protected boolean
Whether the SQL with clause is supported within a subquery.translate
(JdbcParameterBindings jdbcParameterBindings, QueryOptions queryOptions) protected JdbcOperationQueryDelete
translateDelete
(DeleteStatement sqlAst) protected JdbcOperationQueryInsert
translateInsert
(InsertSelectStatement sqlAst) protected JdbcOperationQuerySelect
translateSelect
(SelectStatement selectStatement) protected JdbcOperationQueryUpdate
translateUpdate
(UpdateStatement sqlAst) protected boolean
useOffsetFetchClause
(QueryPart queryPart) void
visitAggregateColumnWriteExpression
(AggregateColumnWriteExpression aggregateColumnWriteExpression) protected void
visitAnsiCaseSearchedExpression
(CaseSearchedExpression caseSearchedExpression, Consumer<Expression> resultRenderer) protected void
visitAnsiCaseSimpleExpression
(CaseSimpleExpression caseSimpleExpression, Consumer<Expression> resultRenderer) void
protected void
visitArithmeticOperand
(Expression expression) void
visitAssignment
(Assignment assignment) void
visitBetweenPredicate
(BetweenPredicate betweenPredicate) void
visitBinaryArithmeticExpression
(BinaryArithmeticExpression arithmeticExpression) void
visitBooleanExpressionPredicate
(BooleanExpressionPredicate booleanExpressionPredicate) final void
visitCaseSearchedExpression
(CaseSearchedExpression caseSearchedExpression) protected void
visitCaseSearchedExpression
(CaseSearchedExpression caseSearchedExpression, boolean inSelect) final void
visitCaseSimpleExpression
(CaseSimpleExpression caseSimpleExpression) protected void
visitCaseSimpleExpression
(CaseSimpleExpression caseSimpleExpression, boolean inSelect) void
visitCastTarget
(CastTarget castTarget) void
visitCollation
(Collation collation) void
visitColumnReference
(ColumnReference columnReference) void
visitColumnWriteFragment
(ColumnWriteFragment columnWriteFragment) protected void
visitConflictClause
(ConflictClause conflictClause) void
visitConversion
(Conversion conversion) void
visitCteContainer
(CteContainer cteContainer) protected void
protected void
visitCteObject
(CteObject cteObject) void
visitCustomTableDelete
(TableDeleteCustomSql tableDelete) void
visitCustomTableInsert
(TableInsertCustomSql tableInsert) void
visitCustomTableUpdate
(TableUpdateCustomSql tableUpdate) protected void
visitDecodeCaseSearchedExpression
(CaseSearchedExpression caseSearchedExpression) void
visitDeleteStatement
(DeleteStatement statement) protected void
visitDeleteStatementOnly
(DeleteStatement statement) void
visitDistinct
(Distinct distinct) void
visitDuration
(Duration duration) void
void
visitEmbeddableTypeLiteral
(EmbeddableTypeLiteral expression) void
visitEntityTypeLiteral
(EntityTypeLiteral expression) void
visitEvery
(Every every) void
visitExistsPredicate
(ExistsPredicate existsPredicate) void
visitExtractUnit
(ExtractUnit extractUnit) void
void
visitFilterPredicate
(FilterPredicate filterPredicate) void
visitFormat
(Format format) protected void
visitForUpdateClause
(QuerySpec querySpec) void
visitFromClause
(FromClause fromClause) void
visitFunctionTableReference
(FunctionTableReference tableReference) protected final void
visitGroupByClause
(QuerySpec querySpec, SelectItemReferenceStrategy referenceStrategy) void
visitGroupedPredicate
(GroupedPredicate groupedPredicate) protected final void
visitHavingClause
(QuerySpec querySpec) void
visitInArrayPredicate
(InArrayPredicate inArrayPredicate) void
visitInListPredicate
(InListPredicate inListPredicate) protected void
visitInsertSource
(InsertSelectStatement statement) void
visitInsertStatement
(InsertSelectStatement statement) protected void
protected void
visitInsertStatementOnly
(InsertSelectStatement statement) void
visitInSubQueryPredicate
(InSubQueryPredicate inSubQueryPredicate) void
visitJdbcLiteral
(JdbcLiteral<?> jdbcLiteral) void
visitJunction
(Junction junction) void
visitLikePredicate
(LikePredicate likePredicate) void
void
visitNamedTableReference
(NamedTableReference tableReference) void
visitNegatedPredicate
(NegatedPredicate negatedPredicate) void
visitNestedColumnReference
(NestedColumnReference nestedColumnReference) void
visitNullnessPredicate
(NullnessPredicate nullnessPredicate) void
visitOffsetFetchClause
(QueryPart queryPart) protected void
visitOnDuplicateKeyConflictClause
(ConflictClause conflictClause) void
visitOptionalTableUpdate
(OptionalTableUpdate tableUpdate) protected void
visitOrderBy
(List<SortSpecification> sortSpecifications) void
protected final void
visitOverClause
(List<Expression> partitionExpressions, List<SortSpecification> sortSpecifications) protected void
visitOverClause
(List<Expression> partitionExpressions, List<SortSpecification> sortSpecifications, FrameMode mode, FrameKind startKind, Expression startExpression, FrameKind endKind, Expression endExpression, FrameExclusion exclusion, boolean orderedSetAggregate) void
visitOverflow
(Overflow overflow) void
visitParameter
(JdbcParameter jdbcParameter) protected void
visitParameterAsParameter
(JdbcParameter jdbcParameter) protected final void
visitPartitionByClause
(List<Expression> partitionExpressions) protected final void
visitPartitionExpressions
(List<Expression> partitionExpressions, Function<Expression, Expression> resolveAliasExpression, boolean inlineParametersOfAliasedExpressions) protected final void
visitPartitionExpressions
(List<Expression> partitionExpressions, SelectItemReferenceStrategy referenceStrategy) void
visitQueryGroup
(QueryGroup queryGroup) void
visitQueryLiteral
(QueryLiteral<?> queryLiteral) void
visitQueryPartTableReference
(QueryPartTableReference tableReference) void
visitQuerySpec
(QuerySpec querySpec) protected void
visitRecursivePath
(Expression recursivePath, int sizeEstimate) Renders the recursive path, possibly wrapping a cast expression around it, to make sure a type with proper size is chosen.void
visitRelationalPredicate
(ComparisonPredicate comparisonPredicate) protected void
visitReturningColumns
(Supplier<List<ColumnReference>> returningColumnsAccess) protected void
visitReturningColumns
(List<ColumnReference> returningColumns) void
visitSelectClause
(SelectClause selectClause) void
visitSelectStatement
(SelectStatement statement) void
visitSelfRenderingExpression
(SelfRenderingExpression expression) void
visitSelfRenderingPredicate
(SelfRenderingPredicate selfRenderingPredicate) protected void
visitSetAssignment
(Assignment assignment) protected void
visitSetAssignmentEmulateJoin
(Assignment assignment, UpdateStatement statement) protected void
visitSortSpecification
(Expression sortExpression, SortDirection sortOrder, Nulls nullPrecedence, boolean ignoreCase) void
visitSortSpecification
(SortSpecification sortSpecification) void
visitSqlFragmentPredicate
(SqlFragmentPredicate predicate) protected void
visitSqlSelectExpression
(Expression expression) void
visitSqlSelection
(SqlSelection sqlSelection) void
visitSqlSelectionExpression
(SqlSelectionExpression expression) protected void
visitSqlSelections
(SelectClause selectClause) protected void
visitStandardConflictClause
(ConflictClause conflictClause) void
visitStandardTableDelete
(TableDeleteStandard tableDelete) void
visitStandardTableInsert
(TableInsertStandard tableInsert) void
visitStandardTableUpdate
(TableUpdateStandard tableUpdate) void
void
visitSummarization
(Summarization every) void
visitTableGroup
(TableGroup tableGroup) void
visitTableGroupJoin
(TableGroupJoin tableGroupJoin) void
visitTableReferenceJoin
(TableReferenceJoin tableReferenceJoin) void
visitThruthnessPredicate
(ThruthnessPredicate thruthnessPredicate) void
visitTrimSpecification
(TrimSpecification trimSpecification) void
visitTuple
(SqlTuple tuple) void
visitUnaryOperationExpression
(UnaryOperation unaryOperationExpression) <N extends Number>
voidvisitUnparsedNumericLiteral
(UnparsedNumericLiteral<N> literal) void
visitUpdateStatement
(UpdateStatement statement) protected void
protected void
visitUpdateStatementEmulateMerge
(UpdateStatement statement) protected void
protected void
visitUpdateStatementOnly
(UpdateStatement statement) protected void
visitValuesList
(List<Values> valuesList) protected void
visitValuesListEmulateSelectUnion
(List<Values> valuesList) protected final void
visitValuesListStandard
(List<Values> valuesList) void
visitValuesTableReference
(ValuesTableReference tableReference) protected final void
visitWhereClause
(Predicate whereClauseRestrictions) protected void
withParameterRenderingMode
(SqlAstNodeRenderingMode renderingMode, Runnable runnable) protected final void
withRowNumbering
(QueryPart queryPart, boolean needsSelectAliases, Runnable r)
-
Constructor Details
-
AbstractSqlAstTranslator
-
-
Method Details
-
getDialect
-
getSessionFactory
- Specified by:
getSessionFactory
in interfaceSqlAstTranslator<T extends JdbcOperation>
-
castFunction
-
getWrapperOptions
-
getIntegerType
-
getStringType
-
getBooleanType
-
getSql
-
getSqlBuffer
-
cleanup
protected void cleanup() -
getParameterBinders
-
getSqlAppender
-
getAffectedTableNames
Description copied from interface:SqlAstTranslator
Not the best spot for this. Returns the table names collected while walking the SQL AST. It's ok here because the translator is consider a one-time-use. It just needs to be called after translation. A better option is probably to have "translation" objects that expose the affected table-names.- Specified by:
getAffectedTableNames
in interfaceSqlAstTranslator<T extends JdbcOperation>
-
getStatement
-
getCurrentDmlStatement
-
getParameterRenderingMode
-
addAdditionalWherePredicate
-
supportsFilterClause
public boolean supportsFilterClause()Description copied from interface:SqlAstTranslator
Whether the FILTER clause for aggregate functions is supported.- Specified by:
supportsFilterClause
in interfaceSqlAstTranslator<T extends JdbcOperation>
-
appendSql
Description copied from interface:SqlAppender
Add the passed fragment into the in-flight buffer- Specified by:
appendSql
in interfaceSqlAppender
-
appendSql
public void appendSql(char fragment) - Specified by:
appendSql
in interfaceSqlAppender
-
appendSql
public void appendSql(int value) - Specified by:
appendSql
in interfaceSqlAppender
-
appendSql
public void appendSql(long value) - Specified by:
appendSql
in interfaceSqlAppender
-
appendSql
public void appendSql(boolean value) - Specified by:
appendSql
in interfaceSqlAppender
-
appendDoubleQuoteEscapedString
- Specified by:
appendDoubleQuoteEscapedString
in interfaceSqlAppender
-
appendSingleQuoteEscapedString
- Specified by:
appendSingleQuoteEscapedString
in interfaceSqlAppender
-
append
- Specified by:
append
in interfaceAppendable
- Specified by:
append
in interfaceSqlAppender
-
append
- Specified by:
append
in interfaceAppendable
- Specified by:
append
in interfaceSqlAppender
-
append
- Specified by:
append
in interfaceAppendable
- Specified by:
append
in interfaceSqlAppender
-
getJdbcServices
-
addAppliedParameterBinding
-
getAppliedParameterBindings
-
getJdbcLockStrategy
-
getJdbcParameterBindings
-
getLockOptions
-
getLimit
-
hasLimit
protected boolean hasLimit() -
hasLimit
-
hasOffset
-
useOffsetFetchClause
-
isRowsOnlyFetchClauseType
-
getOffsetParameter
-
setOffsetParameter
-
getLimitParameter
-
setLimitParameter
-
getLiteralValue
Description copied from interface:SqlAstTranslator
Returns the literal value of the given expression, inlining a parameter value if necessary.- Specified by:
getLiteralValue
in interfaceSqlAstTranslator<T extends JdbcOperation>
-
interpretExpression
protected <R> R interpretExpression(Expression expression, JdbcParameterBindings jdbcParameterBindings) -
renderExpressionAsLiteral
protected void renderExpressionAsLiteral(Expression expression, JdbcParameterBindings jdbcParameterBindings) -
getParameterBindValue
-
getLeftHandExpression
-
inOverOrWithinGroupClause
protected boolean inOverOrWithinGroupClause() -
getClauseStack
-
getStatementStack
-
getQueryPartStack
-
getCurrentQueryPart
Description copied from interface:SqlAstTranslator
Returns the current query part that is translated.- Specified by:
getCurrentQueryPart
in interfaceSqlAstTranslator<T extends JdbcOperation>
-
getCurrentClauseStack
- Specified by:
getCurrentClauseStack
in interfaceSqlAstTranslator<T extends JdbcOperation>
-
getCurrentCteStatement
-
getCteStatement
-
translate
- Specified by:
translate
in interfaceSqlAstTranslator<T extends JdbcOperation>
-
translateDelete
-
translateUpdate
-
translateInsert
-
getUniqueConstraintNameThatMayFail
-
translateSelect
-
getRowsToSkip
protected int getRowsToSkip(SelectStatement sqlAstSelect, JdbcParameterBindings jdbcParameterBindings) -
getMaxRows
protected int getMaxRows(SelectStatement sqlAstSelect, JdbcParameterBindings jdbcParameterBindings, int rowsToSkip) -
needsRowsToSkip
protected boolean needsRowsToSkip() -
needsMaxRows
protected boolean needsMaxRows() -
prepareLimitOffsetParameters
protected void prepareLimitOffsetParameters() -
visitSelectStatement
- Specified by:
visitSelectStatement
in interfaceSqlAstWalker
-
visitDeleteStatement
- Specified by:
visitDeleteStatement
in interfaceSqlAstWalker
-
visitUpdateStatement
- Specified by:
visitUpdateStatement
in interfaceSqlAstWalker
-
visitAssignment
- Specified by:
visitAssignment
in interfaceSqlAstWalker
-
visitInsertStatement
- Specified by:
visitInsertStatement
in interfaceSqlAstWalker
-
visitDeleteStatementOnly
-
supportsJoinsInDelete
protected boolean supportsJoinsInDelete() -
renderDeleteClause
-
visitUpdateStatementOnly
-
renderUpdateClause
-
renderDmlTargetTableExpression
-
hasNonTrivialFromClause
-
determineWhereClauseRestrictionWithJoinEmulation
protected Predicate determineWhereClauseRestrictionWithJoinEmulation(AbstractUpdateOrDeleteStatement statement) -
determineWhereClauseRestrictionWithJoinEmulation
protected Predicate determineWhereClauseRestrictionWithJoinEmulation(AbstractUpdateOrDeleteStatement statement, String dmlTargetAlias) -
renderSetClause
-
visitSetAssignment
-
visitSetAssignmentEmulateJoin
-
isStruct
-
visitInsertStatementOnly
-
isIntegerDivisionEmulationRequired
-
visitInsertSource
-
visitInsertStatementEmulateMerge
-
visitUpdateStatementEmulateMerge
-
visitUpdateStatementEmulateInlineView
-
visitUpdateStatementEmulateTupleSet
-
renderMergeUpdateClause
-
visitValuesList
-
visitValuesListStandard
-
visitValuesListEmulateSelectUnion
-
visitForUpdateClause
-
renderForUpdateClause
protected void renderForUpdateClause(QuerySpec querySpec, AbstractSqlAstTranslator.ForUpdateClause forUpdateClause) -
getForUpdate
-
getForUpdateWithClause
-
getNoWait
-
getSkipLocked
-
getEffectiveLockMode
-
getEffectiveLockMode
-
getEffectiveLockTimeout
-
hasAggregateFunctions
-
determineLockingStrategy
protected AbstractSqlAstTranslator.LockStrategy determineLockingStrategy(QuerySpec querySpec, AbstractSqlAstTranslator.ForUpdateClause forUpdateClause, Boolean followOnLocking) -
visitConflictClause
-
visitStandardConflictClause
-
visitOnDuplicateKeyConflictClause
-
visitReturningColumns
-
visitReturningColumns
-
visitCteContainer
-
visitCteObject
-
renderCteColumns
-
determineCyclePathColumnName
-
isInRecursiveQueryPart
protected boolean isInRecursiveQueryPart() -
isInSubquery
protected boolean isInSubquery() -
visitCteDefinition
-
supportsWithClause
protected boolean supportsWithClause()Whether the SQL with clause is supported. -
supportsNestedWithClause
protected boolean supportsNestedWithClause()Whether the SQL with clause is supported within a CTE. -
supportsWithClauseInSubquery
protected boolean supportsWithClauseInSubquery()Whether the SQL with clause is supported within a subquery. -
needsCteInlining
protected boolean needsCteInlining()Whether CTEs should be inlined rather than rendered as CTEs. -
shouldInlineCte
Whether CTEs should be inlined rather than rendered as CTEs. -
needsRecursiveKeywordInWithClause
protected boolean needsRecursiveKeywordInWithClause()Whether the SQL with clause requires the "recursive" keyword for recursive CTEs. -
supportsRecursiveSearchClause
protected boolean supportsRecursiveSearchClause()Whether the SQL search clause is supported, which can be used for recursive CTEs. -
supportsRecursiveCycleClause
protected boolean supportsRecursiveCycleClause()Whether the SQL cycle clause is supported, which can be used for recursive CTEs. -
supportsRecursiveCycleUsingClause
protected boolean supportsRecursiveCycleUsingClause()Whether the SQL cycle clause supports the using sub-clause. -
supportsRecursiveClauseArrayAndRowEmulation
protected boolean supportsRecursiveClauseArrayAndRowEmulation()Whether the recursive search and cycle clause emulations based on the array and row constructor is supported. -
supportsRowConstructor
protected boolean supportsRowConstructor()Whether the SQL row constructor is supported. -
supportsArrayConstructor
protected boolean supportsArrayConstructor()Whether the SQL array constructor is supported. -
renderMaterializationHint
-
renderSearchClause
-
renderStandardSearchClause
-
renderCycleClause
-
renderStandardCycleClause
-
renderRecursiveCteVirtualSelections
-
emulateSearchClauseOrderWithRowAndArray
-
visitRecursivePath
Renders the recursive path, possibly wrapping a cast expression around it, to make sure a type with proper size is chosen. -
emulateCycleClauseWithRowAndArray
-
getArrayContainsFunction
Returns the name of thearray_contains(array, element)
function, which is used for emulating the cycle clause. -
renderStringContainsExactlyPredicate
-
castNumberToString
Casts a number expression to a string with the given precision and scale. -
visitQueryGroup
- Specified by:
visitQueryGroup
in interfaceSqlAstWalker
-
renderQueryGroup
-
visitQuerySpec
- Specified by:
visitQuerySpec
in interfaceSqlAstWalker
-
supportsSimpleQueryGrouping
protected boolean supportsSimpleQueryGrouping() -
supportsDuplicateSelectItemsInQueryGroup
protected boolean supportsDuplicateSelectItemsInQueryGroup() -
visitWhereClause
-
resolveAliasedExpression
-
resolveAliasedExpression
protected Expression resolveAliasedExpression(List<SqlSelection> sqlSelections, Expression expression) -
resolveExpressionToAlias
-
visitGroupByClause
protected final void visitGroupByClause(QuerySpec querySpec, SelectItemReferenceStrategy referenceStrategy) -
visitPartitionByClause
-
visitPartitionExpressions
protected final void visitPartitionExpressions(List<Expression> partitionExpressions, SelectItemReferenceStrategy referenceStrategy) -
visitPartitionExpressions
protected final void visitPartitionExpressions(List<Expression> partitionExpressions, Function<Expression, Expression> resolveAliasExpression, boolean inlineParametersOfAliasedExpressions) -
renderPartitionItem
-
visitHavingClause
-
visitOrderBy
-
renderOrderBy
-
emulateSelectTupleComparison
protected void emulateSelectTupleComparison(List<SqlSelection> lhsSelections, List<? extends SqlAstNode> rhsExpressions, ComparisonOperator operator, boolean indexOptimized) -
emulateTupleComparison
protected void emulateTupleComparison(List<? extends SqlAstNode> lhsExpressions, List<? extends SqlAstNode> rhsExpressions, ComparisonOperator operator, boolean indexOptimized) A tuple comparison like(a, b) > (1, 2)
can be emulated through it logical definition:a > 1 or a = 1 and b > 2
. The normal tuple comparison emulation is not very index friendly though because of the top level OR predicate. Index optimized emulation of tuple comparisons puts an AND predicate on the top level. The effect of that is, that the database can do an index seek to efficiently find a superset of matching rows. Generally, it is sufficient to just add a broader predicate like for(a, b) > (1, 2)
we adda >= 1 and (..)
. But we can further optimize this if we just remove the non-matching parts from this too broad predicate. For(a, b, c) > (1, 2, 3)
we use the broad predicatea >= 1
and then want to remove rows wherea = 1 and (b, c) <= (2, 3)
-
supportsIntersect
protected boolean supportsIntersect() -
supportsNestedSubqueryCorrelation
protected boolean supportsNestedSubqueryCorrelation() -
renderExpressionsAsSubquery
-
renderSelectSimpleComparison
protected void renderSelectSimpleComparison(List<SqlSelection> lhsExpressions, Expression expression, ComparisonOperator operator) -
renderSelectTupleComparison
protected void renderSelectTupleComparison(List<SqlSelection> lhsExpressions, SqlTuple tuple, ComparisonOperator operator) -
renderTupleComparisonStandard
protected void renderTupleComparisonStandard(List<SqlSelection> lhsExpressions, SqlTuple tuple, ComparisonOperator operator) -
renderComparison
-
renderComparisonStandard
protected void renderComparisonStandard(Expression lhs, ComparisonOperator operator, Expression rhs) -
renderComparisonDistinctOperator
protected void renderComparisonDistinctOperator(Expression lhs, ComparisonOperator operator, Expression rhs) -
renderComparisonEmulateDecode
protected void renderComparisonEmulateDecode(Expression lhs, ComparisonOperator operator, Expression rhs) -
renderComparisonEmulateDecode
protected void renderComparisonEmulateDecode(Expression lhs, ComparisonOperator operator, Expression rhs, SqlAstNodeRenderingMode firstArgRenderingMode) -
renderComparisonEmulateCase
protected void renderComparisonEmulateCase(Expression lhs, ComparisonOperator operator, Expression rhs) -
renderComparisonEmulateIntersect
protected void renderComparisonEmulateIntersect(Expression lhs, ComparisonOperator operator, Expression rhs) -
visitSortSpecification
- Specified by:
visitSortSpecification
in interfaceSqlAstWalker
-
visitSortSpecification
protected void visitSortSpecification(Expression sortExpression, SortDirection sortOrder, Nulls nullPrecedence, boolean ignoreCase) -
renderSortExpression
-
supportsNullPrecedence
protected boolean supportsNullPrecedence() -
emulateSortSpecificationNullPrecedence
protected void emulateSortSpecificationNullPrecedence(Expression sortExpression, Nulls nullPrecedence) -
visitOffsetFetchClause
- Specified by:
visitOffsetFetchClause
in interfaceSqlAstWalker
-
renderOffsetFetchClause
-
renderOffsetFetchClause
protected void renderOffsetFetchClause(Expression offsetExpression, Expression fetchExpression, FetchClauseType fetchClauseType, boolean renderOffsetRowsKeyword) -
renderOffset
-
renderFetch
protected void renderFetch(Expression fetchExpression, Expression offsetExpressionToAdd, FetchClauseType fetchClauseType) -
renderOffsetExpression
-
renderFetchExpression
-
renderTopClause
-
renderTopClause
protected void renderTopClause(Expression offsetExpression, Expression fetchExpression, FetchClauseType fetchClauseType, boolean addOffset, boolean needsParenthesis) -
renderTopStartAtClause
-
renderTopStartAtClause
protected void renderTopStartAtClause(Expression offsetExpression, Expression fetchExpression, FetchClauseType fetchClauseType) -
renderRowsToClause
-
renderRowsToClause
protected void renderRowsToClause(Expression offsetClauseExpression, Expression fetchClauseExpression) -
renderFetchPlusOffsetExpression
protected void renderFetchPlusOffsetExpression(Expression fetchClauseExpression, Expression offsetClauseExpression, int offset) -
renderFetchPlusOffsetExpressionAsLiteral
protected void renderFetchPlusOffsetExpressionAsLiteral(Expression fetchClauseExpression, Expression offsetClauseExpression, int offset) -
renderFetchPlusOffsetExpressionAsSingleParameter
protected void renderFetchPlusOffsetExpressionAsSingleParameter(Expression fetchClauseExpression, Expression offsetClauseExpression, int offset) -
renderFirstSkipClause
-
renderFirstSkipClause
-
renderSkipFirstClause
-
renderSkipFirstClause
-
renderFirstClause
-
renderFirstClause
-
renderCombinedLimitClause
-
renderCombinedLimitClause
-
renderLimitOffsetClause
-
renderLimitOffsetClause
-
assertRowsOnlyFetchClauseType
-
getQueryPartForRowNumbering
-
isRowNumberingCurrentQueryPart
protected boolean isRowNumberingCurrentQueryPart() -
emulateFetchOffsetWithWindowFunctions
protected void emulateFetchOffsetWithWindowFunctions(QueryPart queryPart, boolean emulateFetchClause) -
emulateFetchOffsetWithWindowFunctions
protected void emulateFetchOffsetWithWindowFunctions(QueryPart queryPart, Expression offsetExpression, Expression fetchExpression, FetchClauseType fetchClauseType, boolean emulateFetchClause) -
emulateFetchOffsetWithWindowFunctionsVisitQueryPart
-
withRowNumbering
-
visitSelectClause
- Specified by:
visitSelectClause
in interfaceSqlAstWalker
-
visitSqlSelections
-
renderVirtualSelections
-
getSelectItemReference
-
renderRowNumberingSelectItems
-
getFetchClauseTypeForRowNumbering
-
visitOver
- Specified by:
visitOver
in interfaceSqlAstWalker
-
visitOverClause
protected final void visitOverClause(List<Expression> partitionExpressions, List<SortSpecification> sortSpecifications) -
visitOverClause
protected void visitOverClause(List<Expression> partitionExpressions, List<SortSpecification> sortSpecifications, FrameMode mode, FrameKind startKind, Expression startExpression, FrameKind endKind, Expression endExpression, FrameExclusion exclusion, boolean orderedSetAggregate) -
renderRowNumber
-
isParameter
-
isLiteral
-
getSortSpecificationsRowNumbering
protected List<SortSpecification> getSortSpecificationsRowNumbering(SelectClause selectClause, QueryPart queryPart) -
visitSqlSelection
- Specified by:
visitSqlSelection
in interfaceSqlAstWalker
-
visitSqlSelectExpression
-
renderSelectExpression
-
renderExpressionAsClauseItem
-
renderSelectExpressionWithCastedOrInlinedPlainParameters
-
renderCasted
-
renderLiteral
-
visitFromClause
- Specified by:
visitFromClause
in interfaceSqlAstWalker
-
renderFromClauseSpaces
-
renderFromClauseAfterUpdateSet
-
renderFromClauseExcludingDmlTargetReference
-
renderFromClauseJoiningDmlTargetReference
-
createRowMatchingPredicate
protected Predicate createRowMatchingPredicate(TableGroup dmlTargetTableGroup, String lhsAlias, String rhsAlias) -
renderDmlTargetTableGroup
-
renderRootTableGroup
protected void renderRootTableGroup(TableGroup tableGroup, List<TableGroupJoin> tableGroupJoinCollector) -
renderTableGroup
protected void renderTableGroup(TableGroup tableGroup, Predicate predicate, List<TableGroupJoin> tableGroupJoinCollector) -
needsLocking
-
hasNestedTableGroupsToRender
-
renderPrimaryTableReference
-
renderDerivedTableReference
-
inlineCteTableGroup
-
renderNamedTableReference
-
visitValuesTableReference
- Specified by:
visitValuesTableReference
in interfaceSqlAstWalker
-
visitQueryPartTableReference
- Specified by:
visitQueryPartTableReference
in interfaceSqlAstWalker
-
visitFunctionTableReference
- Specified by:
visitFunctionTableReference
in interfaceSqlAstWalker
-
renderNamedSetReturningFunction
public void renderNamedSetReturningFunction(String functionName, List<? extends SqlAstNode> sqlAstArguments, AnonymousTupleTableGroupProducer tupleType, String tableIdentifierVariable, SqlAstNodeRenderingMode argumentRenderingMode) Description copied from interface:SqlAstTranslator
Renders a named set returning function.- Specified by:
renderNamedSetReturningFunction
in interfaceSqlAstTranslator<T extends JdbcOperation>
-
renderSimpleNamedFunction
protected final void renderSimpleNamedFunction(String functionName, List<? extends SqlAstNode> sqlAstArguments, SqlAstNodeRenderingMode argumentRenderingMode) -
emulateQueryPartTableReferenceColumnAliasing
-
emulateValuesTableReferenceColumnAliasing
-
renderDerivedTableReferenceIdentificationVariable
protected void renderDerivedTableReferenceIdentificationVariable(DerivedTableReference tableReference) -
renderTableReferenceIdentificationVariable
-
registerAffectedTable
-
registerAffectedTable
-
renderTableReferenceJoins
-
renderTableReferenceJoins
protected void renderTableReferenceJoins(TableGroup tableGroup, int swappedJoinIndex, boolean forceLeftJoin) -
processTableGroupJoins
-
processNestedTableGroupJoins
protected void processNestedTableGroupJoins(TableGroup source, List<TableGroupJoin> tableGroupJoinCollector) -
processTableGroupJoin
protected void processTableGroupJoin(TableGroupJoin tableGroupJoin, List<TableGroupJoin> tableGroupJoinCollector) -
renderTableGroupJoin
protected void renderTableGroupJoin(TableGroupJoin tableGroupJoin, List<TableGroupJoin> tableGroupJoinCollector) -
determineLateralEmulationPredicate
-
shouldEmulateLateralWithIntersect
-
visitTableGroup
- Specified by:
visitTableGroup
in interfaceSqlAstWalker
-
visitTableGroupJoin
- Specified by:
visitTableGroupJoin
in interfaceSqlAstWalker
-
visitNamedTableReference
- Specified by:
visitNamedTableReference
in interfaceSqlAstWalker
-
visitTableReferenceJoin
- Specified by:
visitTableReferenceJoin
in interfaceSqlAstWalker
-
visitColumnReference
- Specified by:
visitColumnReference
in interfaceSqlAstWalker
-
visitNestedColumnReference
- Specified by:
visitNestedColumnReference
in interfaceSqlAstWalker
-
visitAggregateColumnWriteExpression
public void visitAggregateColumnWriteExpression(AggregateColumnWriteExpression aggregateColumnWriteExpression) - Specified by:
visitAggregateColumnWriteExpression
in interfaceSqlAstWalker
-
determineColumnReferenceQualifier
-
visitExtractUnit
- Specified by:
visitExtractUnit
in interfaceSqlAstWalker
-
visitDurationUnit
- Specified by:
visitDurationUnit
in interfaceSqlAstWalker
-
visitFormat
- Specified by:
visitFormat
in interfaceSqlAstWalker
-
visitStar
- Specified by:
visitStar
in interfaceSqlAstWalker
-
visitTrimSpecification
- Specified by:
visitTrimSpecification
in interfaceSqlAstWalker
-
visitCastTarget
- Specified by:
visitCastTarget
in interfaceSqlAstWalker
-
getSqlTypeName
public static String getSqlTypeName(SqlTypedMapping castTarget, TypeConfiguration typeConfiguration) -
getCastTypeName
public static String getCastTypeName(SqlTypedMapping castTarget, TypeConfiguration typeConfiguration) -
visitDistinct
- Specified by:
visitDistinct
in interfaceSqlAstWalker
-
visitOverflow
- Specified by:
visitOverflow
in interfaceSqlAstWalker
-
visitParameter
- Specified by:
visitParameter
in interfaceSqlAstWalker
-
visitParameterAsParameter
-
renderParameterAsParameter
-
renderWrappedParameter
-
renderParameterAsParameter
Renders a parameter marker for the given position -
render
Description copied from interface:SqlAstTranslator
Renders the given SQL AST node with the given rendering mode.- Specified by:
render
in interfaceSqlAstTranslator<T extends JdbcOperation>
-
withParameterRenderingMode
-
visitTuple
- Specified by:
visitTuple
in interfaceSqlAstWalker
-
renderCommaSeparated
-
renderCommaSeparatedSelectExpression
protected final void renderCommaSeparatedSelectExpression(Iterable<? extends SqlAstNode> expressions) -
renderCommaSeparatedSelectExpression
protected final void renderCommaSeparatedSelectExpression(Iterable<? extends SqlAstNode> expressions, Iterable<String> aliases) -
visitCollation
- Specified by:
visitCollation
in interfaceSqlAstWalker
-
visitSqlSelectionExpression
- Specified by:
visitSqlSelectionExpression
in interfaceSqlAstWalker
-
visitEntityTypeLiteral
- Specified by:
visitEntityTypeLiteral
in interfaceSqlAstWalker
-
visitEmbeddableTypeLiteral
- Specified by:
visitEmbeddableTypeLiteral
in interfaceSqlAstWalker
-
visitBinaryArithmeticExpression
- Specified by:
visitBinaryArithmeticExpression
in interfaceSqlAstWalker
-
visitArithmeticOperand
-
visitDuration
- Specified by:
visitDuration
in interfaceSqlAstWalker
-
renderInterval
-
renderIntervalLiteral
-
visitConversion
- Specified by:
visitConversion
in interfaceSqlAstWalker
-
visitCaseSearchedExpression
- Specified by:
visitCaseSearchedExpression
in interfaceSqlAstWalker
-
visitCaseSearchedExpression
protected void visitCaseSearchedExpression(CaseSearchedExpression caseSearchedExpression, boolean inSelect) -
visitAnsiCaseSearchedExpression
protected void visitAnsiCaseSearchedExpression(CaseSearchedExpression caseSearchedExpression, Consumer<Expression> resultRenderer) -
visitDecodeCaseSearchedExpression
-
visitCaseSimpleExpression
- Specified by:
visitCaseSimpleExpression
in interfaceSqlAstWalker
-
visitCaseSimpleExpression
protected void visitCaseSimpleExpression(CaseSimpleExpression caseSimpleExpression, boolean inSelect) -
visitAnsiCaseSimpleExpression
protected void visitAnsiCaseSimpleExpression(CaseSimpleExpression caseSimpleExpression, Consumer<Expression> resultRenderer) -
areAllResultsParameters
-
areAllResultsParameters
-
visitAny
- Specified by:
visitAny
in interfaceSqlAstWalker
-
visitEvery
- Specified by:
visitEvery
in interfaceSqlAstWalker
-
visitSummarization
- Specified by:
visitSummarization
in interfaceSqlAstWalker
-
visitJdbcLiteral
- Specified by:
visitJdbcLiteral
in interfaceSqlAstWalker
-
visitQueryLiteral
- Specified by:
visitQueryLiteral
in interfaceSqlAstWalker
-
visitUnparsedNumericLiteral
- Specified by:
visitUnparsedNumericLiteral
in interfaceSqlAstWalker
-
renderNull
-
renderAsLiteral
-
visitUnaryOperationExpression
- Specified by:
visitUnaryOperationExpression
in interfaceSqlAstWalker
-
visitModifiedSubQueryExpression
- Specified by:
visitModifiedSubQueryExpression
in interfaceSqlAstWalker
-
visitSelfRenderingPredicate
- Specified by:
visitSelfRenderingPredicate
in interfaceSqlAstWalker
-
visitSelfRenderingExpression
- Specified by:
visitSelfRenderingExpression
in interfaceSqlAstWalker
-
visitBooleanExpressionPredicate
- Specified by:
visitBooleanExpressionPredicate
in interfaceSqlAstWalker
-
visitBetweenPredicate
- Specified by:
visitBetweenPredicate
in interfaceSqlAstWalker
-
visitFilterPredicate
- Specified by:
visitFilterPredicate
in interfaceSqlAstWalker
-
visitFilterFragmentPredicate
- Specified by:
visitFilterFragmentPredicate
in interfaceSqlAstWalker
-
visitSqlFragmentPredicate
- Specified by:
visitSqlFragmentPredicate
in interfaceSqlAstWalker
-
visitGroupedPredicate
- Specified by:
visitGroupedPredicate
in interfaceSqlAstWalker
-
visitInListPredicate
- Specified by:
visitInListPredicate
in interfaceSqlAstWalker
-
visitInArrayPredicate
- Specified by:
visitInArrayPredicate
in interfaceSqlAstWalker
-
visitInSubQueryPredicate
- Specified by:
visitInSubQueryPredicate
in interfaceSqlAstWalker
-
emulateSubQueryRelationalRestrictionPredicate
protected <X extends Expression> void emulateSubQueryRelationalRestrictionPredicate(Predicate predicate, boolean negated, SelectStatement selectStatement, X lhsTuple, AbstractSqlAstTranslator.SubQueryRelationalRestrictionEmulationRenderer<X> renderer, ComparisonOperator tupleComparisonOperator) -
emulateQuantifiedTupleSubQueryPredicate
protected void emulateQuantifiedTupleSubQueryPredicate(Predicate predicate, SelectStatement selectStatement, SqlTuple lhsTuple, ComparisonOperator tupleComparisonOperator) An optimized emulation for relational tuple sub-query comparisons. The idea of this method is to use limit 1 to select the max or min tuple and only compare against that. -
visitExistsPredicate
- Specified by:
visitExistsPredicate
in interfaceSqlAstWalker
-
visitJunction
- Specified by:
visitJunction
in interfaceSqlAstWalker
-
visitLikePredicate
- Specified by:
visitLikePredicate
in interfaceSqlAstWalker
-
renderCaseInsensitiveLikeEmulation
protected void renderCaseInsensitiveLikeEmulation(Expression lhs, Expression rhs, Expression escapeCharacter, boolean negated) -
renderBackslashEscapedLikePattern
protected void renderBackslashEscapedLikePattern(Expression pattern, Expression escapeCharacter, boolean noBackslashEscapes) -
appendBackslashEscapedLikeLiteral
protected void appendBackslashEscapedLikeLiteral(SqlAppender appender, String literal, boolean noBackslashEscapes) -
visitNegatedPredicate
- Specified by:
visitNegatedPredicate
in interfaceSqlAstWalker
-
visitNullnessPredicate
- Specified by:
visitNullnessPredicate
in interfaceSqlAstWalker
-
visitThruthnessPredicate
- Specified by:
visitThruthnessPredicate
in interfaceSqlAstWalker
-
visitRelationalPredicate
- Specified by:
visitRelationalPredicate
in interfaceSqlAstWalker
-
supportsQuantifiedPredicates
protected boolean supportsQuantifiedPredicates()Is this dialect known to support quantified predicates.Basically, does it support syntax like
... where FIRST_NAME > ALL (select ...) ...
- Returns:
- True if this SQL dialect is known to support quantified predicates; false otherwise.
-
supportsDistinctFromPredicate
protected boolean supportsDistinctFromPredicate()Is this SQL dialect known to support some kind of distinct from predicate.Basically, does it support syntax like
... where FIRST_NAME IS DISTINCT FROM LAST_NAME
- Returns:
- True if this SQL dialect is known to support some kind of distinct from predicate; false otherwise
-
supportsRowValueConstructorSyntax
protected boolean supportsRowValueConstructorSyntax()Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax; sometimes called tuple syntax.Basically, does it support syntax like
... where (FIRST_NAME, LAST_NAME) = ('Steve', 'Ebersole') ...
- Returns:
- True if this SQL dialect is known to support "row value constructor" syntax; false otherwise.
-
supportsRowValueConstructorGtLtSyntax
protected boolean supportsRowValueConstructorGtLtSyntax()Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax; sometimes called tuple syntax with<
,>
,≤
and≥
operators.Basically, does it support syntax like
... where (FIRST_NAME, LAST_NAME) < ('Steve', 'Ebersole') ...
- Returns:
- True if this SQL dialect is known to support "row value constructor" syntax with relational comparison operators; false otherwise.
-
supportsRowValueConstructorDistinctFromSyntax
protected boolean supportsRowValueConstructorDistinctFromSyntax()Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax; sometimes called tuple syntax withis distinct from
andis not distinct from
operators.Basically, does it support syntax like
... where (FIRST_NAME, LAST_NAME) is distinct from ('Steve', 'Ebersole') ...
- Returns:
- True if this SQL dialect is known to support "row value constructor" syntax with distinct from comparison operators; false otherwise.
-
supportsRowValueConstructorSyntaxInSet
protected boolean supportsRowValueConstructorSyntaxInSet()Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax, sometimes called tuple syntax, in the SET clause;Basically, does it support syntax like
... SET (FIRST_NAME, LAST_NAME) = ('Steve', 'Ebersole') ...
- Returns:
- True if this SQL dialect is known to support "row value constructor" syntax in the SET clause; false otherwise.
-
supportsRowValueConstructorSyntaxInQuantifiedPredicates
protected boolean supportsRowValueConstructorSyntaxInQuantifiedPredicates()Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax; sometimes called tuple syntax with quantified predicates.Basically, does it support syntax like
... where (FIRST_NAME, LAST_NAME) = ALL (select ...) ...
- Returns:
- True if this SQL dialect is known to support "row value constructor" syntax with quantified predicates; false otherwise.
-
supportsRowValueConstructorSyntaxInInList
protected boolean supportsRowValueConstructorSyntaxInInList()If the dialect supportsrow values
, does it offer such support in IN lists as well?For example,
... where (FIRST_NAME, LAST_NAME) IN ( (?, ?), (?, ?) ) ...
- Returns:
- True if this SQL dialect is known to support "row value constructor" syntax in the IN list; false otherwise.
-
supportsRowValueConstructorSyntaxInInSubQuery
protected boolean supportsRowValueConstructorSyntaxInInSubQuery()If the dialect supportsrow values
, does it offer such support in IN subqueries as well?For example,
... where (FIRST_NAME, LAST_NAME) IN ( select ... ) ...
- Returns:
- True if this SQL dialect is known to support "row value constructor" syntax in the IN subqueries; false otherwise.
-
supportsJoinInMutationStatementSubquery
protected boolean supportsJoinInMutationStatementSubquery()If the dialect supports using joins in mutation statement subquery that could also use columns from the mutation target table -
getDual
Returns a table expression that has one row.- Returns:
- the SQL equivalent to Oracle's
dual
.
-
getFromDualForSelectOnly
-
visitStandardTableInsert
- Specified by:
visitStandardTableInsert
in interfaceSqlAstWalker
-
renderIntoIntoAndTable
Renders theinsert into <table name>
portion of an insert -
renderInsertIntoNoColumns
Handle rendering an insert with no columns -
visitCustomTableInsert
- Specified by:
visitCustomTableInsert
in interfaceSqlAstWalker
-
visitStandardTableUpdate
- Specified by:
visitStandardTableUpdate
in interfaceSqlAstWalker
-
visitOptionalTableUpdate
- Specified by:
visitOptionalTableUpdate
in interfaceSqlAstWalker
-
visitCustomTableUpdate
- Specified by:
visitCustomTableUpdate
in interfaceSqlAstWalker
-
visitStandardTableDelete
- Specified by:
visitStandardTableDelete
in interfaceSqlAstWalker
-
visitCustomTableDelete
- Specified by:
visitCustomTableDelete
in interfaceSqlAstWalker
-
applyParameter
-
visitColumnWriteFragment
- Specified by:
visitColumnWriteFragment
in interfaceSqlAstWalker
-
simpleColumnWriteFragmentRendering
-