Top Description Fields Constructors Methods
org.hibernate.dialect

public Class H2SqlAstTranslator<T extends org.hibernate.sql.exec.spi.JdbcOperation>

extends SqlAstTranslatorWithMerge<T extends JdbcOperation>
Class Inheritance
Imports
java.util.List, org.hibernate.LockMode, org.hibernate.dialect.identity.H2IdentityColumnSupport, org.hibernate.engine.spi.SessionFactoryImplementor, org.hibernate.query.sqm.ComparisonOperator, org.hibernate.sql.ast.SqlAstNodeRenderingMode, org.hibernate.sql.ast.spi.SqlSelection, org.hibernate.sql.ast.tree.Statement, org.hibernate.sql.ast.tree.cte.CteContainer, .CteTableGroup, org.hibernate.sql.ast.tree.expression.BinaryArithmeticExpression, .ColumnReference, .Expression, .Literal, .SqlTuple, .Summarization, org.hibernate.sql.ast.tree.from.QueryPartTableReference, .TableGroup, .TableReference, org.hibernate.sql.ast.tree.predicate.BooleanExpressionPredicate, .LikePredicate, org.hibernate.sql.ast.tree.select.QueryPart, .SelectClause, org.hibernate.sql.exec.spi.JdbcOperation, org.hibernate.sql.model.internal.TableInsertStandard

A SQL AST translator for H2.
Author
Christian Beikov

Field Summary

Modifier and TypeField and Description
private boolean

Constructor Summary

AccessConstructor and Description
public
H2SqlAstTranslator(SessionFactoryImplementor sessionFactory, Statement statement)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.

Method Summary

Modifier and TypeMethod and Description
protected String
getArrayContainsFunction()

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.getArrayContainsFunction.

Returns the name of the array_contains(array, element) function, which is used for emulating the cycle clause.
protected String
getFromDual()

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.getFromDual.

Some databases require a bit of syntactic noise when there are no tables in the from clause.
protected boolean
needsCteInlining()

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.needsCteInlining.

Whether CTEs should be inlined rather than rendered as CTEs.
protected void
protected void
protected boolean
protected void
protected boolean
shouldInlineCte(TableGroup tableGroup)

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.shouldInlineCte.

Whether CTEs should be inlined rather than rendered as CTEs.
protected boolean
protected boolean
supportsJoinInMutationStatementSubquery()

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.supportsJoinInMutationStatementSubquery.

If the dialect supports using joins in mutation statement subquery that could also use columns from the mutation target table
protected boolean
private boolean
private boolean
protected boolean
protected boolean
supportsRowValueConstructorDistinctFromSyntax()

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.supportsRowValueConstructorDistinctFromSyntax.

Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax; sometimes called tuple syntax with is distinct from and is not distinct from operators.
protected boolean
supportsRowValueConstructorSyntax()

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.supportsRowValueConstructorSyntax.

Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax; sometimes called tuple syntax.
protected boolean
protected boolean
supportsRowValueConstructorSyntaxInQuantifiedPredicates()

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.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()

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.supportsWithClauseInSubquery.

Whether the SQL with clause is supported within a subquery.
public void
public void
public void
public void
public void
protected void
public void
protected void
public void
Inherited from org.hibernate.dialect.SqlAstTranslatorWithMerge:
createMergeOperationrenderMergeDeleterenderMergeInsertrenderMergeIntorenderMergeOnrenderMergeSourceAliasrenderMergeStatementrenderMergeTargetAliasrenderMergeUpdaterenderMergeUsingrenderMergeUsingQuerySelection

Field Detail

renderAsArrayback to summary
private boolean renderAsArray

Constructor Detail

H2SqlAstTranslatorback to summary
public H2SqlAstTranslator(SessionFactoryImplementor sessionFactory, Statement statement)

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Method Detail

getArrayContainsFunctionback to summary
protected String getArrayContainsFunction()

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.getArrayContainsFunction.

Doc from org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.getArrayContainsFunction.

Returns the name of the array_contains(array, element) function, which is used for emulating the cycle clause.

Annotations
@Override
getFromDualback to summary
protected String getFromDual()

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.getFromDual.

Doc from org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.getFromDual.

Some databases require a bit of syntactic noise when there are no tables in the from clause.

Returns:String

the SQL equivalent to Oracle's from dual.

Annotations
@Override
needsCteInliningback to summary
protected boolean needsCteInlining()

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.needsCteInlining.

Doc from org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.needsCteInlining.

Whether CTEs should be inlined rather than rendered as CTEs.

Annotations
@Override
renderExpressionAsClauseItemback to summary
protected void renderExpressionAsClauseItem(Expression expression)

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.renderExpressionAsClauseItem.

Annotations
@Override
renderPartitionItemback to summary
protected void renderPartitionItem(Expression expression)

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.renderPartitionItem.

Annotations
@Override
renderPrimaryTableReferenceback to summary
protected boolean renderPrimaryTableReference(TableGroup tableGroup, LockMode lockMode)

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.renderPrimaryTableReference.

Annotations
@Override
renderSelectTupleComparisonback to summary
protected void renderSelectTupleComparison(List<SqlSelection> lhsExpressions, SqlTuple tuple, ComparisonOperator operator)

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.renderSelectTupleComparison.

Annotations
@Override
shouldInlineCteback to summary
protected boolean shouldInlineCte(TableGroup tableGroup)

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.shouldInlineCte.

Doc from org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.shouldInlineCte.

Whether CTEs should be inlined rather than rendered as CTEs.

