Package org.hibernate.dialect
Class CockroachSqlAstTranslator<T extends JdbcOperation>
- java.lang.Object
-
- org.hibernate.sql.ast.spi.AbstractSqlAstTranslator<T>
-
- org.hibernate.dialect.CockroachSqlAstTranslator<T>
-
- All Implemented Interfaces:
Appendable
,SqlAppender
,SqlAstTranslator<T>
,SqlAstWalker
public class CockroachSqlAstTranslator<T extends JdbcOperation> extends AbstractSqlAstTranslator<T>
A SQL AST translator for Cockroach.
-
-
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, COMMA_SEPARATOR, COMMA_SEPARATOR_CHAR, NO_SEPARATOR, NULL_KEYWORD, OPEN_PARENTHESIS, PARAM_MARKER, WHITESPACE
-
-
Constructor Summary
Constructors Constructor Description CockroachSqlAstTranslator(SessionFactoryImplementor sessionFactory, Statement statement)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
getForShare(int timeoutMillis)
protected void
renderDmlTargetTableExpression(NamedTableReference tableReference)
protected void
renderExpressionAsClauseItem(Expression expression)
protected void
renderFromClauseAfterUpdateSet(UpdateStatement statement)
protected void
renderMaterializationHint(CteMaterialization materialization)
protected void
renderPartitionItem(Expression expression)
protected void
renderTableReferenceIdentificationVariable(TableReference tableReference)
protected boolean
shouldEmulateFetchClause(QueryPart queryPart)
protected boolean
supportsArrayConstructor()
Whether the SQL array constructor is supported.protected boolean
supportsRowConstructor()
Whether the SQL row constructor is supported.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 JdbcOperationQueryInsert
translateInsert(InsertSelectStatement sqlAst)
void
visitBinaryArithmeticExpression(BinaryArithmeticExpression arithmeticExpression)
void
visitBooleanExpressionPredicate(BooleanExpressionPredicate booleanExpressionPredicate)
protected void
visitConflictClause(ConflictClause conflictClause)
void
visitInArrayPredicate(InArrayPredicate inArrayPredicate)
void
visitLikePredicate(LikePredicate likePredicate)
void
visitOffsetFetchClause(QueryPart queryPart)
void
visitQueryGroup(QueryGroup queryGroup)
void
visitQuerySpec(QuerySpec querySpec)
-
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, createRowMatchingPredicate, determineColumnReferenceQualifier, determineCyclePathColumnName, determineLateralEmulationPredicate, determineLockingStrategy, determineWhereClauseRestrictionWithJoinEmulation, determineWhereClauseRestrictionWithJoinEmulation, emulateCycleClauseWithRowAndArray, emulateFetchOffsetWithWindowFunctions, emulateFetchOffsetWithWindowFunctions, emulateFetchOffsetWithWindowFunctionsVisitQueryPart, emulateQuantifiedTupleSubQueryPredicate, emulateQueryPartTableReferenceColumnAliasing, emulateSearchClauseOrderWithRowAndArray, emulateSelectTupleComparison, emulateSortSpecificationNullPrecedence, emulateSubQueryRelationalRestrictionPredicate, emulateTupleComparison, emulateValuesTableReferenceColumnAliasing, getAffectedTableNames, getAppliedParameterBindings, getArrayContainsFunction, getBooleanType, getCastTypeName, getCastTypeName, getClauseStack, getCteStatement, getCurrentClauseStack, getCurrentCteStatement, getCurrentDmlStatement, getCurrentQueryPart, getDialect, getDual, getEffectiveLockMode, getEffectiveLockMode, getEffectiveLockTimeout, getFetchClauseTypeForRowNumbering, getForUpdate, getForUpdateWithClause, getFromDual, getFromDualForSelectOnly, getIntegerType, getJdbcLockStrategy, getJdbcParameterBindings, getJdbcServices, getLeftHandExpression, getLimit, getLimitParameter, getLockOptions, getMaxRows, getNoWait, getOffsetParameter, getParameterBinders, getParameterBindValue, getParameterRenderingMode, getQueryPartForRowNumbering, getQueryPartStack, getRowsToSkip, getSelectItemReference, getSessionFactory, getSkipLocked, getSortSpecificationsRowNumbering, getSql, getSqlAppender, getSqlBuffer, getSqlTypeName, getSqlTypeName, getStatement, getStatementStack, getStringType, getUniqueConstraintNameThatMayFail, getWrapperOptions, hasAggregateFunctions, hasLimit, hasLimit, hasNestedTableGroupsToRender, hasNonTrivialFromClause, hasOffset, inlineCteTableGroup, inOverOrWithinGroupClause, interpretExpression, isCorrelated, isInRecursiveQueryPart, isInSubquery, isIntegerDivisionEmulationRequired, isLiteral, isParameter, isRowNumberingCurrentQueryPart, isRowsOnlyFetchClauseType, isStruct, needsCteInlining, needsLocking, needsMaxRows, needsRecursiveKeywordInWithClause, needsRowsToSkip, prepareLimitOffsetParameters, processNestedTableGroupJoins, processTableGroupJoin, processTableGroupJoins, registerAffectedTable, registerAffectedTable, render, renderAsLiteral, renderBackslashEscapedLikePattern, renderCaseInsensitiveLikeEmulation, renderCasted, renderCombinedLimitClause, renderCombinedLimitClause, renderCommaSeparated, renderCommaSeparatedSelectExpression, renderCommaSeparatedSelectExpression, renderComparison, renderComparisonDistinctOperator, renderComparisonEmulateCase, renderComparisonEmulateDecode, renderComparisonEmulateDecode, renderComparisonEmulateIntersect, renderComparisonStandard, renderCteColumns, renderCycleClause, renderDeleteClause, renderDerivedTableReference, renderDmlTargetTableGroup, renderExpressionAsLiteral, renderExpressionsAsSubquery, renderFetch, renderFetchExpression, renderFetchPlusOffsetExpression, renderFetchPlusOffsetExpressionAsLiteral, renderFetchPlusOffsetExpressionAsSingleParameter, renderFirstClause, renderFirstClause, renderFirstSkipClause, renderFirstSkipClause, renderForUpdateClause, renderFromClauseExcludingDmlTargetReference, renderFromClauseJoiningDmlTargetReference, renderFromClauseSpaces, renderInsertIntoNoColumns, renderIntoIntoAndTable, renderLimitOffsetClause, renderLimitOffsetClause, renderLiteral, renderMergeUpdateClause, renderNamedTableReference, renderNull, renderOffset, renderOffsetExpression, renderOffsetFetchClause, renderOffsetFetchClause, renderOrderBy, renderParameterAsParameter, renderParameterAsParameter, renderPrimaryTableReference, renderQueryGroup, renderRecursiveCteVirtualSelections, renderRootTableGroup, renderRowNumber, renderRowNumberingSelectItems, renderRowsToClause, renderRowsToClause, renderSearchClause, renderSelectExpression, renderSelectExpressionWithCastedOrInlinedPlainParameters, renderSelectSimpleComparison, renderSelectTupleComparison, renderSetClause, renderSkipFirstClause, renderSkipFirstClause, renderSortExpression, renderStandardCycleClause, renderStandardSearchClause, renderStringContainsExactlyPredicate, renderTableGroup, renderTableGroupJoin, renderTableReferenceJoins, renderTableReferenceJoins, renderTopClause, renderTopClause, renderTopStartAtClause, renderTopStartAtClause, renderTupleComparisonStandard, renderUpdateClause, renderVirtualSelections, renderWrappedParameter, resolveAliasedExpression, resolveAliasedExpression, resolveExpressionToAlias, setLimitParameter, setOffsetParameter, shouldEmulateLateralWithIntersect, shouldInlineCte, simpleColumnWriteFragmentRendering, supportsDistinctFromPredicate, supportsDuplicateSelectItemsInQueryGroup, supportsFilterClause, supportsIntersect, supportsJoinInMutationStatementSubquery, supportsJoinsInDelete, supportsNestedSubqueryCorrelation, supportsNestedWithClause, supportsNullPrecedence, supportsQuantifiedPredicates, supportsRecursiveClauseArrayAndRowEmulation, supportsRecursiveCycleClause, supportsRecursiveCycleUsingClause, supportsRecursiveSearchClause, supportsRowValueConstructorDistinctFromSyntax, supportsRowValueConstructorGtLtSyntax, supportsRowValueConstructorSyntax, supportsRowValueConstructorSyntaxInInList, supportsRowValueConstructorSyntaxInInSubQuery, supportsRowValueConstructorSyntaxInSet, supportsSimpleQueryGrouping, supportsWithClause, supportsWithClauseInSubquery, translate, translateDelete, translateSelect, translateUpdate, useOffsetFetchClause, visitAggregateColumnWriteExpression, visitAnsiCaseSearchedExpression, visitAnsiCaseSimpleExpression, visitAny, visitArithmeticOperand, visitAssignment, visitBetweenPredicate, visitCaseSearchedExpression, visitCaseSearchedExpression, visitCaseSimpleExpression, visitCaseSimpleExpression, visitCastTarget, visitCollation, visitColumnReference, visitColumnWriteFragment, visitConversion, visitCteContainer, visitCteDefinition, visitCteObject, visitCustomTableDelete, visitCustomTableInsert, visitCustomTableUpdate, visitDecodeCaseSearchedExpression, visitDeleteStatement, visitDeleteStatementOnly, visitDistinct, visitDuration, visitDurationUnit, visitEmbeddableTypeLiteral, visitEntityTypeLiteral, visitEvery, visitExistsPredicate, visitExtractUnit, visitFilterFragmentPredicate, visitFilterPredicate, visitFormat, visitForUpdateClause, visitFromClause, visitFunctionTableReference, visitGroupByClause, visitGroupedPredicate, visitHavingClause, visitInListPredicate, visitInsertSource, visitInsertStatement, visitInsertStatementEmulateMerge, visitInsertStatementOnly, visitInSubQueryPredicate, visitJdbcLiteral, visitJunction, visitModifiedSubQueryExpression, visitNamedTableReference, visitNegatedPredicate, visitNestedColumnReference, visitNullnessPredicate, visitOnDuplicateKeyConflictClause, visitOptionalTableUpdate, visitOrderBy, visitOver, visitOverClause, visitOverClause, visitOverflow, visitParameter, visitParameterAsParameter, visitPartitionByClause, visitPartitionExpressions, visitPartitionExpressions, visitQueryLiteral, visitQueryPartTableReference, visitRecursivePath, visitRelationalPredicate, visitReturningColumns, visitReturningColumns, visitSelectClause, visitSelectStatement, visitSelfRenderingExpression, visitSelfRenderingPredicate, visitSetAssignment, visitSetAssignmentEmulateJoin, visitSortSpecification, visitSortSpecification, visitSqlFragmentPredicate, visitSqlSelectExpression, visitSqlSelection, visitSqlSelectionExpression, visitSqlSelections, visitStandardConflictClause, visitStandardTableDelete, visitStandardTableInsert, visitStandardTableUpdate, visitStar, visitSummarization, visitTableGroup, visitTableGroupJoin, visitTableReferenceJoin, visitThruthnessPredicate, visitTrimSpecification, visitTuple, visitUnaryOperationExpression, visitUnparsedNumericLiteral, visitUpdateStatement, visitUpdateStatementEmulateInlineView, visitUpdateStatementEmulateMerge, visitUpdateStatementEmulateTupleSet, visitUpdateStatementOnly, visitValuesList, visitValuesListEmulateSelectUnion, visitValuesListStandard, visitValuesTableReference, visitWhereClause, withParameterRenderingMode, withRowNumbering
-
-
-
-
Constructor Detail
-
CockroachSqlAstTranslator
public CockroachSqlAstTranslator(SessionFactoryImplementor sessionFactory, Statement statement)
-
-
Method Detail
-
visitBinaryArithmeticExpression
public void visitBinaryArithmeticExpression(BinaryArithmeticExpression arithmeticExpression)
- Specified by:
visitBinaryArithmeticExpression
in interfaceSqlAstWalker
- Overrides:
visitBinaryArithmeticExpression
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
translateInsert
protected JdbcOperationQueryInsert translateInsert(InsertSelectStatement sqlAst)
- Overrides:
translateInsert
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
renderTableReferenceIdentificationVariable
protected void renderTableReferenceIdentificationVariable(TableReference tableReference)
- Overrides:
renderTableReferenceIdentificationVariable
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
renderDmlTargetTableExpression
protected void renderDmlTargetTableExpression(NamedTableReference tableReference)
- Overrides:
renderDmlTargetTableExpression
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
renderFromClauseAfterUpdateSet
protected void renderFromClauseAfterUpdateSet(UpdateStatement statement)
- Overrides:
renderFromClauseAfterUpdateSet
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitConflictClause
protected void visitConflictClause(ConflictClause conflictClause)
- Overrides:
visitConflictClause
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
renderExpressionAsClauseItem
protected void renderExpressionAsClauseItem(Expression expression)
- Overrides:
renderExpressionAsClauseItem
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitBooleanExpressionPredicate
public void visitBooleanExpressionPredicate(BooleanExpressionPredicate booleanExpressionPredicate)
- Specified by:
visitBooleanExpressionPredicate
in interfaceSqlAstWalker
- Overrides:
visitBooleanExpressionPredicate
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
renderMaterializationHint
protected void renderMaterializationHint(CteMaterialization materialization)
- Overrides:
renderMaterializationHint
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
supportsRowConstructor
protected boolean supportsRowConstructor()
Description copied from class:AbstractSqlAstTranslator
Whether the SQL row constructor is supported.- Overrides:
supportsRowConstructor
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
supportsArrayConstructor
protected boolean supportsArrayConstructor()
Description copied from class:AbstractSqlAstTranslator
Whether the SQL array constructor is supported.- Overrides:
supportsArrayConstructor
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
getForShare
protected String getForShare(int timeoutMillis)
- Overrides:
getForShare
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
shouldEmulateFetchClause
protected boolean shouldEmulateFetchClause(QueryPart queryPart)
-
visitQueryGroup
public void visitQueryGroup(QueryGroup queryGroup)
- Specified by:
visitQueryGroup
in interfaceSqlAstWalker
- Overrides:
visitQueryGroup
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitQuerySpec
public void visitQuerySpec(QuerySpec querySpec)
- Specified by:
visitQuerySpec
in interfaceSqlAstWalker
- Overrides:
visitQuerySpec
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitOffsetFetchClause
public void visitOffsetFetchClause(QueryPart queryPart)
- Specified by:
visitOffsetFetchClause
in interfaceSqlAstWalker
- Overrides:
visitOffsetFetchClause
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
renderPartitionItem
protected void renderPartitionItem(Expression expression)
- Overrides:
renderPartitionItem
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitLikePredicate
public void visitLikePredicate(LikePredicate likePredicate)
- Specified by:
visitLikePredicate
in interfaceSqlAstWalker
- Overrides:
visitLikePredicate
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
supportsRowValueConstructorSyntaxInQuantifiedPredicates
protected boolean supportsRowValueConstructorSyntaxInQuantifiedPredicates()
Description copied from class:AbstractSqlAstTranslator
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 ...) ...
- Overrides:
supportsRowValueConstructorSyntaxInQuantifiedPredicates
in classAbstractSqlAstTranslator<T extends JdbcOperation>
- Returns:
- True if this SQL dialect is known to support "row value constructor" syntax with quantified predicates; false otherwise.
-
visitInArrayPredicate
public void visitInArrayPredicate(InArrayPredicate inArrayPredicate)
- Specified by:
visitInArrayPredicate
in interfaceSqlAstWalker
- Overrides:
visitInArrayPredicate
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
-