Class AbstractSqlAstTranslator<T extends JdbcOperation>
- java.lang.Object
-
- org.hibernate.sql.ast.spi.AbstractSqlAstTranslator<T>
-
- All Implemented Interfaces:
Appendable
,SqlAppender
,SqlAstTranslator<T>
,SqlAstWalker
- Direct Known Subclasses:
CockroachSqlAstTranslator
,DB2SqlAstTranslator
,DerbySqlAstTranslator
,HANASqlAstTranslator
,HSQLSqlAstTranslator
,MariaDBSqlAstTranslator
,MySQLSqlAstTranslator
,SpannerSqlAstTranslator
,SqlAstTranslatorWithMerge
,SqlAstTranslatorWithUpsert
,StandardSqlAstTranslator
,SybaseASESqlAstTranslator
,SybaseSqlAstTranslator
,TiDBSqlAstTranslator
public abstract class AbstractSqlAstTranslator<T extends JdbcOperation> extends Object implements SqlAstTranslator<T>, SqlAppender
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
AbstractSqlAstTranslator.ForUpdateClause
protected static class
AbstractSqlAstTranslator.LockStrategy
protected static interface
AbstractSqlAstTranslator.SubQueryRelationalRestrictionEmulationRenderer<X extends Expression>
-
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
Constructors Modifier Constructor Description protected
AbstractSqlAstTranslator(SessionFactoryImplementor sessionFactory, Statement statement)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
addAdditionalWherePredicate(Predicate predicate)
protected void
addAppliedParameterBinding(JdbcParameter parameter, JdbcParameterBinding binding)
Appendable
append(char c)
Appendable
append(CharSequence csq)
Appendable
append(CharSequence csq, int start, int end)
protected void
appendBackslashEscapedLikeLiteral(SqlAppender appender, String literal, boolean noBackslashEscapes)
void
appendSql(boolean value)
void
appendSql(char fragment)
void
appendSql(int value)
void
appendSql(long value)
void
appendSql(String fragment)
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 AbstractSqmSelfRenderingFunctionDescriptor
castFunction()
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
determineCyclePathColumnName(CteStatement cte)
protected Predicate
determineLateralEmulationPredicate(TableGroup tableGroup)
protected AbstractSqlAstTranslator.LockStrategy
determineLockingStrategy(QuerySpec querySpec, AbstractSqlAstTranslator.ForUpdateClause forUpdateClause, Boolean followOnLocking)
protected Predicate
determineWhereClauseRestrictionWithJoinEmulation(AbstractUpdateOrDeleteStatement statement)
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
emulateFetchOffsetWithWindowFunctionsVisitQueryPart(QueryPart queryPart)
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, NullPrecedence 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)
Set<String>
getAffectedTableNames()
Not the best spot for this.protected Map<JdbcParameter,JdbcParameterBinding>
getAppliedParameterBindings()
protected String
getArrayContainsFunction()
Returns the name of thearray_contains(array, element)
function, which is used for emulating the cycle clause.BasicType<Boolean>
getBooleanType()
static String
getCastTypeName(SqlTypedMapping castTarget, SessionFactoryImplementor factory)
Deprecated, for removal: This API element is subject to removal in a future version.static String
getCastTypeName(SqlTypedMapping castTarget, TypeConfiguration typeConfiguration)
protected Stack<Clause>
getClauseStack()
protected CteStatement
getCteStatement(String cteName)
Stack<Clause>
getCurrentClauseStack()
protected CteStatement
getCurrentCteStatement()
MutationStatement
getCurrentDmlStatement()
QueryPart
getCurrentQueryPart()
Returns the current query part that is translated.Dialect
getDialect()
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
getForUpdate()
protected String
getForUpdateWithClause()
protected String
getFromDual()
Deprecated, for removal: This API element is subject to removal in a future version.UsegetDual()
insteadprotected String
getFromDualForSelectOnly()
BasicType<Integer>
getIntegerType()
protected JdbcLockStrategy
getJdbcLockStrategy()
protected JdbcParameterBindings
getJdbcParameterBindings()
protected JdbcServices
getJdbcServices()
protected Expression
getLeftHandExpression(Predicate predicate)
protected Limit
getLimit()
protected JdbcParameter
getLimitParameter()
protected LockOptions
getLockOptions()
protected int
getMaxRows(SelectStatement sqlAstSelect, JdbcParameterBindings jdbcParameterBindings, int rowsToSkip)
protected String
getNoWait()
protected JdbcParameter
getOffsetParameter()
List<JdbcParameterBinder>
getParameterBinders()
protected Object
getParameterBindValue(JdbcParameter parameter)
protected SqlAstNodeRenderingMode
getParameterRenderingMode()
protected QueryPart
getQueryPartForRowNumbering()
protected Stack<QueryPart>
getQueryPartStack()
protected int
getRowsToSkip(SelectStatement sqlAstSelect, JdbcParameterBindings jdbcParameterBindings)
protected SqlSelectionExpression
getSelectItemReference(Expression expression)
SessionFactoryImplementor
getSessionFactory()
protected String
getSkipLocked()
protected List<SortSpecification>
getSortSpecificationsRowNumbering(SelectClause selectClause, QueryPart queryPart)
String
getSql()
protected SqlAppender
getSqlAppender()
StringBuilder
getSqlBuffer()
static String
getSqlTypeName(SqlTypedMapping castTarget, SessionFactoryImplementor factory)
Deprecated, for removal: This API element is subject to removal in a future version.static String
getSqlTypeName(SqlTypedMapping castTarget, TypeConfiguration typeConfiguration)
protected Statement
getStatement()
protected Stack<Statement>
getStatementStack()
BasicType<String>
getStringType()
protected String
getUniqueConstraintNameThatMayFail(InsertSelectStatement sqlAst)
protected WrapperOptions
getWrapperOptions()
protected boolean
hasAggregateFunctions(QuerySpec querySpec)
protected boolean
hasLimit()
protected boolean
hasLimit(QueryPart queryPart)
protected boolean
hasNestedTableGroupsToRender(List<TableGroupJoin> nestedTableGroupJoins)
protected static boolean
hasNonTrivialFromClause(FromClause fromClause)
protected boolean
hasOffset(QueryPart queryPart)
protected void
inlineCteTableGroup(TableGroup tableGroup, LockMode lockMode)
protected boolean
inOverOrWithinGroupClause()
protected <R> R
interpretExpression(Expression expression, JdbcParameterBindings jdbcParameterBindings)
protected boolean
isCorrelated(CteStatement cteStatement)
protected boolean
isInRecursiveQueryPart()
protected boolean
isInSubquery()
protected boolean
isIntegerDivisionEmulationRequired(BinaryArithmeticExpression expression)
protected boolean
isLiteral(Expression expression)
protected boolean
isParameter(Expression expression)
protected boolean
isRowNumberingCurrentQueryPart()
protected boolean
isRowsOnlyFetchClauseType(QueryPart queryPart)
protected boolean
isStruct(JdbcMappingContainer expressionType)
protected boolean
needsCteInlining()
Whether CTEs should be inlined rather than rendered as CTEs.protected boolean
needsLocking(QuerySpec querySpec)
protected boolean
needsMaxRows()
protected boolean
needsRecursiveKeywordInWithClause()
Whether the SQL with clause requires the "recursive" keyword for recursive CTEs.protected boolean
needsRowsToSkip()
protected void
prepareLimitOffsetParameters()
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 void
renderCommaSeparated(Iterable<? extends SqlAstNode> expressions)
protected void
renderCommaSeparatedSelectExpression(Iterable<? extends SqlAstNode> expressions)
protected 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
renderCteColumns(CteStatement cte)
protected void
renderCycleClause(CteStatement cte)
protected void
renderDeleteClause(DeleteStatement statement)
protected void
renderDerivedTableReference(DerivedTableReference tableReference)
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
renderFromClauseExcludingDmlTargetReference(UpdateStatement statement)
protected void
renderFromClauseJoiningDmlTargetReference(UpdateStatement statement)
protected void
renderFromClauseSpaces(FromClause fromClause)
protected void
renderInsertIntoNoColumns(TableInsertStandard tableInsert)
Handle rendering an insert with no columnsprotected 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)
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 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
renderSearchClause(CteStatement cte)
protected void
renderSelectExpression(Expression expression)
protected void
renderSelectExpressionWithCastedOrInlinedPlainParameters(Expression expression)
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 void
renderSkipFirstClause(Expression offsetExpression, Expression fetchExpression)
protected void
renderSkipFirstClause(QuerySpec querySpec)
protected void
renderSortExpression(Expression sortExpression, boolean ignoreCase)
protected void
renderStandardCycleClause(CteStatement cte)
protected void
renderStandardSearchClause(CteStatement cte)
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
supportsArrayConstructor()
Whether the SQL array constructor is supported.protected boolean
supportsDistinctFromPredicate()
Is this SQL dialect known to support some kind of distinct from predicate.protected boolean
supportsDuplicateSelectItemsInQueryGroup()
boolean
supportsFilterClause()
Whether the FILTER clause for aggregate functions is supported.protected boolean
supportsIntersect()
protected boolean
supportsJoinInMutationStatementSubquery()
If the dialect supports using joins in mutation statement subquery that could also use columns from the mutation target tableprotected boolean
supportsJoinsInDelete()
protected boolean
supportsNestedSubqueryCorrelation()
protected boolean
supportsNestedWithClause()
Whether the SQL with clause is supported within a CTE.protected boolean
supportsNullPrecedence()
protected boolean
supportsQuantifiedPredicates()
Is this dialect known to support quantified predicates.protected boolean
supportsRecursiveClauseArrayAndRowEmulation()
Whether the recursive search and cycle clause emulations based on the array and row constructor is supported.protected boolean
supportsRecursiveCycleClause()
Whether the SQL cycle clause is supported, which can be used for recursive CTEs.protected boolean
supportsRecursiveCycleUsingClause()
Whether the SQL cycle clause supports the using sub-clause.protected boolean
supportsRecursiveSearchClause()
Whether the SQL search clause is supported, which can be used for recursive CTEs.protected boolean
supportsRowConstructor()
Whether the SQL row constructor is supported.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.protected boolean
supportsRowValueConstructorGtLtSyntax()
Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax; sometimes called tuple syntax with<
,>
,≤
and≥
operators.protected boolean
supportsRowValueConstructorSyntax()
Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax; sometimes called tuple syntax.protected boolean
supportsRowValueConstructorSyntaxInInList()
If the dialect supportsrow values
, does it offer such support in IN lists as well?protected boolean
supportsRowValueConstructorSyntaxInInSubQuery()
If the dialect supportsrow values
, does it offer such support in IN subqueries as well?protected boolean
supportsRowValueConstructorSyntaxInQuantifiedPredicates()
Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax; sometimes called tuple syntax with quantified predicates.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;protected boolean
supportsSimpleQueryGrouping()
protected boolean
supportsWithClause()
Whether the SQL with clause is supported.protected boolean
supportsWithClauseInSubquery()
Whether the SQL with clause is supported within a subquery.T
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
visitAny(Any any)
protected void
visitArithmeticOperand(Expression expression)
void
visitAssignment(Assignment assignment)
void
visitBetweenPredicate(BetweenPredicate betweenPredicate)
void
visitBinaryArithmeticExpression(BinaryArithmeticExpression arithmeticExpression)
void
visitBooleanExpressionPredicate(BooleanExpressionPredicate booleanExpressionPredicate)
void
visitCaseSearchedExpression(CaseSearchedExpression caseSearchedExpression)
protected void
visitCaseSearchedExpression(CaseSearchedExpression caseSearchedExpression, boolean inSelect)
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
visitCteDefinition(CteStatement cte)
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
visitDurationUnit(DurationUnit unit)
void
visitEmbeddableTypeLiteral(EmbeddableTypeLiteral expression)
void
visitEntityTypeLiteral(EntityTypeLiteral expression)
void
visitEvery(Every every)
void
visitExistsPredicate(ExistsPredicate existsPredicate)
void
visitExtractUnit(ExtractUnit extractUnit)
void
visitFilterFragmentPredicate(FilterPredicate.FilterFragmentPredicate filter)
void
visitFilterPredicate(FilterPredicate filterPredicate)
void
visitFormat(Format format)
protected void
visitForUpdateClause(QuerySpec querySpec)
void
visitFromClause(FromClause fromClause)
void
visitFunctionTableReference(FunctionTableReference tableReference)
protected void
visitGroupByClause(QuerySpec querySpec, SelectItemReferenceStrategy referenceStrategy)
void
visitGroupedPredicate(GroupedPredicate groupedPredicate)
protected void
visitHavingClause(QuerySpec querySpec)
void
visitInArrayPredicate(InArrayPredicate inArrayPredicate)
void
visitInListPredicate(InListPredicate inListPredicate)
protected void
visitInsertSource(InsertSelectStatement statement)
void
visitInsertStatement(InsertSelectStatement statement)
protected void
visitInsertStatementEmulateMerge(InsertSelectStatement statement)
protected void
visitInsertStatementOnly(InsertSelectStatement statement)
void
visitInSubQueryPredicate(InSubQueryPredicate inSubQueryPredicate)
void
visitJdbcLiteral(JdbcLiteral<?> jdbcLiteral)
void
visitJunction(Junction junction)
void
visitLikePredicate(LikePredicate likePredicate)
void
visitModifiedSubQueryExpression(ModifiedSubQueryExpression expression)
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
visitOver(Over<?> over)
protected 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 void
visitPartitionByClause(List<Expression> partitionExpressions)
protected void
visitPartitionExpressions(List<Expression> partitionExpressions, Function<Expression,Expression> resolveAliasExpression, boolean inlineParametersOfAliasedExpressions)
protected 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, NullPrecedence 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
visitStar(Star star)
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
visitUpdateStatementEmulateInlineView(UpdateStatement statement)
protected void
visitUpdateStatementEmulateMerge(UpdateStatement statement)
protected void
visitUpdateStatementEmulateTupleSet(UpdateStatement statement)
protected void
visitUpdateStatementOnly(UpdateStatement statement)
protected void
visitValuesList(List<Values> valuesList)
protected void
visitValuesListEmulateSelectUnion(List<Values> valuesList)
protected void
visitValuesListStandard(List<Values> valuesList)
void
visitValuesTableReference(ValuesTableReference tableReference)
protected void
visitWhereClause(Predicate whereClauseRestrictions)
protected void
withParameterRenderingMode(SqlAstNodeRenderingMode renderingMode, Runnable runnable)
protected void
withRowNumbering(QueryPart queryPart, boolean needsSelectAliases, Runnable r)
-
-
-
Constructor Detail
-
AbstractSqlAstTranslator
protected AbstractSqlAstTranslator(SessionFactoryImplementor sessionFactory, Statement statement)
-
-
Method Detail
-
getDialect
public Dialect getDialect()
-
getSessionFactory
public SessionFactoryImplementor getSessionFactory()
- Specified by:
getSessionFactory
in interfaceSqlAstTranslator<T extends JdbcOperation>
-
castFunction
protected AbstractSqmSelfRenderingFunctionDescriptor castFunction()
-
getWrapperOptions
protected WrapperOptions getWrapperOptions()
-
getSql
public String getSql()
-
getSqlBuffer
@Internal public StringBuilder getSqlBuffer()
-
cleanup
protected void cleanup()
-
getParameterBinders
public List<JdbcParameterBinder> getParameterBinders()
-
getSqlAppender
protected SqlAppender getSqlAppender()
-
getAffectedTableNames
public Set<String> getAffectedTableNames()
Description copied from interface:SqlAstTranslator
Not the best spot for this. Its the table names collected while walking the SQL AST. Its 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
protected Statement getStatement()
-
getCurrentDmlStatement
public MutationStatement getCurrentDmlStatement()
-
getParameterRenderingMode
protected SqlAstNodeRenderingMode getParameterRenderingMode()
-
addAdditionalWherePredicate
protected void addAdditionalWherePredicate(Predicate predicate)
-
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
public void appendSql(String fragment)
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
-
append
public Appendable append(CharSequence csq)
- Specified by:
append
in interfaceAppendable
- Specified by:
append
in interfaceSqlAppender
-
append
public Appendable append(CharSequence csq, int start, int end)
- Specified by:
append
in interfaceAppendable
- Specified by:
append
in interfaceSqlAppender
-
append
public Appendable append(char c)
- Specified by:
append
in interfaceAppendable
- Specified by:
append
in interfaceSqlAppender
-
getJdbcServices
protected JdbcServices getJdbcServices()
-
addAppliedParameterBinding
protected void addAppliedParameterBinding(JdbcParameter parameter, JdbcParameterBinding binding)
-
getAppliedParameterBindings
protected Map<JdbcParameter,JdbcParameterBinding> getAppliedParameterBindings()
-
getJdbcLockStrategy
protected JdbcLockStrategy getJdbcLockStrategy()
-
getJdbcParameterBindings
protected JdbcParameterBindings getJdbcParameterBindings()
-
getLockOptions
protected LockOptions getLockOptions()
-
getLimit
protected Limit getLimit()
-
hasLimit
protected boolean hasLimit()
-
hasLimit
protected boolean hasLimit(QueryPart queryPart)
-
hasOffset
protected boolean hasOffset(QueryPart queryPart)
-
useOffsetFetchClause
protected boolean useOffsetFetchClause(QueryPart queryPart)
-
isRowsOnlyFetchClauseType
protected boolean isRowsOnlyFetchClauseType(QueryPart queryPart)
-
getOffsetParameter
protected JdbcParameter getOffsetParameter()
-
setOffsetParameter
protected void setOffsetParameter(JdbcParameter offsetParameter)
-
getLimitParameter
protected JdbcParameter getLimitParameter()
-
setLimitParameter
protected void setLimitParameter(JdbcParameter limitParameter)
-
interpretExpression
protected <R> R interpretExpression(Expression expression, JdbcParameterBindings jdbcParameterBindings)
-
renderExpressionAsLiteral
protected void renderExpressionAsLiteral(Expression expression, JdbcParameterBindings jdbcParameterBindings)
-
getParameterBindValue
protected Object getParameterBindValue(JdbcParameter parameter)
-
getLeftHandExpression
protected Expression getLeftHandExpression(Predicate predicate)
-
inOverOrWithinGroupClause
protected boolean inOverOrWithinGroupClause()
-
getCurrentQueryPart
public QueryPart getCurrentQueryPart()
Description copied from interface:SqlAstTranslator
Returns the current query part that is translated.- Specified by:
getCurrentQueryPart
in interfaceSqlAstTranslator<T extends JdbcOperation>
-
getCurrentClauseStack
public Stack<Clause> getCurrentClauseStack()
- Specified by:
getCurrentClauseStack
in interfaceSqlAstTranslator<T extends JdbcOperation>
-
getCurrentCteStatement
protected CteStatement getCurrentCteStatement()
-
getCteStatement
protected CteStatement getCteStatement(String cteName)
-
translate
public T translate(JdbcParameterBindings jdbcParameterBindings, QueryOptions queryOptions)
- Specified by:
translate
in interfaceSqlAstTranslator<T extends JdbcOperation>
-
translateDelete
protected JdbcOperationQueryDelete translateDelete(DeleteStatement sqlAst)
-
translateUpdate
protected JdbcOperationQueryUpdate translateUpdate(UpdateStatement sqlAst)
-
translateInsert
protected JdbcOperationQueryInsert translateInsert(InsertSelectStatement sqlAst)
-
getUniqueConstraintNameThatMayFail
protected String getUniqueConstraintNameThatMayFail(InsertSelectStatement sqlAst)
-
translateSelect
protected JdbcOperationQuerySelect translateSelect(SelectStatement selectStatement)
-
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
public void visitSelectStatement(SelectStatement statement)
- Specified by:
visitSelectStatement
in interfaceSqlAstWalker
-
visitDeleteStatement
public void visitDeleteStatement(DeleteStatement statement)
- Specified by:
visitDeleteStatement
in interfaceSqlAstWalker
-
visitUpdateStatement
public void visitUpdateStatement(UpdateStatement statement)
- Specified by:
visitUpdateStatement
in interfaceSqlAstWalker
-
visitAssignment
public void visitAssignment(Assignment assignment)
- Specified by:
visitAssignment
in interfaceSqlAstWalker
-
visitInsertStatement
public void visitInsertStatement(InsertSelectStatement statement)
- Specified by:
visitInsertStatement
in interfaceSqlAstWalker
-
visitDeleteStatementOnly
protected void visitDeleteStatementOnly(DeleteStatement statement)
-
supportsJoinsInDelete
protected boolean supportsJoinsInDelete()
-
renderDeleteClause
protected void renderDeleteClause(DeleteStatement statement)
-
visitUpdateStatementOnly
protected void visitUpdateStatementOnly(UpdateStatement statement)
-
renderUpdateClause
protected void renderUpdateClause(UpdateStatement updateStatement)
-
renderDmlTargetTableExpression
protected void renderDmlTargetTableExpression(NamedTableReference tableReference)
-
hasNonTrivialFromClause
protected static boolean hasNonTrivialFromClause(FromClause fromClause)
-
determineWhereClauseRestrictionWithJoinEmulation
protected Predicate determineWhereClauseRestrictionWithJoinEmulation(AbstractUpdateOrDeleteStatement statement)
-
determineWhereClauseRestrictionWithJoinEmulation
protected Predicate determineWhereClauseRestrictionWithJoinEmulation(AbstractUpdateOrDeleteStatement statement, String dmlTargetAlias)
-
renderSetClause
protected void renderSetClause(List<Assignment> assignments)
-
visitSetAssignment
protected void visitSetAssignment(Assignment assignment)
-
visitSetAssignmentEmulateJoin
protected void visitSetAssignmentEmulateJoin(Assignment assignment, UpdateStatement statement)
-
isStruct
protected boolean isStruct(JdbcMappingContainer expressionType)
-
visitInsertStatementOnly
protected void visitInsertStatementOnly(InsertSelectStatement statement)
-
isIntegerDivisionEmulationRequired
protected boolean isIntegerDivisionEmulationRequired(BinaryArithmeticExpression expression)
-
visitInsertSource
protected void visitInsertSource(InsertSelectStatement statement)
-
visitInsertStatementEmulateMerge
protected void visitInsertStatementEmulateMerge(InsertSelectStatement statement)
-
visitUpdateStatementEmulateMerge
protected void visitUpdateStatementEmulateMerge(UpdateStatement statement)
-
visitUpdateStatementEmulateInlineView
protected void visitUpdateStatementEmulateInlineView(UpdateStatement statement)
-
visitUpdateStatementEmulateTupleSet
protected void visitUpdateStatementEmulateTupleSet(UpdateStatement statement)
-
renderMergeUpdateClause
protected void renderMergeUpdateClause(List<Assignment> assignments, Predicate wherePredicate)
-
visitValuesListEmulateSelectUnion
protected void visitValuesListEmulateSelectUnion(List<Values> valuesList)
-
visitForUpdateClause
protected void visitForUpdateClause(QuerySpec querySpec)
-
renderForUpdateClause
protected void renderForUpdateClause(QuerySpec querySpec, AbstractSqlAstTranslator.ForUpdateClause forUpdateClause)
-
getForUpdate
protected String getForUpdate()
-
getForShare
protected String getForShare(int timeoutMillis)
-
getForUpdateWithClause
protected String getForUpdateWithClause()
-
getNoWait
protected String getNoWait()
-
getSkipLocked
protected String getSkipLocked()
-
getEffectiveLockTimeout
protected int getEffectiveLockTimeout(LockMode lockMode)
-
hasAggregateFunctions
protected boolean hasAggregateFunctions(QuerySpec querySpec)
-
determineLockingStrategy
protected AbstractSqlAstTranslator.LockStrategy determineLockingStrategy(QuerySpec querySpec, AbstractSqlAstTranslator.ForUpdateClause forUpdateClause, Boolean followOnLocking)
-
visitConflictClause
protected void visitConflictClause(ConflictClause conflictClause)
-
visitStandardConflictClause
protected void visitStandardConflictClause(ConflictClause conflictClause)
-
visitOnDuplicateKeyConflictClause
protected void visitOnDuplicateKeyConflictClause(ConflictClause conflictClause)
-
visitReturningColumns
protected void visitReturningColumns(Supplier<List<ColumnReference>> returningColumnsAccess)
-
visitReturningColumns
protected void visitReturningColumns(List<ColumnReference> returningColumns)
-
visitCteContainer
public void visitCteContainer(CteContainer cteContainer)
-
visitCteObject
protected void visitCteObject(CteObject cteObject)
-
renderCteColumns
protected void renderCteColumns(CteStatement cte)
-
determineCyclePathColumnName
protected String determineCyclePathColumnName(CteStatement cte)
-
isInRecursiveQueryPart
protected boolean isInRecursiveQueryPart()
-
isInSubquery
protected boolean isInSubquery()
-
visitCteDefinition
protected void visitCteDefinition(CteStatement cte)
-
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
protected boolean shouldInlineCte(TableGroup tableGroup)
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
protected void renderMaterializationHint(CteMaterialization materialization)
-
renderSearchClause
protected void renderSearchClause(CteStatement cte)
-
renderStandardSearchClause
protected void renderStandardSearchClause(CteStatement cte)
-
renderCycleClause
protected void renderCycleClause(CteStatement cte)
-
renderStandardCycleClause
protected void renderStandardCycleClause(CteStatement cte)
-
renderRecursiveCteVirtualSelections
protected void renderRecursiveCteVirtualSelections(SelectClause selectClause)
-
emulateSearchClauseOrderWithRowAndArray
protected void emulateSearchClauseOrderWithRowAndArray(SelectClause selectClause)
-
visitRecursivePath
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.
-
emulateCycleClauseWithRowAndArray
protected void emulateCycleClauseWithRowAndArray(SelectClause selectClause)
-
getArrayContainsFunction
protected String getArrayContainsFunction()
Returns the name of thearray_contains(array, element)
function, which is used for emulating the cycle clause.
-
renderStringContainsExactlyPredicate
protected void renderStringContainsExactlyPredicate(Expression haystack, Expression needle)
-
castNumberToString
protected Expression castNumberToString(Expression expression, int precision, int scale)
Casts a number expression to a string with the given precision and scale.
-
visitQueryGroup
public void visitQueryGroup(QueryGroup queryGroup)
- Specified by:
visitQueryGroup
in interfaceSqlAstWalker
-
renderQueryGroup
protected void renderQueryGroup(QueryGroup queryGroup, boolean renderOrderByAndOffsetFetchClause)
-
visitQuerySpec
public void visitQuerySpec(QuerySpec querySpec)
- Specified by:
visitQuerySpec
in interfaceSqlAstWalker
-
supportsSimpleQueryGrouping
protected boolean supportsSimpleQueryGrouping()
-
supportsDuplicateSelectItemsInQueryGroup
protected boolean supportsDuplicateSelectItemsInQueryGroup()
-
visitWhereClause
protected final void visitWhereClause(Predicate whereClauseRestrictions)
-
resolveAliasedExpression
protected Expression resolveAliasedExpression(Expression expression)
-
resolveAliasedExpression
protected Expression resolveAliasedExpression(List<SqlSelection> sqlSelections, Expression expression)
-
resolveExpressionToAlias
protected Expression resolveExpressionToAlias(Expression expression)
-
visitGroupByClause
protected final void visitGroupByClause(QuerySpec querySpec, SelectItemReferenceStrategy referenceStrategy)
-
visitPartitionByClause
protected final void visitPartitionByClause(List<Expression> partitionExpressions)
-
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
protected void renderPartitionItem(Expression expression)
-
visitHavingClause
protected final void visitHavingClause(QuerySpec querySpec)
-
visitOrderBy
protected void visitOrderBy(List<SortSpecification> sortSpecifications)
-
renderOrderBy
protected void renderOrderBy(boolean addWhitespace, List<SortSpecification> sortSpecifications)
-
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
protected void renderExpressionsAsSubquery(List<? extends Expression> expressions)
-
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
protected void renderComparison(Expression lhs, ComparisonOperator operator, Expression rhs)
-
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
public void visitSortSpecification(SortSpecification sortSpecification)
- Specified by:
visitSortSpecification
in interfaceSqlAstWalker
-
visitSortSpecification
protected void visitSortSpecification(Expression sortExpression, SortDirection sortOrder, NullPrecedence nullPrecedence, boolean ignoreCase)
-
renderSortExpression
protected void renderSortExpression(Expression sortExpression, boolean ignoreCase)
-
supportsNullPrecedence
protected boolean supportsNullPrecedence()
-
emulateSortSpecificationNullPrecedence
protected void emulateSortSpecificationNullPrecedence(Expression sortExpression, NullPrecedence nullPrecedence)
-
visitOffsetFetchClause
public void visitOffsetFetchClause(QueryPart queryPart)
- Specified by:
visitOffsetFetchClause
in interfaceSqlAstWalker
-
renderOffsetFetchClause
protected void renderOffsetFetchClause(QueryPart queryPart, boolean renderOffsetRowsKeyword)
-
renderOffsetFetchClause
protected void renderOffsetFetchClause(Expression offsetExpression, Expression fetchExpression, FetchClauseType fetchClauseType, boolean renderOffsetRowsKeyword)
-
renderOffset
protected void renderOffset(Expression offsetExpression, boolean renderOffsetRowsKeyword)
-
renderFetch
protected void renderFetch(Expression fetchExpression, Expression offsetExpressionToAdd, FetchClauseType fetchClauseType)
-
renderOffsetExpression
protected void renderOffsetExpression(Expression offsetExpression)
-
renderFetchExpression
protected void renderFetchExpression(Expression fetchExpression)
-
renderTopClause
protected void renderTopClause(QuerySpec querySpec, boolean addOffset, boolean needsParenthesis)
-
renderTopClause
protected void renderTopClause(Expression offsetExpression, Expression fetchExpression, FetchClauseType fetchClauseType, boolean addOffset, boolean needsParenthesis)
-
renderTopStartAtClause
protected void renderTopStartAtClause(QuerySpec querySpec)
-
renderTopStartAtClause
protected void renderTopStartAtClause(Expression offsetExpression, Expression fetchExpression, FetchClauseType fetchClauseType)
-
renderRowsToClause
protected void renderRowsToClause(QuerySpec querySpec)
-
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
protected void renderFirstSkipClause(QuerySpec querySpec)
-
renderFirstSkipClause
protected void renderFirstSkipClause(Expression offsetExpression, Expression fetchExpression)
-
renderSkipFirstClause
protected void renderSkipFirstClause(QuerySpec querySpec)
-
renderSkipFirstClause
protected void renderSkipFirstClause(Expression offsetExpression, Expression fetchExpression)
-
renderFirstClause
protected void renderFirstClause(QuerySpec querySpec)
-
renderFirstClause
protected void renderFirstClause(Expression offsetExpression, Expression fetchExpression)
-
renderCombinedLimitClause
protected void renderCombinedLimitClause(QueryPart queryPart)
-
renderCombinedLimitClause
protected void renderCombinedLimitClause(Expression offsetExpression, Expression fetchExpression)
-
renderLimitOffsetClause
protected void renderLimitOffsetClause(QueryPart queryPart)
-
renderLimitOffsetClause
protected void renderLimitOffsetClause(Expression offsetExpression, Expression fetchExpression)
-
assertRowsOnlyFetchClauseType
protected void assertRowsOnlyFetchClauseType(QueryPart queryPart)
-
getQueryPartForRowNumbering
protected QueryPart 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
protected void emulateFetchOffsetWithWindowFunctionsVisitQueryPart(QueryPart queryPart)
-
withRowNumbering
protected final void withRowNumbering(QueryPart queryPart, boolean needsSelectAliases, Runnable r)
-
visitSelectClause
public void visitSelectClause(SelectClause selectClause)
- Specified by:
visitSelectClause
in interfaceSqlAstWalker
-
visitSqlSelections
protected void visitSqlSelections(SelectClause selectClause)
-
renderVirtualSelections
protected void renderVirtualSelections(SelectClause selectClause)
-
getSelectItemReference
protected final SqlSelectionExpression getSelectItemReference(Expression expression)
-
renderRowNumberingSelectItems
protected void renderRowNumberingSelectItems(SelectClause selectClause, QueryPart queryPart)
-
getFetchClauseTypeForRowNumbering
protected FetchClauseType getFetchClauseTypeForRowNumbering(QueryPart queryPartForRowNumbering)
-
visitOver
public void visitOver(Over<?> over)
- 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
protected void renderRowNumber(SelectClause selectClause, QueryPart queryPart)
-
isParameter
protected final boolean isParameter(Expression expression)
-
isLiteral
protected final boolean isLiteral(Expression expression)
-
getSortSpecificationsRowNumbering
protected List<SortSpecification> getSortSpecificationsRowNumbering(SelectClause selectClause, QueryPart queryPart)
-
visitSqlSelection
public void visitSqlSelection(SqlSelection sqlSelection)
- Specified by:
visitSqlSelection
in interfaceSqlAstWalker
-
visitSqlSelectExpression
protected void visitSqlSelectExpression(Expression expression)
-
renderSelectExpression
protected void renderSelectExpression(Expression expression)
-
renderExpressionAsClauseItem
protected void renderExpressionAsClauseItem(Expression expression)
-
renderSelectExpressionWithCastedOrInlinedPlainParameters
protected void renderSelectExpressionWithCastedOrInlinedPlainParameters(Expression expression)
-
renderCasted
protected void renderCasted(Expression expression)
-
renderLiteral
protected void renderLiteral(Literal literal, boolean castParameter)
-
visitFromClause
public void visitFromClause(FromClause fromClause)
- Specified by:
visitFromClause
in interfaceSqlAstWalker
-
renderFromClauseSpaces
protected void renderFromClauseSpaces(FromClause fromClause)
-
renderFromClauseAfterUpdateSet
protected void renderFromClauseAfterUpdateSet(UpdateStatement statement)
-
renderFromClauseExcludingDmlTargetReference
protected void renderFromClauseExcludingDmlTargetReference(UpdateStatement statement)
-
renderFromClauseJoiningDmlTargetReference
protected void renderFromClauseJoiningDmlTargetReference(UpdateStatement statement)
-
createRowMatchingPredicate
protected Predicate createRowMatchingPredicate(TableGroup dmlTargetTableGroup, String lhsAlias, String rhsAlias)
-
renderDmlTargetTableGroup
protected void renderDmlTargetTableGroup(TableGroup tableGroup)
-
renderRootTableGroup
protected void renderRootTableGroup(TableGroup tableGroup, List<TableGroupJoin> tableGroupJoinCollector)
-
renderTableGroup
protected void renderTableGroup(TableGroup tableGroup, Predicate predicate, List<TableGroupJoin> tableGroupJoinCollector)
-
needsLocking
protected boolean needsLocking(QuerySpec querySpec)
-
hasNestedTableGroupsToRender
protected boolean hasNestedTableGroupsToRender(List<TableGroupJoin> nestedTableGroupJoins)
-
renderPrimaryTableReference
protected boolean renderPrimaryTableReference(TableGroup tableGroup, LockMode lockMode)
-
inlineCteTableGroup
protected void inlineCteTableGroup(TableGroup tableGroup, LockMode lockMode)
-
isCorrelated
protected boolean isCorrelated(CteStatement cteStatement)
-
renderNamedTableReference
protected boolean renderNamedTableReference(NamedTableReference tableReference, LockMode lockMode)
-
visitValuesTableReference
public void visitValuesTableReference(ValuesTableReference tableReference)
- Specified by:
visitValuesTableReference
in interfaceSqlAstWalker
-
visitQueryPartTableReference
public void visitQueryPartTableReference(QueryPartTableReference tableReference)
- Specified by:
visitQueryPartTableReference
in interfaceSqlAstWalker
-
visitFunctionTableReference
public void visitFunctionTableReference(FunctionTableReference tableReference)
- Specified by:
visitFunctionTableReference
in interfaceSqlAstWalker
-
emulateQueryPartTableReferenceColumnAliasing
protected void emulateQueryPartTableReferenceColumnAliasing(QueryPartTableReference tableReference)
-
emulateValuesTableReferenceColumnAliasing
protected void emulateValuesTableReferenceColumnAliasing(ValuesTableReference tableReference)
-
renderDerivedTableReference
protected void renderDerivedTableReference(DerivedTableReference tableReference)
-
renderTableReferenceIdentificationVariable
protected void renderTableReferenceIdentificationVariable(TableReference tableReference)
-
registerAffectedTable
protected void registerAffectedTable(NamedTableReference tableReference)
-
registerAffectedTable
protected void registerAffectedTable(String tableExpression)
-
renderTableReferenceJoins
protected void renderTableReferenceJoins(TableGroup tableGroup)
-
renderTableReferenceJoins
protected void renderTableReferenceJoins(TableGroup tableGroup, int swappedJoinIndex, boolean forceLeftJoin)
-
processTableGroupJoins
protected void processTableGroupJoins(TableGroup source)
-
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
protected Predicate determineLateralEmulationPredicate(TableGroup tableGroup)
-
shouldEmulateLateralWithIntersect
protected boolean shouldEmulateLateralWithIntersect(QueryPart queryPart)
-
visitTableGroup
public void visitTableGroup(TableGroup tableGroup)
- Specified by:
visitTableGroup
in interfaceSqlAstWalker
-
visitTableGroupJoin
public void visitTableGroupJoin(TableGroupJoin tableGroupJoin)
- Specified by:
visitTableGroupJoin
in interfaceSqlAstWalker
-
visitNamedTableReference
public void visitNamedTableReference(NamedTableReference tableReference)
- Specified by:
visitNamedTableReference
in interfaceSqlAstWalker
-
visitTableReferenceJoin
public void visitTableReferenceJoin(TableReferenceJoin tableReferenceJoin)
- Specified by:
visitTableReferenceJoin
in interfaceSqlAstWalker
-
visitColumnReference
public void visitColumnReference(ColumnReference columnReference)
- Specified by:
visitColumnReference
in interfaceSqlAstWalker
-
visitNestedColumnReference
public void visitNestedColumnReference(NestedColumnReference nestedColumnReference)
- Specified by:
visitNestedColumnReference
in interfaceSqlAstWalker
-
visitAggregateColumnWriteExpression
public void visitAggregateColumnWriteExpression(AggregateColumnWriteExpression aggregateColumnWriteExpression)
- Specified by:
visitAggregateColumnWriteExpression
in interfaceSqlAstWalker
-
determineColumnReferenceQualifier
protected String determineColumnReferenceQualifier(ColumnReference columnReference)
-
visitExtractUnit
public void visitExtractUnit(ExtractUnit extractUnit)
- Specified by:
visitExtractUnit
in interfaceSqlAstWalker
-
visitDurationUnit
public void visitDurationUnit(DurationUnit unit)
- Specified by:
visitDurationUnit
in interfaceSqlAstWalker
-
visitFormat
public void visitFormat(Format format)
- Specified by:
visitFormat
in interfaceSqlAstWalker
-
visitStar
public void visitStar(Star star)
- Specified by:
visitStar
in interfaceSqlAstWalker
-
visitTrimSpecification
public void visitTrimSpecification(TrimSpecification trimSpecification)
- Specified by:
visitTrimSpecification
in interfaceSqlAstWalker
-
visitCastTarget
public void visitCastTarget(CastTarget castTarget)
- Specified by:
visitCastTarget
in interfaceSqlAstWalker
-
getSqlTypeName
@Deprecated(forRemoval=true) public static String getSqlTypeName(SqlTypedMapping castTarget, SessionFactoryImplementor factory)
Deprecated, for removal: This API element is subject to removal in a future version.
-
getSqlTypeName
public static String getSqlTypeName(SqlTypedMapping castTarget, TypeConfiguration typeConfiguration)
-
getCastTypeName
@Deprecated(forRemoval=true) public static String getCastTypeName(SqlTypedMapping castTarget, SessionFactoryImplementor factory)
Deprecated, for removal: This API element is subject to removal in a future version.
-
getCastTypeName
public static String getCastTypeName(SqlTypedMapping castTarget, TypeConfiguration typeConfiguration)
-
visitDistinct
public void visitDistinct(Distinct distinct)
- Specified by:
visitDistinct
in interfaceSqlAstWalker
-
visitOverflow
public void visitOverflow(Overflow overflow)
- Specified by:
visitOverflow
in interfaceSqlAstWalker
-
visitParameter
public void visitParameter(JdbcParameter jdbcParameter)
- Specified by:
visitParameter
in interfaceSqlAstWalker
-
visitParameterAsParameter
protected void visitParameterAsParameter(JdbcParameter jdbcParameter)
-
renderParameterAsParameter
protected final void renderParameterAsParameter(JdbcParameter jdbcParameter)
-
renderWrappedParameter
protected void renderWrappedParameter(JdbcParameter jdbcParameter)
-
renderParameterAsParameter
protected void renderParameterAsParameter(int position, JdbcParameter jdbcParameter)
Renders a parameter marker for the given position- Parameters:
jdbcParameter
-position
-
-
render
public void render(SqlAstNode sqlAstNode, SqlAstNodeRenderingMode renderingMode)
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
protected void withParameterRenderingMode(SqlAstNodeRenderingMode renderingMode, Runnable runnable)
-
visitTuple
public void visitTuple(SqlTuple tuple)
- Specified by:
visitTuple
in interfaceSqlAstWalker
-
renderCommaSeparated
protected final void renderCommaSeparated(Iterable<? extends SqlAstNode> expressions)
-
renderCommaSeparatedSelectExpression
protected final void renderCommaSeparatedSelectExpression(Iterable<? extends SqlAstNode> expressions)
-
renderCommaSeparatedSelectExpression
protected final void renderCommaSeparatedSelectExpression(Iterable<? extends SqlAstNode> expressions, Iterable<String> aliases)
-
visitCollation
public void visitCollation(Collation collation)
- Specified by:
visitCollation
in interfaceSqlAstWalker
-
visitSqlSelectionExpression
public void visitSqlSelectionExpression(SqlSelectionExpression expression)
- Specified by:
visitSqlSelectionExpression
in interfaceSqlAstWalker
-
visitEntityTypeLiteral
public void visitEntityTypeLiteral(EntityTypeLiteral expression)
- Specified by:
visitEntityTypeLiteral
in interfaceSqlAstWalker
-
visitEmbeddableTypeLiteral
public void visitEmbeddableTypeLiteral(EmbeddableTypeLiteral expression)
- Specified by:
visitEmbeddableTypeLiteral
in interfaceSqlAstWalker
-
visitBinaryArithmeticExpression
public void visitBinaryArithmeticExpression(BinaryArithmeticExpression arithmeticExpression)
- Specified by:
visitBinaryArithmeticExpression
in interfaceSqlAstWalker
-
visitArithmeticOperand
protected void visitArithmeticOperand(Expression expression)
-
visitDuration
public void visitDuration(Duration duration)
- Specified by:
visitDuration
in interfaceSqlAstWalker
-
visitConversion
public void visitConversion(Conversion conversion)
- Specified by:
visitConversion
in interfaceSqlAstWalker
-
visitCaseSearchedExpression
public final void visitCaseSearchedExpression(CaseSearchedExpression caseSearchedExpression)
- Specified by:
visitCaseSearchedExpression
in interfaceSqlAstWalker
-
visitCaseSearchedExpression
protected void visitCaseSearchedExpression(CaseSearchedExpression caseSearchedExpression, boolean inSelect)
-
visitAnsiCaseSearchedExpression
protected void visitAnsiCaseSearchedExpression(CaseSearchedExpression caseSearchedExpression, Consumer<Expression> resultRenderer)
-
visitDecodeCaseSearchedExpression
protected void visitDecodeCaseSearchedExpression(CaseSearchedExpression caseSearchedExpression)
-
visitCaseSimpleExpression
public final void visitCaseSimpleExpression(CaseSimpleExpression caseSimpleExpression)
- Specified by:
visitCaseSimpleExpression
in interfaceSqlAstWalker
-
visitCaseSimpleExpression
protected void visitCaseSimpleExpression(CaseSimpleExpression caseSimpleExpression, boolean inSelect)
-
visitAnsiCaseSimpleExpression
protected void visitAnsiCaseSimpleExpression(CaseSimpleExpression caseSimpleExpression, Consumer<Expression> resultRenderer)
-
areAllResultsParameters
protected boolean areAllResultsParameters(CaseSearchedExpression caseSearchedExpression)
-
areAllResultsParameters
protected boolean areAllResultsParameters(CaseSimpleExpression caseSimpleExpression)
-
visitAny
public void visitAny(Any any)
- Specified by:
visitAny
in interfaceSqlAstWalker
-
visitEvery
public void visitEvery(Every every)
- Specified by:
visitEvery
in interfaceSqlAstWalker
-
visitSummarization
public void visitSummarization(Summarization every)
- Specified by:
visitSummarization
in interfaceSqlAstWalker
-
visitJdbcLiteral
public void visitJdbcLiteral(JdbcLiteral<?> jdbcLiteral)
- Specified by:
visitJdbcLiteral
in interfaceSqlAstWalker
-
visitQueryLiteral
public void visitQueryLiteral(QueryLiteral<?> queryLiteral)
- Specified by:
visitQueryLiteral
in interfaceSqlAstWalker
-
visitUnparsedNumericLiteral
public <N extends Number> void visitUnparsedNumericLiteral(UnparsedNumericLiteral<N> literal)
- Specified by:
visitUnparsedNumericLiteral
in interfaceSqlAstWalker
-
renderNull
protected void renderNull(Literal literal)
-
renderAsLiteral
protected void renderAsLiteral(JdbcParameter jdbcParameter, Object literalValue)
-
visitUnaryOperationExpression
public void visitUnaryOperationExpression(UnaryOperation unaryOperationExpression)
- Specified by:
visitUnaryOperationExpression
in interfaceSqlAstWalker
-
visitModifiedSubQueryExpression
public void visitModifiedSubQueryExpression(ModifiedSubQueryExpression expression)
- Specified by:
visitModifiedSubQueryExpression
in interfaceSqlAstWalker
-
visitSelfRenderingPredicate
public void visitSelfRenderingPredicate(SelfRenderingPredicate selfRenderingPredicate)
- Specified by:
visitSelfRenderingPredicate
in interfaceSqlAstWalker
-
visitSelfRenderingExpression
public void visitSelfRenderingExpression(SelfRenderingExpression expression)
- Specified by:
visitSelfRenderingExpression
in interfaceSqlAstWalker
-
visitBooleanExpressionPredicate
public void visitBooleanExpressionPredicate(BooleanExpressionPredicate booleanExpressionPredicate)
- Specified by:
visitBooleanExpressionPredicate
in interfaceSqlAstWalker
-
visitBetweenPredicate
public void visitBetweenPredicate(BetweenPredicate betweenPredicate)
- Specified by:
visitBetweenPredicate
in interfaceSqlAstWalker
-
visitFilterPredicate
public void visitFilterPredicate(FilterPredicate filterPredicate)
- Specified by:
visitFilterPredicate
in interfaceSqlAstWalker
-
visitFilterFragmentPredicate
public void visitFilterFragmentPredicate(FilterPredicate.FilterFragmentPredicate filter)
- Specified by:
visitFilterFragmentPredicate
in interfaceSqlAstWalker
-
visitSqlFragmentPredicate
public void visitSqlFragmentPredicate(SqlFragmentPredicate predicate)
- Specified by:
visitSqlFragmentPredicate
in interfaceSqlAstWalker
-
visitGroupedPredicate
public void visitGroupedPredicate(GroupedPredicate groupedPredicate)
- Specified by:
visitGroupedPredicate
in interfaceSqlAstWalker
-
visitInListPredicate
public void visitInListPredicate(InListPredicate inListPredicate)
- Specified by:
visitInListPredicate
in interfaceSqlAstWalker
-
visitInArrayPredicate
public void visitInArrayPredicate(InArrayPredicate inArrayPredicate)
- Specified by:
visitInArrayPredicate
in interfaceSqlAstWalker
-
visitInSubQueryPredicate
public void visitInSubQueryPredicate(InSubQueryPredicate inSubQueryPredicate)
- 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
public void visitExistsPredicate(ExistsPredicate existsPredicate)
- Specified by:
visitExistsPredicate
in interfaceSqlAstWalker
-
visitJunction
public void visitJunction(Junction junction)
- Specified by:
visitJunction
in interfaceSqlAstWalker
-
visitLikePredicate
public void visitLikePredicate(LikePredicate likePredicate)
- 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
public void visitNegatedPredicate(NegatedPredicate negatedPredicate)
- Specified by:
visitNegatedPredicate
in interfaceSqlAstWalker
-
visitNullnessPredicate
public void visitNullnessPredicate(NullnessPredicate nullnessPredicate)
- Specified by:
visitNullnessPredicate
in interfaceSqlAstWalker
-
visitThruthnessPredicate
public void visitThruthnessPredicate(ThruthnessPredicate thruthnessPredicate)
- Specified by:
visitThruthnessPredicate
in interfaceSqlAstWalker
-
visitRelationalPredicate
public void visitRelationalPredicate(ComparisonPredicate comparisonPredicate)
- 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
-
getFromDual
@Deprecated(forRemoval=true) protected String getFromDual()
Deprecated, for removal: This API element is subject to removal in a future version.UsegetDual()
insteadSome databases require a bit of syntactic noise when there are no tables in the from clause.- Returns:
- the SQL equivalent to Oracle's
from dual
.
-
getDual
protected String getDual()
Returns a table expression that has one row.- Returns:
- the SQL equivalent to Oracle's
dual
.
-
getFromDualForSelectOnly
protected String getFromDualForSelectOnly()
-
visitStandardTableInsert
public void visitStandardTableInsert(TableInsertStandard tableInsert)
- Specified by:
visitStandardTableInsert
in interfaceSqlAstWalker
-
renderIntoIntoAndTable
protected void renderIntoIntoAndTable(TableInsertStandard tableInsert)
Renders theinsert into <table name>
portion of an insert
-
renderInsertIntoNoColumns
protected void renderInsertIntoNoColumns(TableInsertStandard tableInsert)
Handle rendering an insert with no columns
-
visitCustomTableInsert
public void visitCustomTableInsert(TableInsertCustomSql tableInsert)
- Specified by:
visitCustomTableInsert
in interfaceSqlAstWalker
-
visitStandardTableUpdate
public void visitStandardTableUpdate(TableUpdateStandard tableUpdate)
- Specified by:
visitStandardTableUpdate
in interfaceSqlAstWalker
-
visitOptionalTableUpdate
public void visitOptionalTableUpdate(OptionalTableUpdate tableUpdate)
- Specified by:
visitOptionalTableUpdate
in interfaceSqlAstWalker
-
visitCustomTableUpdate
public void visitCustomTableUpdate(TableUpdateCustomSql tableUpdate)
- Specified by:
visitCustomTableUpdate
in interfaceSqlAstWalker
-
visitStandardTableDelete
public void visitStandardTableDelete(TableDeleteStandard tableDelete)
- Specified by:
visitStandardTableDelete
in interfaceSqlAstWalker
-
visitCustomTableDelete
public void visitCustomTableDelete(TableDeleteCustomSql tableDelete)
- Specified by:
visitCustomTableDelete
in interfaceSqlAstWalker
-
applyParameter
protected void applyParameter(ColumnValueParameter parameter)
-
visitColumnWriteFragment
public void visitColumnWriteFragment(ColumnWriteFragment columnWriteFragment)
- Specified by:
visitColumnWriteFragment
in interfaceSqlAstWalker
-
simpleColumnWriteFragmentRendering
protected void simpleColumnWriteFragmentRendering(ColumnWriteFragment columnWriteFragment)
-
-