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, COMA_SEPARATOR, COMA_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 Modifier and Type Method Description protected StringgetArrayContainsFunction()Returns the name of thearray_contains(array, element)function, which is used for emulating the cycle clause.protected StringgetFromDual()Some databases require a bit of syntactic noise when there are no tables in the from clause.protected booleanneedsCteInlining()Whether CTEs should be inlined rather than rendered as CTEs.protected voidrenderExpressionAsClauseItem(Expression expression)protected voidrenderPartitionItem(Expression expression)protected booleanrenderPrimaryTableReference(TableGroup tableGroup, LockMode lockMode)protected voidrenderSelectTupleComparison(List<SqlSelection> lhsExpressions, SqlTuple tuple, ComparisonOperator operator)protected booleanshouldInlineCte(TableGroup tableGroup)Whether CTEs should be inlined rather than rendered as CTEs.protected booleansupportsArrayConstructor()Whether the SQL array constructor is supported.protected booleansupportsJoinInMutationStatementSubquery()If the dialect supports using joins in mutation statement subquery that could also use columns from the mutation target tableprotected booleansupportsNullPrecedence()protected booleansupportsRowConstructor()Whether the SQL row constructor is supported.protected booleansupportsRowValueConstructorDistinctFromSyntax()Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax; sometimes called tuple syntax withis distinct fromandis not distinct fromoperators.protected booleansupportsRowValueConstructorSyntax()Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax; sometimes called tuple syntax.protected 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.protected booleansupportsWithClauseInSubquery()Whether the SQL with clause is supported within a subquery.voidvisitBinaryArithmeticExpression(BinaryArithmeticExpression arithmeticExpression)voidvisitBooleanExpressionPredicate(BooleanExpressionPredicate booleanExpressionPredicate)voidvisitCteContainer(CteContainer cteContainer)voidvisitInSubQueryPredicate(InSubQueryPredicate inSubQueryPredicate)voidvisitLikePredicate(LikePredicate likePredicate)voidvisitOffsetFetchClause(QueryPart queryPart)protected voidvisitReturningColumns(List<ColumnReference> returningColumns)voidvisitReturningInsertStatement(TableInsertStandard tableInsert)protected voidvisitSqlSelections(SelectClause selectClause)voidvisitStandardTableInsert(TableInsertStandard tableInsert)-
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, determineCyclePathColumnName, determineLateralEmulationPredicate, determineLockingStrategy, determineWhereClauseRestrictionWithJoinEmulation, emulateCycleClauseWithRowAndArray, emulateFetchOffsetWithWindowFunctions, emulateFetchOffsetWithWindowFunctions, emulateFetchOffsetWithWindowFunctionsVisitQueryPart, emulateQuantifiedTupleSubQueryPredicate, emulateQueryPartTableReferenceColumnAliasing, emulateSearchClauseOrderWithRowAndArray, emulateSelectTupleComparison, emulateSortSpecificationNullPrecedence, emulateSubQueryRelationalRestrictionPredicate, emulateTupleComparison, emulateValuesTableReferenceColumnAliasing, getAffectedTableNames, getAppliedParameterBindings, getBooleanType, getClauseStack, getCteStatement, getCurrentClauseStack, getCurrentCteStatement, getCurrentDmlStatement, getCurrentQueryPart, getDialect, getDmlTargetTableAlias, getEffectiveLockMode, getEffectiveLockMode, getEffectiveLockTimeout, getFetchClauseTypeForRowNumbering, getForShare, 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, getSqlBuffer, getSqlTypeName, getStatement, getStringType, getWrapperOptions, hasAggregateFunctions, hasLimit, hasLimit, hasNestedTableGroupsToRender, hasOffset, inlineCteTableGroup, inOverOrWithinGroupClause, interpretExpression, isCorrelated, isInRecursiveQueryPart, 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, 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, renderParameterAsParameter, renderParameterAsParameter, renderQueryGroup, renderRecursiveCteVirtualSelections, renderRootTableGroup, renderRowNumber, renderRowNumberingSelectItems, renderRowsToClause, renderRowsToClause, renderSearchClause, renderSelectExpression, renderSelectExpressionWithCastedOrInlinedPlainParameters, renderSelectSimpleComparison, renderSetClause, renderSkipFirstClause, renderSkipFirstClause, rendersTableReferenceAlias, renderStandardCycleClause, renderStandardSearchClause, renderTableGroup, renderTableGroupJoin, renderTableReferenceIdentificationVariable, renderTableReferenceJoins, renderTopClause, renderTopClause, renderTopStartAtClause, renderTopStartAtClause, renderTupleComparisonStandard, renderVirtualSelections, resolveAliasedExpression, resolveAliasedExpression, resolveExpressionToAlias, setLimitParameter, setOffsetParameter, shouldEmulateLateralWithIntersect, simpleColumnWriteFragmentRendering, supportsDistinctFromPredicate, supportsDuplicateSelectItemsInQueryGroup, supportsFilterClause, supportsIntersect, 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, visitCustomTableDelete, visitCustomTableInsert, visitCustomTableUpdate, visitDecodeCaseSearchedExpression, visitDeleteStatement, visitDeleteStatementOnly, visitDistinct, visitDuration, visitDurationUnit, visitEntityTypeLiteral, visitEvery, visitExistsPredicate, visitExtractUnit, visitFilterFragmentPredicate, visitFilterPredicate, visitFormat, visitForUpdateClause, visitFromClause, visitFunctionTableReference, visitGroupByClause, visitGroupedPredicate, visitHavingClause, visitInArrayPredicate, visitInListPredicate, visitInsertStatement, visitInsertStatementOnly, visitJdbcLiteral, visitJunction, visitModifiedSubQueryExpression, visitNamedTableReference, visitNegatedPredicate, visitNullnessPredicate, visitOrderBy, visitOver, visitOverClause, visitOverClause, visitOverflow, visitParameter, visitParameterAsParameter, visitPartitionByClause, visitPartitionExpressions, visitPartitionExpressions, visitQueryGroup, visitQueryLiteral, visitQueryPartTableReference, visitQuerySpec, visitRecursivePath, visitRelationalPredicate, visitReturningColumns, visitSelectClause, visitSelectStatement, visitSelfRenderingExpression, visitSelfRenderingPredicate, visitSetAssignment, visitSortSpecification, visitSortSpecification, visitSqlFragmentPredicate, visitSqlSelectExpression, visitSqlSelection, visitSqlSelectionExpression, visitStandardTableDelete, visitStandardTableUpdate, visitStar, visitSummarization, visitTableGroup, visitTableGroupJoin, visitTableReferenceJoin, visitTrimSpecification, visitTuple, visitUnaryOperationExpression, visitUpdateStatement, visitUpdateStatementOnly, visitValuesList, visitValuesTableReference, visitWhereClause, withParameterRenderingMode, withRowNumbering
-
-
-
-
Constructor Detail
-
H2SqlAstTranslator
public H2SqlAstTranslator(SessionFactoryImplementor sessionFactory, Statement statement)
-
-
Method Detail
-
visitStandardTableInsert
public void visitStandardTableInsert(TableInsertStandard tableInsert)
- Specified by:
visitStandardTableInsertin interfaceSqlAstWalker- Overrides:
visitStandardTableInsertin classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitReturningInsertStatement
public void visitReturningInsertStatement(TableInsertStandard tableInsert)
-
visitReturningColumns
protected void visitReturningColumns(List<ColumnReference> returningColumns)
- Overrides:
visitReturningColumnsin classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitCteContainer
public void visitCteContainer(CteContainer cteContainer)
- Overrides:
visitCteContainerin classAbstractSqlAstTranslator<T extends JdbcOperation>
-
needsCteInlining
protected boolean needsCteInlining()
Description copied from class:AbstractSqlAstTranslatorWhether CTEs should be inlined rather than rendered as CTEs.- Overrides:
needsCteInliningin classAbstractSqlAstTranslator<T extends JdbcOperation>
-
shouldInlineCte
protected boolean shouldInlineCte(TableGroup tableGroup)
Description copied from class:AbstractSqlAstTranslatorWhether CTEs should be inlined rather than rendered as CTEs.- Overrides:
shouldInlineCtein classAbstractSqlAstTranslator<T extends JdbcOperation>
-
supportsWithClauseInSubquery
protected boolean supportsWithClauseInSubquery()
Description copied from class:AbstractSqlAstTranslatorWhether the SQL with clause is supported within a subquery.- Overrides:
supportsWithClauseInSubqueryin classAbstractSqlAstTranslator<T extends JdbcOperation>
-
supportsRowConstructor
protected boolean supportsRowConstructor()
Description copied from class:AbstractSqlAstTranslatorWhether the SQL row constructor is supported.- Overrides:
supportsRowConstructorin classAbstractSqlAstTranslator<T extends JdbcOperation>
-
supportsArrayConstructor
protected boolean supportsArrayConstructor()
Description copied from class:AbstractSqlAstTranslatorWhether the SQL array constructor is supported.- Overrides:
supportsArrayConstructorin classAbstractSqlAstTranslator<T extends JdbcOperation>
-
getArrayContainsFunction
protected String getArrayContainsFunction()
Description copied from class:AbstractSqlAstTranslatorReturns the name of thearray_contains(array, element)function, which is used for emulating the cycle clause.- Overrides:
getArrayContainsFunctionin classAbstractSqlAstTranslator<T extends JdbcOperation>
-
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>
-
visitOffsetFetchClause
public void visitOffsetFetchClause(QueryPart queryPart)
- Specified by:
visitOffsetFetchClausein interfaceSqlAstWalker- Overrides:
visitOffsetFetchClausein classAbstractSqlAstTranslator<T extends JdbcOperation>
-
renderSelectTupleComparison
protected void renderSelectTupleComparison(List<SqlSelection> lhsExpressions, SqlTuple tuple, ComparisonOperator operator)
- Overrides:
renderSelectTupleComparisonin classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitInSubQueryPredicate
public void visitInSubQueryPredicate(InSubQueryPredicate inSubQueryPredicate)
- Specified by:
visitInSubQueryPredicatein interfaceSqlAstWalker- Overrides:
visitInSubQueryPredicatein classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitSqlSelections
protected void visitSqlSelections(SelectClause selectClause)
- Overrides:
visitSqlSelectionsin classAbstractSqlAstTranslator<T extends JdbcOperation>
-
renderPartitionItem
protected void renderPartitionItem(Expression expression)
- Overrides:
renderPartitionItemin classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitBinaryArithmeticExpression
public void visitBinaryArithmeticExpression(BinaryArithmeticExpression arithmeticExpression)
- Specified by:
visitBinaryArithmeticExpressionin interfaceSqlAstWalker- Overrides:
visitBinaryArithmeticExpressionin classAbstractSqlAstTranslator<T extends JdbcOperation>
-
renderPrimaryTableReference
protected boolean renderPrimaryTableReference(TableGroup tableGroup, LockMode lockMode)
- Overrides:
renderPrimaryTableReferencein classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitLikePredicate
public void visitLikePredicate(LikePredicate likePredicate)
- Specified by:
visitLikePredicatein interfaceSqlAstWalker- Overrides:
visitLikePredicatein classAbstractSqlAstTranslator<T extends JdbcOperation>
-
supportsRowValueConstructorSyntax
protected boolean supportsRowValueConstructorSyntax()
Description copied from class:AbstractSqlAstTranslatorIs 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:
supportsRowValueConstructorSyntaxin 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: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.
-
supportsRowValueConstructorDistinctFromSyntax
protected boolean supportsRowValueConstructorDistinctFromSyntax()
Description copied from class:AbstractSqlAstTranslatorIs this dialect known to support what ANSI-SQL terms "row value constructor" syntax; sometimes called tuple syntax withis distinct fromandis not distinct fromoperators.Basically, does it support syntax like
... where (FIRST_NAME, LAST_NAME) is distinct from ('Steve', 'Ebersole') ...- Overrides:
supportsRowValueConstructorDistinctFromSyntaxin 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:
supportsNullPrecedencein classAbstractSqlAstTranslator<T extends JdbcOperation>
-
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.
-
supportsJoinInMutationStatementSubquery
protected boolean supportsJoinInMutationStatementSubquery()
Description copied from class:AbstractSqlAstTranslatorIf the dialect supports using joins in mutation statement subquery that could also use columns from the mutation target table- Overrides:
supportsJoinInMutationStatementSubqueryin classAbstractSqlAstTranslator<T extends JdbcOperation>
-
-