Package org.hibernate.dialect
Class TiDBSqlAstTranslator<T extends JdbcOperation>
- java.lang.Object
-
- org.hibernate.sql.ast.spi.AbstractSqlAstTranslator<T>
-
- org.hibernate.dialect.TiDBSqlAstTranslator<T>
-
- All Implemented Interfaces:
Appendable,SqlAppender,SqlAstTranslator<T>,SqlAstWalker
public class TiDBSqlAstTranslator<T extends JdbcOperation> extends AbstractSqlAstTranslator<T>
A SQL AST translator for TiDB.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.hibernate.sql.ast.spi.AbstractSqlAstTranslator
AbstractSqlAstTranslator.ForUpdateClause, AbstractSqlAstTranslator.LockStrategy, AbstractSqlAstTranslator.SubQueryRelationalRestrictionEmulationRenderer<X extends Expression>
-
-
Field Summary
-
Fields inherited from interface org.hibernate.sql.ast.spi.SqlAppender
CLOSE_PARENTHESIS, COMA_SEPARATOR, COMA_SEPARATOR_CHAR, NO_SEPARATOR, NULL_KEYWORD, OPEN_PARENTHESIS, PARAM_MARKER, WHITESPACE
-
-
Constructor Summary
Constructors Constructor Description TiDBSqlAstTranslator(SessionFactoryImplementor sessionFactory, Statement statement)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TiDBDialectgetDialect()protected StringgetForShare(int timeoutMillis)protected StringgetFromDual()Some databases require a bit of syntactic noise when there are no tables in the from clause.protected voidrenderComparison(Expression lhs, ComparisonOperator operator, Expression rhs)protected voidrenderExpressionAsClauseItem(Expression expression)protected voidrenderPartitionItem(Expression expression)protected booleanshouldEmulateFetchClause(QueryPart queryPart)booleansupportsRowValueConstructorSyntaxInInList()If the dialect supportsrow values, does it offer such support in IN lists as well?protected booleansupportsRowValueConstructorSyntaxInQuantifiedPredicates()Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax; sometimes called tuple syntax with quantified predicates.booleansupportsRowValueConstructorSyntaxInSet()Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax, sometimes called tuple syntax, in the SET clause;voidvisitBooleanExpressionPredicate(BooleanExpressionPredicate booleanExpressionPredicate)voidvisitCastTarget(CastTarget castTarget)voidvisitLikePredicate(LikePredicate likePredicate)voidvisitOffsetFetchClause(QueryPart queryPart)voidvisitQueryGroup(QueryGroup queryGroup)voidvisitQueryPartTableReference(QueryPartTableReference tableReference)voidvisitQuerySpec(QuerySpec querySpec)voidvisitValuesTableReference(ValuesTableReference tableReference)-
Methods inherited from class org.hibernate.sql.ast.spi.AbstractSqlAstTranslator
addAdditionalWherePredicate, addAppliedParameterBinding, append, append, append, appendBackslashEscapedLikeLiteral, appendSql, appendSql, appendSql, appendSql, appendSql, applyParameter, areAllResultsParameters, areAllResultsParameters, assertRowsOnlyFetchClauseType, castFunction, castNumberToString, cleanup, determineCyclePathColumnName, determineLateralEmulationPredicate, determineLockingStrategy, emulateCycleClauseWithRowAndArray, emulateFetchOffsetWithWindowFunctions, emulateFetchOffsetWithWindowFunctions, emulateFetchOffsetWithWindowFunctionsVisitQueryPart, emulateQuantifiedTupleSubQueryPredicate, emulateQueryPartTableReferenceColumnAliasing, emulateSearchClauseOrderWithRowAndArray, emulateSelectTupleComparison, emulateSortSpecificationNullPrecedence, emulateSubQueryRelationalRestrictionPredicate, emulateTupleComparison, emulateValuesTableReferenceColumnAliasing, getAffectedTableNames, getAppliedParameterBindings, getArrayContainsFunction, getBooleanType, getClauseStack, getCteStatement, getCurrentClauseStack, getCurrentCteStatement, getCurrentDmlStatement, getCurrentQueryPart, getDmlTargetTableAlias, getEffectiveLockMode, getEffectiveLockTimeout, getFetchClauseTypeForRowNumbering, getFilterJdbcParameters, getForUpdate, getForUpdateWithClause, getFromDualForSelectOnly, getIntegerType, getJdbcLockStrategy, getJdbcParameterBindings, getJdbcServices, getLeftHandExpression, getLimit, getLimitParameter, getLockOptions, getMaxRows, getNoWait, getOffsetParameter, getParameterBinders, getParameterBindValue, getParameterRenderingMode, getQueryPartForRowNumbering, getQueryPartStack, getRowsToSkip, getSelectItemReference, getSessionFactory, getSkipLocked, getSortSpecificationsRowNumbering, getSql, getSqlAppender, getStatement, getStringType, getWrapperOptions, hasAggregateFunctions, hasLimit, hasNestedTableGroupsToRender, hasOffset, inlineCteTableGroup, inOverOrWithinGroupClause, interpretExpression, isCorrelated, isInRecursiveQueryPart, isLiteral, isParameter, isRowNumberingCurrentQueryPart, isRowsOnlyFetchClauseType, isStruct, needsCteInlining, needsMaxRows, needsRecursiveKeywordInWithClause, needsRowsToSkip, prepareLimitOffsetParameters, processNestedTableGroupJoins, processTableGroupJoin, processTableGroupJoins, registerAffectedTable, registerAffectedTable, render, renderAsLiteral, renderBackslashEscapedLikePattern, renderCaseInsensitiveLikeEmulation, renderCasted, renderCombinedLimitClause, renderCombinedLimitClause, renderCommaSeparated, renderCommaSeparatedSelectExpression, renderCommaSeparatedSelectExpression, renderComparisonDistinctOperator, renderComparisonEmulateCase, renderComparisonEmulateDecode, renderComparisonEmulateIntersect, renderComparisonStandard, renderCteColumns, renderCycleClause, renderDerivedTableReference, renderExpressionAsLiteral, renderExpressionsAsSubquery, renderFetch, renderFetchExpression, renderFetchPlusOffsetExpression, renderFetchPlusOffsetExpressionAsLiteral, renderFetchPlusOffsetExpressionAsSingleParameter, renderFirstClause, renderFirstClause, renderFirstSkipClause, renderFirstSkipClause, renderForUpdateClause, renderInsertIntoNoColumns, renderIntoIntoAndTable, renderLimitOffsetClause, renderLimitOffsetClause, renderLiteral, renderMaterializationHint, renderNamedTableReference, renderOffset, renderOffsetExpression, renderOffsetFetchClause, renderOffsetFetchClause, renderOrderBy, renderPrimaryTableReference, renderQueryGroup, renderRecursiveCteVirtualSelections, renderRootTableGroup, renderRowNumber, renderRowNumberingSelectItems, renderRowsToClause, renderRowsToClause, renderSearchClause, renderSelectExpression, renderSelectExpressionWithCastedOrInlinedPlainParameters, renderSelectSimpleComparison, renderSelectTupleComparison, renderSetClause, renderSkipFirstClause, renderSkipFirstClause, rendersTableReferenceAlias, renderStandardCycleClause, renderStandardSearchClause, renderTableGroup, renderTableGroupJoin, renderTableReferenceIdentificationVariable, renderTableReferenceJoins, renderTopClause, renderTopClause, renderTopStartAtClause, renderTopStartAtClause, renderTupleComparisonStandard, renderVirtualSelections, resolveAliasedExpression, resolveAliasedExpression, resolveExpressionToAlias, setLimitParameter, setOffsetParameter, shouldEmulateLateralWithIntersect, shouldInlineCte, supportsArrayConstructor, supportsDistinctFromPredicate, supportsDuplicateSelectItemsInQueryGroup, supportsFilterClause, supportsIntersect, supportsNestedSubqueryCorrelation, supportsNestedWithClause, supportsNullPrecedence, supportsQuantifiedPredicates, supportsRecursiveClauseArrayAndRowEmulation, supportsRecursiveCycleClause, supportsRecursiveCycleUsingClause, supportsRecursiveSearchClause, supportsRowConstructor, supportsRowValueConstructorDistinctFromSyntax, supportsRowValueConstructorGtLtSyntax, supportsRowValueConstructorSyntax, supportsRowValueConstructorSyntaxInInSubQuery, supportsSimpleQueryGrouping, supportsWithClause, supportsWithClauseInSubquery, translate, translateDelete, translateInsert, translateSelect, translateUpdate, useOffsetFetchClause, visitAggregateColumnWriteExpression, visitAnsiCaseSearchedExpression, visitAnsiCaseSimpleExpression, visitAny, visitAssignment, visitBetweenPredicate, visitBinaryArithmeticExpression, visitCaseSearchedExpression, visitCaseSearchedExpression, visitCaseSimpleExpression, visitCaseSimpleExpression, visitCollation, visitColumnReference, visitColumnWriteFragment, visitConversion, visitCteContainer, visitCteDefinition, visitCustomTableDelete, visitCustomTableInsert, visitCustomTableUpdate, visitDecodeCaseSearchedExpression, visitDeleteStatement, visitDeleteStatementOnly, visitDistinct, visitDuration, visitDurationUnit, visitEntityTypeLiteral, visitEvery, visitExistsPredicate, visitExtractUnit, visitFilterFragmentPredicate, visitFilterPredicate, visitFormat, visitForUpdateClause, visitFromClause, visitFunctionTableReference, visitGroupByClause, visitGroupedPredicate, visitHavingClause, visitInListPredicate, visitInsertStatement, visitInsertStatementOnly, visitInSubQueryPredicate, visitJdbcLiteral, visitJunction, visitModifiedSubQueryExpression, visitNamedTableReference, visitNegatedPredicate, visitNullnessPredicate, visitOrderBy, visitOver, visitOverClause, visitOverClause, visitOverflow, visitParameter, visitPartitionByClause, visitPartitionExpressions, visitPartitionExpressions, visitQueryLiteral, visitRecursivePath, visitRelationalPredicate, visitReturningColumns, visitReturningColumns, visitSelectClause, visitSelectStatement, visitSelfRenderingExpression, visitSelfRenderingPredicate, visitSetAssignment, visitSortSpecification, visitSortSpecification, visitSqlFragmentPredicate, visitSqlSelectExpression, visitSqlSelection, visitSqlSelectionExpression, visitSqlSelections, visitStandardTableDelete, visitStandardTableInsert, visitStandardTableUpdate, visitStar, visitSummarization, visitTableGroup, visitTableGroupJoin, visitTableReferenceJoin, visitTrimSpecification, visitTuple, visitUnaryOperationExpression, visitUpdateStatement, visitUpdateStatementOnly, visitValuesList, visitWhereClause, withParameterRenderingMode, withRowNumbering
-
-
-
-
Constructor Detail
-
TiDBSqlAstTranslator
public TiDBSqlAstTranslator(SessionFactoryImplementor sessionFactory, Statement statement)
-
-
Method Detail
-
renderExpressionAsClauseItem
protected void renderExpressionAsClauseItem(Expression expression)
- Overrides:
renderExpressionAsClauseItemin classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitBooleanExpressionPredicate
public void visitBooleanExpressionPredicate(BooleanExpressionPredicate booleanExpressionPredicate)
- Specified by:
visitBooleanExpressionPredicatein interfaceSqlAstWalker- Overrides:
visitBooleanExpressionPredicatein classAbstractSqlAstTranslator<T extends JdbcOperation>
-
shouldEmulateFetchClause
protected boolean shouldEmulateFetchClause(QueryPart queryPart)
-
visitQueryGroup
public void visitQueryGroup(QueryGroup queryGroup)
- Specified by:
visitQueryGroupin interfaceSqlAstWalker- Overrides:
visitQueryGroupin classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitQuerySpec
public void visitQuerySpec(QuerySpec querySpec)
- Specified by:
visitQuerySpecin interfaceSqlAstWalker- Overrides:
visitQuerySpecin classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitValuesTableReference
public void visitValuesTableReference(ValuesTableReference tableReference)
- Specified by:
visitValuesTableReferencein interfaceSqlAstWalker- Overrides:
visitValuesTableReferencein classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitQueryPartTableReference
public void visitQueryPartTableReference(QueryPartTableReference tableReference)
- Specified by:
visitQueryPartTableReferencein interfaceSqlAstWalker- Overrides:
visitQueryPartTableReferencein classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitOffsetFetchClause
public void visitOffsetFetchClause(QueryPart queryPart)
- Specified by:
visitOffsetFetchClausein interfaceSqlAstWalker- Overrides:
visitOffsetFetchClausein classAbstractSqlAstTranslator<T extends JdbcOperation>
-
renderComparison
protected void renderComparison(Expression lhs, ComparisonOperator operator, Expression rhs)
- Overrides:
renderComparisonin classAbstractSqlAstTranslator<T extends JdbcOperation>
-
renderPartitionItem
protected void renderPartitionItem(Expression expression)
- Overrides:
renderPartitionItemin classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitLikePredicate
public void visitLikePredicate(LikePredicate likePredicate)
- Specified by:
visitLikePredicatein interfaceSqlAstWalker- Overrides:
visitLikePredicatein classAbstractSqlAstTranslator<T extends JdbcOperation>
-
supportsRowValueConstructorSyntaxInSet
public boolean supportsRowValueConstructorSyntaxInSet()
Description copied from class:AbstractSqlAstTranslatorIs 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') ...".
- Overrides:
supportsRowValueConstructorSyntaxInSetin classAbstractSqlAstTranslator<T extends JdbcOperation>- Returns:
- True if this SQL dialect is known to support "row value constructor" syntax in the SET clause; false otherwise.
-
supportsRowValueConstructorSyntaxInInList
public boolean supportsRowValueConstructorSyntaxInInList()
Description copied from class:AbstractSqlAstTranslatorIf the dialect supportsrow values, does it offer such support in IN lists as well?For example, "... where (FIRST_NAME, LAST_NAME) IN ( (?, ?), (?, ?) ) ..."
- Overrides:
supportsRowValueConstructorSyntaxInInListin classAbstractSqlAstTranslator<T extends JdbcOperation>- Returns:
- True if this SQL dialect is known to support "row value constructor" syntax in the IN list; false otherwise.
-
supportsRowValueConstructorSyntaxInQuantifiedPredicates
protected boolean supportsRowValueConstructorSyntaxInQuantifiedPredicates()
Description copied from class:AbstractSqlAstTranslatorIs 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 ...) ...".
- Overrides:
supportsRowValueConstructorSyntaxInQuantifiedPredicatesin classAbstractSqlAstTranslator<T extends JdbcOperation>- Returns:
- True if this SQL dialect is known to support "row value constructor" syntax with quantified predicates; false otherwise.
-
getFromDual
protected String getFromDual()
Description copied from class:AbstractSqlAstTranslatorSome databases require a bit of syntactic noise when there are no tables in the from clause.- Overrides:
getFromDualin classAbstractSqlAstTranslator<T extends JdbcOperation>- Returns:
- the SQL equivalent to Oracle's
from dual.
-
getForShare
protected String getForShare(int timeoutMillis)
- Overrides:
getForSharein classAbstractSqlAstTranslator<T extends JdbcOperation>
-
getDialect
public TiDBDialect getDialect()
- Overrides:
getDialectin classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitCastTarget
public void visitCastTarget(CastTarget castTarget)
- Specified by:
visitCastTargetin interfaceSqlAstWalker- Overrides:
visitCastTargetin classAbstractSqlAstTranslator<T extends JdbcOperation>
-
-