Package org.hibernate.dialect
Class H2SqlAstTranslator<T extendsJdbcOperation>
- 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 classH2SqlAstTranslator<T extendsJdbcOperation>extendsSqlAstTranslatorWithMerge<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 extendsExpression>
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 protectedStringgetArrayContainsFunction()Returns the name of thearray_contains(array, element)function, which is used for emulating the cycle clause.protected booleanneedsCteInlining()Whether CTEs should be inlined rather than rendered as CTEs.protected voidrenderDmlTargetTableExpression(NamedTableReference tableReference)protected voidrenderExpressionAsClauseItem(Expression expression)protected voidrenderPartitionItem(Expression expression)protected booleanrenderPrimaryTableReference(TableGroup tableGroup,LockMode lockMode)protected booleanrenderReturningClause(List<ColumnReference> returningColumns)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.booleansupportsFilterClause()Whether the FILTER clause for aggregate functions 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.protected voidvisitArithmeticOperand(Expression expression)voidvisitBinaryArithmeticExpression(BinaryArithmeticExpression arithmeticExpression)voidvisitBooleanExpressionPredicate(BooleanExpressionPredicate booleanExpressionPredicate)protected voidvisitConflictClause(ConflictClause conflictClause)voidvisitCteContainer(CteContainer cteContainer)protected voidvisitDeleteStatementOnly(DeleteStatement statement)protected voidvisitInsertStatementOnly(InsertSelectStatement statement)voidvisitLikePredicate(LikePredicate likePredicate)voidvisitOffsetFetchClause(QueryPart queryPart)protected voidvisitReturningColumns(List<ColumnReference> returningColumns)voidvisitReturningInsertStatement(TableInsertStandard tableInsert)Deprecated, for removal: This API element is subject to removal in a future version.protected voidvisitSqlSelections(SelectClause selectClause)voidvisitStandardTableInsert(TableInsertStandard tableInsert)voidvisitStandardTableUpdate(TableUpdateStandard tableUpdate)protected voidvisitUpdateStatementOnly(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,appendAssignmentColumn,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,getLiteralValue,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,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:
visitStandardTableInsertin interfaceSqlAstWalker- Overrides:
visitStandardTableInsertin classAbstractSqlAstTranslator<T extendsJdbcOperation>
visitStandardTableUpdate
public void visitStandardTableUpdate(TableUpdateStandard tableUpdate)
- Specified by:
visitStandardTableUpdatein interfaceSqlAstWalker- Overrides:
visitStandardTableUpdatein classAbstractSqlAstTranslator<T extendsJdbcOperation>
renderReturningClause
protected boolean renderReturningClause(List<ColumnReference> returningColumns)
visitReturningColumns
protected void visitReturningColumns(List<ColumnReference> returningColumns)
- Overrides:
visitReturningColumnsin classAbstractSqlAstTranslator<T extendsJdbcOperation>
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:
visitInsertStatementOnlyin classAbstractSqlAstTranslator<T extendsJdbcOperation>
visitDeleteStatementOnly
protected void visitDeleteStatementOnly(DeleteStatement statement)
- Overrides:
visitDeleteStatementOnlyin classAbstractSqlAstTranslator<T extendsJdbcOperation>
visitUpdateStatementOnly
protected void visitUpdateStatementOnly(UpdateStatement statement)
- Overrides:
visitUpdateStatementOnlyin classAbstractSqlAstTranslator<T extendsJdbcOperation>
renderDmlTargetTableExpression
protected void renderDmlTargetTableExpression(NamedTableReference tableReference)
- Overrides:
renderDmlTargetTableExpressionin classAbstractSqlAstTranslator<T extendsJdbcOperation>
visitConflictClause
protected void visitConflictClause(ConflictClause conflictClause)
- Overrides:
visitConflictClausein classAbstractSqlAstTranslator<T extendsJdbcOperation>
visitCteContainer
public void visitCteContainer(CteContainer cteContainer)
- Overrides:
visitCteContainerin classAbstractSqlAstTranslator<T extendsJdbcOperation>
needsCteInlining
protected boolean needsCteInlining()
Description copied from class:AbstractSqlAstTranslatorWhether CTEs should be inlined rather than rendered as CTEs.- Overrides:
needsCteInliningin classAbstractSqlAstTranslator<T extendsJdbcOperation>
shouldInlineCte
protected boolean shouldInlineCte(TableGroup tableGroup)
Description copied from class:AbstractSqlAstTranslatorWhether CTEs should be inlined rather than rendered as CTEs.- Overrides:
shouldInlineCtein classAbstractSqlAstTranslator<T extendsJdbcOperation>
supportsWithClauseInSubquery
protected boolean supportsWithClauseInSubquery()
Description copied from class:AbstractSqlAstTranslatorWhether the SQL with clause is supported within a subquery.- Overrides:
supportsWithClauseInSubqueryin classAbstractSqlAstTranslator<T extendsJdbcOperation>
supportsRowConstructor
protected boolean supportsRowConstructor()
Description copied from class:AbstractSqlAstTranslatorWhether the SQL row constructor is supported.- Overrides:
supportsRowConstructorin classAbstractSqlAstTranslator<T extendsJdbcOperation>
supportsArrayConstructor
protected boolean supportsArrayConstructor()
Description copied from class:AbstractSqlAstTranslatorWhether the SQL array constructor is supported.- Overrides:
supportsArrayConstructorin classAbstractSqlAstTranslator<T extendsJdbcOperation>
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 extendsJdbcOperation>
renderExpressionAsClauseItem
protected void renderExpressionAsClauseItem(Expression expression)
- Overrides:
renderExpressionAsClauseItemin classAbstractSqlAstTranslator<T extendsJdbcOperation>
visitBooleanExpressionPredicate
public void visitBooleanExpressionPredicate(BooleanExpressionPredicate booleanExpressionPredicate)
- Specified by:
visitBooleanExpressionPredicatein interfaceSqlAstWalker- Overrides:
visitBooleanExpressionPredicatein classAbstractSqlAstTranslator<T extendsJdbcOperation>
visitOffsetFetchClause
public void visitOffsetFetchClause(QueryPart queryPart)
- Specified by:
visitOffsetFetchClausein interfaceSqlAstWalker- Overrides:
visitOffsetFetchClausein classAbstractSqlAstTranslator<T extendsJdbcOperation>
renderSelectTupleComparison
protected void renderSelectTupleComparison(List<SqlSelection> lhsExpressions,SqlTuple tuple,ComparisonOperator operator)
- Overrides:
renderSelectTupleComparisonin classAbstractSqlAstTranslator<T extendsJdbcOperation>
visitSqlSelections
protected void visitSqlSelections(SelectClause selectClause)
- Overrides:
visitSqlSelectionsin classAbstractSqlAstTranslator<T extendsJdbcOperation>
renderPartitionItem
protected void renderPartitionItem(Expression expression)
- Overrides:
renderPartitionItemin classAbstractSqlAstTranslator<T extendsJdbcOperation>
visitBinaryArithmeticExpression
public void visitBinaryArithmeticExpression(BinaryArithmeticExpression arithmeticExpression)
- Specified by:
visitBinaryArithmeticExpressionin interfaceSqlAstWalker- Overrides:
visitBinaryArithmeticExpressionin classAbstractSqlAstTranslator<T extendsJdbcOperation>
visitArithmeticOperand
protected void visitArithmeticOperand(Expression expression)
- Overrides:
visitArithmeticOperandin classAbstractSqlAstTranslator<T extendsJdbcOperation>
renderPrimaryTableReference
protected boolean renderPrimaryTableReference(TableGroup tableGroup,LockMode lockMode)
- Overrides:
renderPrimaryTableReferencein classAbstractSqlAstTranslator<T extendsJdbcOperation>
visitLikePredicate
public void visitLikePredicate(LikePredicate likePredicate)
- Specified by:
visitLikePredicatein interfaceSqlAstWalker- Overrides:
visitLikePredicatein classAbstractSqlAstTranslator<T extendsJdbcOperation>
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 extendsJdbcOperation>- 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 extendsJdbcOperation>- 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 extendsJdbcOperation>- 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 extendsJdbcOperation>- 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 extendsJdbcOperation>
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 extendsJdbcOperation>
supportsFilterClause
public boolean supportsFilterClause()
Description copied from interface:SqlAstTranslatorWhether the FILTER clause for aggregate functions is supported.- Specified by:
supportsFilterClausein interfaceSqlAstTranslator<T extendsJdbcOperation>- Overrides:
supportsFilterClausein classAbstractSqlAstTranslator<T extendsJdbcOperation>