Annotations
@Override
supportsArrayConstructorback to summary
protected boolean supportsArrayConstructor()

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.supportsArrayConstructor.

Doc from org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.supportsArrayConstructor.

Whether the SQL array constructor is supported.

Annotations
@Override
supportsJoinInMutationStatementSubqueryback to summary
protected boolean supportsJoinInMutationStatementSubquery()

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.supportsJoinInMutationStatementSubquery.

Doc from org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.supportsJoinInMutationStatementSubquery.

If the dialect supports using joins in mutation statement subquery that could also use columns from the mutation target table

Annotations
@Override
supportsNullPrecedenceback to summary
protected boolean supportsNullPrecedence()

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.supportsNullPrecedence.

Annotations
@Override
supportsOffsetFetchClauseback to summary
private boolean supportsOffsetFetchClause()
supportsOffsetFetchClausePercentWithTiesback to summary
private boolean supportsOffsetFetchClausePercentWithTies()
supportsRowConstructorback to summary
protected boolean supportsRowConstructor()

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.supportsRowConstructor.

Doc from org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.supportsRowConstructor.

Whether the SQL row constructor is supported.

Annotations
@Override
supportsRowValueConstructorDistinctFromSyntaxback to summary
protected boolean supportsRowValueConstructorDistinctFromSyntax()

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.supportsRowValueConstructorDistinctFromSyntax.

Doc from org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.supportsRowValueConstructorDistinctFromSyntax.

Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax; sometimes called tuple syntax with is distinct from and is not distinct from operators.

Basically, does it support syntax like ... where (FIRST_NAME, LAST_NAME) is distinct from ('Steve', 'Ebersole') ...

Returns:boolean

True if this SQL dialect is known to support "row value constructor" syntax with distinct from comparison operators; false otherwise.

Annotations
@Override
supportsRowValueConstructorSyntaxback to summary
protected boolean supportsRowValueConstructorSyntax()

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.supportsRowValueConstructorSyntax.

Doc from org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.supportsRowValueConstructorSyntax.

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') ...

Returns:boolean

True if this SQL dialect is known to support "row value constructor" syntax; false otherwise.

Annotations
@Override
supportsRowValueConstructorSyntaxInInListback to summary
protected boolean supportsRowValueConstructorSyntaxInInList()

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.supportsRowValueConstructorSyntaxInInList.

Doc from org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.supportsRowValueConstructorSyntaxInInList.

If the dialect supports row values, does it offer such support in IN lists as well?

For example, ... where (FIRST_NAME, LAST_NAME) IN ( (?, ?), (?, ?) ) ...

Returns:boolean

True if this SQL dialect is known to support "row value constructor" syntax in the IN list; false otherwise.

Annotations
@Override
supportsRowValueConstructorSyntaxInQuantifiedPredicatesback to summary
protected boolean supportsRowValueConstructorSyntaxInQuantifiedPredicates()

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.supportsRowValueConstructorSyntaxInQuantifiedPredicates.

Doc from org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.supportsRowValueConstructorSyntaxInQuantifiedPredicates.

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 ...) ...

Returns:boolean

True if this SQL dialect is known to support "row value constructor" syntax with quantified predicates; false otherwise.

Annotations
@Override
supportsWithClauseInSubqueryback to summary
protected boolean supportsWithClauseInSubquery()

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.supportsWithClauseInSubquery.

Doc from org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.supportsWithClauseInSubquery.

Whether the SQL with clause is supported within a subquery.

Annotations
@Override
visitBinaryArithmeticExpressionback to summary
public void visitBinaryArithmeticExpression(BinaryArithmeticExpression arithmeticExpression)

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.visitBinaryArithmeticExpression.

Implements org.hibernate.sql.ast.SqlAstWalker.visitBinaryArithmeticExpression.

Annotations
@Override
visitBooleanExpressionPredicateback to summary
public void visitBooleanExpressionPredicate(BooleanExpressionPredicate booleanExpressionPredicate)

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.visitBooleanExpressionPredicate.

Implements org.hibernate.sql.ast.SqlAstWalker.visitBooleanExpressionPredicate.

Annotations
@Override
visitCteContainerback to summary
public void visitCteContainer(CteContainer cteContainer)

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.visitCteContainer.

Annotations
@Override
visitLikePredicateback to summary
public void visitLikePredicate(LikePredicate likePredicate)

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.visitLikePredicate.

Implements org.hibernate.sql.ast.SqlAstWalker.visitLikePredicate.

Annotations
@Override
visitOffsetFetchClauseback to summary
public void visitOffsetFetchClause(QueryPart queryPart)

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.visitOffsetFetchClause.

Implements org.hibernate.sql.ast.SqlAstWalker.visitOffsetFetchClause.

Annotations
@Override
visitReturningColumnsback to summary
protected void visitReturningColumns(List<ColumnReference> returningColumns)

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.visitReturningColumns.

Annotations
@Override
visitReturningInsertStatementback to summary
public void visitReturningInsertStatement(TableInsertStandard tableInsert)
visitSqlSelectionsback to summary
protected void visitSqlSelections(SelectClause selectClause)

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.visitSqlSelections.

Annotations
@Override
visitStandardTableInsertback to summary
public void visitStandardTableInsert(TableInsertStandard tableInsert)

Overrides org.hibernate.sql.ast.spi.AbstractSqlAstTranslator.visitStandardTableInsert.

Implements org.hibernate.sql.ast.SqlAstWalker.visitStandardTableInsert.

Annotations
@Override