Package org.hibernate.dialect
Class H2SqlAstTranslator<T extends JdbcOperation>
- java.lang.Object
-
- org.hibernate.sql.ast.spi.AbstractSqlAstTranslator<T>
-
- org.hibernate.dialect.SqlAstTranslatorWithMerge<T>
-
- org.hibernate.dialect.H2SqlAstTranslator<T>
-
- All Implemented Interfaces:
Appendable
,SqlAppender
,SqlAstTranslator<T>
,SqlAstWalker
public class H2SqlAstTranslator<T extends JdbcOperation> extends SqlAstTranslatorWithMerge<T>
A SQL AST translator for H2.
-
-
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 H2SqlAstTranslator(SessionFactoryImplementor sessionFactory, Statement statement)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected String
getArrayContainsFunction()
Returns the name of thearray_contains(array, element)
function, which is used for emulating the cycle clause.protected boolean
needsCteInlining()
Whether CTEs should be inlined rather than rendered as CTEs.protected void
renderDmlTargetTableExpression(NamedTableReference tableReference)
protected void
renderExpressionAsClauseItem(Expression expression)
protected void
renderPartitionItem(Expression expression)
protected boolean
renderPrimaryTableReference(TableGroup tableGroup, LockMode lockMode)
protected boolean
renderReturningClause(List<ColumnReference> returningColumns)
protected void
renderSelectTupleComparison(List<SqlSelection> lhsExpressions, SqlTuple tuple, ComparisonOperator operator)
protected boolean
shouldInlineCte(TableGroup tableGroup)
Whether CTEs should be inlined rather than rendered as CTEs.protected boolean
supportsArrayConstructor()
Whether the SQL array constructor is supported.boolean
supportsFilterClause()
Whether the FILTER clause for aggregate functions is supported.protected boolean
supportsJoinInMutationStatementSubquery()
If the dialect supports using joins in mutation statement subquery that could also use columns from the mutation target tableprotected boolean
supportsNullPrecedence()
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
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
supportsRowValueConstructorSyntaxInQuantifiedPredicates()
Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax; sometimes called tuple syntax with quantified predicates.protected boolean
supportsWithClauseInSubquery()
Whether the SQL with clause is supported within a subquery.protected void
visitArithmeticOperand(Expression expression)
void
visitBinaryArithmeticExpression(BinaryArithmeticExpression arithmeticExpression)
void
visitBooleanExpressionPredicate(BooleanExpressionPredicate booleanExpressionPredicate)
protected void
visitConflictClause(ConflictClause conflictClause)
void
visitCteContainer(CteContainer cteContainer)
protected void
visitDeleteStatementOnly(DeleteStatement statement)
protected void
visitInsertStatementOnly(InsertSelectStatement statement)
void
visitLikePredicate(LikePredicate likePredicate)
void
visitOffsetFetchClause(QueryPart queryPart)
protected void
visitReturningColumns(List<ColumnReference> returningColumns)
void
visitReturningInsertStatement(TableInsertStandard tableInsert)
Deprecated, for removal: This API element is subject to removal in a future version.protected void
visitSqlSelections(SelectClause selectClause)
void
visitStandardTableInsert(TableInsertStandard tableInsert)
void
visitStandardTableUpdate(TableUpdateStandard tableUpdate)
protected void
visitUpdateStatementOnly(UpdateStatement statement)
-
Methods inherited from class org.hibernate.dialect.SqlAstTranslatorWithMerge
createMergeOperation, renderMergeDelete, renderMergeInsert, renderMergeInto, renderMergeOn, renderMergeSourceAlias, renderMergeStatement, renderMergeTargetAlias, renderMergeUpdate, renderMergeUsing, renderMergeUsingQuerySelection
-
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, getBooleanType, getCastTypeName, getCastTypeName, getClauseStack, getCteStatement, getCurrentClauseStack, getCurrentCteStatement, getCurrentDmlStatement, getCurrentQueryPart, getDialect, getDual, getEffectiveLockMode, getEffectiveLockMode, getEffectiveLockTimeout, getFetchClauseTypeForRowNumbering, getForShare, 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, 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, renderFromClauseAfterUpdateSet, renderFromClauseExcludingDmlTargetReference, renderFromClauseJoiningDmlTargetReference, renderFromClauseSpaces, renderInsertIntoNoColumns, renderIntoIntoAndTable, renderLimitOffsetClause, renderLimitOffsetClause, renderLiteral, renderMaterializationHint, renderMergeUpdateClause, renderNamedTableReference, renderNull, renderOffset, renderOffsetExpression, renderOffsetFetchClause, renderOffsetFetchClause, renderOrderBy, renderParameterAsParameter, renderParameterAsParameter, renderQueryGroup, renderRecursiveCteVirtualSelections, renderRootTableGroup, renderRowNumber, renderRowNumberingSelectItems, renderRowsToClause, renderRowsToClause, renderSearchClause, renderSelectExpression, renderSelectExpressionWithCastedOrInlinedPlainParameters, renderSelectSimpleComparison, renderSetClause, renderSkipFirstClause, renderSkipFirstClause, renderSortExpression, renderStandardCycleClause, renderStandardSearchClause, renderStringContainsExactlyPredicate, renderTableGroup, renderTableGroupJoin, renderTableReferenceIdentificationVariable, renderTableReferenceJoins, renderTableReferenceJoins, renderTopClause, renderTopClause, renderTopStartAtClause, renderTopStartAtClause, renderTupleComparisonStandard, renderUpdateClause, renderVirtualSelections, renderWrappedParameter, resolveAliasedExpression, resolveAliasedExpression, resolveExpressionToAlias, setLimitParameter, setOffsetParameter, shouldEmulateLateralWithIntersect, simpleColumnWriteFragmentRendering, supportsDistinctFromPredicate, supportsDuplicateSelectItemsInQueryGroup, supportsIntersect, supportsJoinsInDelete, supportsNestedSubqueryCorrelation, supportsNestedWithClause, supportsQuantifiedPredicates, supportsRecursiveClauseArrayAndRowEmulation, supportsRecursiveCycleClause, supportsRecursiveCycleUsingClause, supportsRecursiveSearchClause, supportsRowValueConstructorGtLtSyntax, supportsRowValueConstructorSyntaxInInSubQuery, supportsRowValueConstructorSyntaxInSet, supportsSimpleQueryGrouping, supportsWithClause, translate, translateDelete, translateInsert, translateSelect, translateUpdate, useOffsetFetchClause, visitAggregateColumnWriteExpression, visitAnsiCaseSearchedExpression, visitAnsiCaseSimpleExpression, visitAny, visitAssignment, visitBetweenPredicate, visitCaseSearchedExpression, visitCaseSearchedExpression, visitCaseSimpleExpression, visitCaseSimpleExpression, visitCastTarget, visitCollation, visitColumnReference, visitColumnWriteFragment, visitConversion, visitCteDefinition, visitCteObject, visitCustomTableDelete, visitCustomTableInsert, visitCustomTableUpdate, visitDecodeCaseSearchedExpression, visitDeleteStatement, visitDistinct, visitDuration, visitDurationUnit, visitEmbeddableTypeLiteral, visitEntityTypeLiteral, visitEvery, visitExistsPredicate, visitExtractUnit, visitFilterFragmentPredicate, visitFilterPredicate, visitFormat, visitForUpdateClause, visitFromClause, visitFunctionTableReference, visitGroupByClause, visitGroupedPredicate, visitHavingClause, visitInArrayPredicate, visitInListPredicate, visitInsertSource, visitInsertStatement, visitInsertStatementEmulateMerge, visitInSubQueryPredicate, visitJdbcLiteral, visitJunction, visitModifiedSubQueryExpression, visitNamedTableReference, visitNegatedPredicate, visitNestedColumnReference, visitNullnessPredicate, visitOnDuplicateKeyConflictClause, visitOptionalTableUpdate, visitOrderBy, visitOver, visitOverClause, visitOverClause, visitOverflow, visitParameter, visitParameterAsParameter, visitPartitionByClause, visitPartitionExpressions, visitPartitionExpressions, visitQueryGroup, visitQueryLiteral, visitQueryPartTableReference, visitQuerySpec, visitRecursivePath, visitRelationalPredicate, visitReturningColumns, visitSelectClause, visitSelectStatement, visitSelfRenderingExpression, visitSelfRenderingPredicate, visitSetAssignment, visitSetAssignmentEmulateJoin, visitSortSpecification, visitSortSpecification, visitSqlFragmentPredicate, visitSqlSelectExpression, visitSqlSelection, visitSqlSelectionExpression, visitStandardConflictClause, visitStandardTableDelete, visitStar, visitSummarization, visitTableGroup, visitTableGroupJoin, visitTableReferenceJoin, visitThruthnessPredicate, visitTrimSpecification, visitTuple, visitUnaryOperationExpression, visitUnparsedNumericLiteral, visitUpdateStatement, visitUpdateStatementEmulateInlineView, visitUpdateStatementEmulateMerge, visitUpdateStatementEmulateTupleSet, visitValuesList, visitValuesListEmulateSelectUnion, visitValuesListStandard, visitValuesTableReference, visitWhereClause, withParameterRenderingMode, withRowNumbering
-
-
-
-
Constructor Detail
-
H2SqlAstTranslator
public H2SqlAstTranslator(SessionFactoryImplementor sessionFactory, Statement statement)
-
-
Method Detail
-
visitStandardTableInsert
public void visitStandardTableInsert(TableInsertStandard tableInsert)
- Specified by:
visitStandardTableInsert
in interfaceSqlAstWalker
- Overrides:
visitStandardTableInsert
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitStandardTableUpdate
public void visitStandardTableUpdate(TableUpdateStandard tableUpdate)
- Specified by:
visitStandardTableUpdate
in interfaceSqlAstWalker
- Overrides:
visitStandardTableUpdate
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
renderReturningClause
protected boolean renderReturningClause(List<ColumnReference> returningColumns)
-
visitReturningColumns
protected void visitReturningColumns(List<ColumnReference> returningColumns)
- Overrides:
visitReturningColumns
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitReturningInsertStatement
@Deprecated(forRemoval=true, since="6.5") public void visitReturningInsertStatement(TableInsertStandard tableInsert)
Deprecated, for removal: This API element is subject to removal in a future version.
-
visitInsertStatementOnly
protected void visitInsertStatementOnly(InsertSelectStatement statement)
- Overrides:
visitInsertStatementOnly
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitDeleteStatementOnly
protected void visitDeleteStatementOnly(DeleteStatement statement)
- Overrides:
visitDeleteStatementOnly
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitUpdateStatementOnly
protected void visitUpdateStatementOnly(UpdateStatement statement)
- Overrides:
visitUpdateStatementOnly
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
renderDmlTargetTableExpression
protected void renderDmlTargetTableExpression(NamedTableReference tableReference)
- Overrides:
renderDmlTargetTableExpression
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitConflictClause
protected void visitConflictClause(ConflictClause conflictClause)
- Overrides:
visitConflictClause
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitCteContainer
public void visitCteContainer(CteContainer cteContainer)
- Overrides:
visitCteContainer
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
needsCteInlining
protected boolean needsCteInlining()
Description copied from class:AbstractSqlAstTranslator
Whether CTEs should be inlined rather than rendered as CTEs.- Overrides:
needsCteInlining
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
shouldInlineCte
protected boolean shouldInlineCte(TableGroup tableGroup)
Description copied from class:AbstractSqlAstTranslator
Whether CTEs should be inlined rather than rendered as CTEs.- Overrides:
shouldInlineCte
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
supportsWithClauseInSubquery
protected boolean supportsWithClauseInSubquery()
Description copied from class:AbstractSqlAstTranslator
Whether the SQL with clause is supported within a subquery.- Overrides:
supportsWithClauseInSubquery
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>
-
getArrayContainsFunction
protected String getArrayContainsFunction()
Description copied from class:AbstractSqlAstTranslator
Returns the name of thearray_contains(array, element)
function, which is used for emulating the cycle clause.- Overrides:
getArrayContainsFunction
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>
-
visitOffsetFetchClause
public void visitOffsetFetchClause(QueryPart queryPart)
- Specified by:
visitOffsetFetchClause
in interfaceSqlAstWalker
- Overrides:
visitOffsetFetchClause
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
renderSelectTupleComparison
protected void renderSelectTupleComparison(List<SqlSelection> lhsExpressions, SqlTuple tuple, ComparisonOperator operator)
- Overrides:
renderSelectTupleComparison
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitSqlSelections
protected void visitSqlSelections(SelectClause selectClause)
- Overrides:
visitSqlSelections
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
renderPartitionItem
protected void renderPartitionItem(Expression expression)
- Overrides:
renderPartitionItem
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitBinaryArithmeticExpression
public void visitBinaryArithmeticExpression(BinaryArithmeticExpression arithmeticExpression)
- Specified by:
visitBinaryArithmeticExpression
in interfaceSqlAstWalker
- Overrides:
visitBinaryArithmeticExpression
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitArithmeticOperand
protected void visitArithmeticOperand(Expression expression)
- Overrides:
visitArithmeticOperand
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
renderPrimaryTableReference
protected boolean renderPrimaryTableReference(TableGroup tableGroup, LockMode lockMode)
- Overrides:
renderPrimaryTableReference
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitLikePredicate
public void visitLikePredicate(LikePredicate likePredicate)
- Specified by:
visitLikePredicate
in interfaceSqlAstWalker
- Overrides:
visitLikePredicate
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
supportsRowValueConstructorSyntax
protected boolean supportsRowValueConstructorSyntax()
Description copied from class:AbstractSqlAstTranslator
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') ...
- Overrides:
supportsRowValueConstructorSyntax
in classAbstractSqlAstTranslator<T extends JdbcOperation>
- Returns:
- True if this SQL dialect is known to support "row value constructor" syntax; false otherwise.
-
supportsRowValueConstructorSyntaxInInList
protected boolean supportsRowValueConstructorSyntaxInInList()
Description copied from class:AbstractSqlAstTranslator
If the dialect supportsrow values
, does it offer such support in IN lists as well?For example,
... where (FIRST_NAME, LAST_NAME) IN ( (?, ?), (?, ?) ) ...
- Overrides:
supportsRowValueConstructorSyntaxInInList
in 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: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.
-
supportsRowValueConstructorDistinctFromSyntax
protected boolean supportsRowValueConstructorDistinctFromSyntax()
Description copied from class:AbstractSqlAstTranslator
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') ...
- Overrides:
supportsRowValueConstructorDistinctFromSyntax
in classAbstractSqlAstTranslator<T extends JdbcOperation>
- Returns:
- True if this SQL dialect is known to support "row value constructor" syntax with distinct from comparison operators; false otherwise.
-
supportsNullPrecedence
protected boolean supportsNullPrecedence()
- Overrides:
supportsNullPrecedence
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
supportsJoinInMutationStatementSubquery
protected boolean supportsJoinInMutationStatementSubquery()
Description copied from class:AbstractSqlAstTranslator
If the dialect supports using joins in mutation statement subquery that could also use columns from the mutation target table- Overrides:
supportsJoinInMutationStatementSubquery
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
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>
- Overrides:
supportsFilterClause
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
-