Package org.hibernate.dialect
Class SQLServerSqlAstTranslator<T extendsJdbcOperation>
- java.lang.Object
- org.hibernate.sql.ast.spi.AbstractSqlAstTranslator<T>
- org.hibernate.dialect.SqlAstTranslatorWithMerge<T>
- org.hibernate.dialect.SQLServerSqlAstTranslator<T>
- All Implemented Interfaces:
Appendable,SqlAppender,SqlAstTranslator<T>,SqlAstWalker
public classSQLServerSqlAstTranslator<T extendsJdbcOperation>extendsSqlAstTranslatorWithMerge<T>
A SQL AST translator for SQL Server.
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 SQLServerSqlAstTranslator(SessionFactoryImplementor sessionFactory,Statement statement)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protectedAbstractSqlAstTranslator.LockStrategydetermineLockingStrategy(QuerySpec querySpec,AbstractSqlAstTranslator.ForUpdateClause forUpdateClause,Boolean followOnLocking)protected org.hibernate.dialect.SQLServerSqlAstTranslator.OffsetFetchClauseModegetOffsetFetchClauseMode(QueryPart queryPart)protected booleanneedsRecursiveKeywordInWithClause()Whether the SQL with clause requires the "recursive" keyword for recursive CTEs.protected voidrenderComparison(Expression lhs,ComparisonOperator operator,Expression rhs)protected voidrenderDeleteClause(DeleteStatement statement)protected voidrenderDmlTargetTableExpression(NamedTableReference tableReference)protected voidrenderEmptyOrderBy()protected voidrenderForUpdateClause(QuerySpec querySpec,AbstractSqlAstTranslator.ForUpdateClause forUpdateClause)protected voidrenderFromClauseAfterUpdateSet(UpdateStatement statement)protected voidrenderMergeStatement(OptionalTableUpdate optionalTableUpdate)Renders the OptionalTableUpdate as a MERGE query.protected booleanrenderNamedTableReference(NamedTableReference tableReference,LockMode lockMode)protected voidrenderOrderBy(boolean addWhitespace,List<SortSpecification> sortSpecifications)protected voidrenderPartitionItem(Expression expression)protected booleanrenderPrimaryTableReference(TableGroup tableGroup,LockMode lockMode)protected voidrenderSelectTupleComparison(List<SqlSelection> lhsExpressions,SqlTuple tuple,ComparisonOperator operator)protected voidrenderStringContainsExactlyPredicate(Expression haystack,Expression needle)protected voidrenderTableGroupJoin(TableGroupJoin tableGroupJoin,List<TableGroupJoin> tableGroupJoinCollector)protected voidrenderUpdateClause(UpdateStatement updateStatement)protected booleanshouldEmulateFetchClause(QueryPart queryPart)protected booleansupportsJoinsInDelete()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 booleansupportsSimpleQueryGrouping()protected booleansupportsWithClauseInSubquery()Whether the SQL with clause is supported within a subquery.voidvisitBinaryArithmeticExpression(BinaryArithmeticExpression arithmeticExpression)protected voidvisitConflictClause(ConflictClause conflictClause)protected voidvisitInsertStatementOnly(InsertSelectStatement statement)voidvisitOffsetFetchClause(QueryPart queryPart)voidvisitQueryGroup(QueryGroup queryGroup)voidvisitQuerySpec(QuerySpec querySpec)voidvisitSelectClause(SelectClause selectClause)protected voidvisitSqlSelections(SelectClause selectClause)Methods inherited from class org.hibernate.dialect.SqlAstTranslatorWithMerge
createMergeOperation,renderMergeDelete,renderMergeInsert,renderMergeInto,renderMergeOn,renderMergeSourceAlias,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,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,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,needsCteInlining,needsLocking,needsMaxRows,needsRowsToSkip,prepareLimitOffsetParameters,processNestedTableGroupJoins,processTableGroupJoin,processTableGroupJoins,registerAffectedTable,registerAffectedTable,render,renderAsLiteral,renderBackslashEscapedLikePattern,renderCaseInsensitiveLikeEmulation,renderCasted,renderCombinedLimitClause,renderCombinedLimitClause,renderCommaSeparated,renderCommaSeparatedSelectExpression,renderCommaSeparatedSelectExpression,renderComparisonDistinctOperator,renderComparisonEmulateCase,renderComparisonEmulateDecode,renderComparisonEmulateDecode,renderComparisonEmulateIntersect,renderComparisonStandard,renderCteColumns,renderCycleClause,renderDerivedTableReference,renderDmlTargetTableGroup,renderExpressionAsClauseItem,renderExpressionAsLiteral,renderExpressionsAsSubquery,renderFetch,renderFetchExpression,renderFetchPlusOffsetExpression,renderFetchPlusOffsetExpressionAsLiteral,renderFetchPlusOffsetExpressionAsSingleParameter,renderFirstClause,renderFirstClause,renderFirstSkipClause,renderFirstSkipClause,renderFromClauseExcludingDmlTargetReference,renderFromClauseJoiningDmlTargetReference,renderFromClauseSpaces,renderInsertIntoNoColumns,renderIntoIntoAndTable,renderLimitOffsetClause,renderLimitOffsetClause,renderLiteral,renderMaterializationHint,renderMergeUpdateClause,renderNull,renderOffset,renderOffsetExpression,renderOffsetFetchClause,renderOffsetFetchClause,renderParameterAsParameter,renderParameterAsParameter,renderQueryGroup,renderRecursiveCteVirtualSelections,renderRootTableGroup,renderRowNumber,renderRowNumberingSelectItems,renderSearchClause,renderSelectExpression,renderSelectExpressionWithCastedOrInlinedPlainParameters,renderSelectSimpleComparison,renderSetClause,renderSkipFirstClause,renderSkipFirstClause,renderSortExpression,renderStandardCycleClause,renderStandardSearchClause,renderTableGroup,renderTableReferenceIdentificationVariable,renderTableReferenceJoins,renderTableReferenceJoins,renderTopClause,renderTopClause,renderTopStartAtClause,renderTopStartAtClause,renderTupleComparisonStandard,renderVirtualSelections,renderWrappedParameter,resolveAliasedExpression,resolveAliasedExpression,resolveExpressionToAlias,setLimitParameter,setOffsetParameter,shouldEmulateLateralWithIntersect,shouldInlineCte,simpleColumnWriteFragmentRendering,supportsArrayConstructor,supportsDistinctFromPredicate,supportsDuplicateSelectItemsInQueryGroup,supportsFilterClause,supportsIntersect,supportsJoinInMutationStatementSubquery,supportsNestedSubqueryCorrelation,supportsNestedWithClause,supportsNullPrecedence,supportsQuantifiedPredicates,supportsRecursiveClauseArrayAndRowEmulation,supportsRecursiveCycleClause,supportsRecursiveCycleUsingClause,supportsRecursiveSearchClause,supportsRowConstructor,supportsRowValueConstructorDistinctFromSyntax,supportsRowValueConstructorGtLtSyntax,supportsRowValueConstructorSyntaxInInSubQuery,supportsRowValueConstructorSyntaxInSet,supportsWithClause,translate,translateDelete,translateInsert,translateSelect,translateUpdate,useOffsetFetchClause,visitAggregateColumnWriteExpression,visitAnsiCaseSearchedExpression,visitAnsiCaseSimpleExpression,visitAny,visitArithmeticOperand,visitAssignment,visitBetweenPredicate,visitBooleanExpressionPredicate,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,visitInArrayPredicate,visitInListPredicate,visitInsertSource,visitInsertStatement,visitInsertStatementEmulateMerge,visitInSubQueryPredicate,visitJdbcLiteral,visitJunction,visitLikePredicate,visitModifiedSubQueryExpression,visitNamedTableReference,visitNegatedPredicate,visitNestedColumnReference,visitNullnessPredicate,visitOnDuplicateKeyConflictClause,visitOptionalTableUpdate,visitOrderBy,visitOver,visitOverClause,visitOverClause,visitOverflow,visitParameter,visitParameterAsParameter,visitPartitionByClause,visitPartitionExpressions,visitPartitionExpressions,visitQueryLiteral,visitQueryPartTableReference,visitRecursivePath,visitRelationalPredicate,visitReturningColumns,visitReturningColumns,visitSelectStatement,visitSelfRenderingExpression,visitSelfRenderingPredicate,visitSetAssignment,visitSetAssignmentEmulateJoin,visitSortSpecification,visitSortSpecification,visitSqlFragmentPredicate,visitSqlSelectExpression,visitSqlSelection,visitSqlSelectionExpression,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
SQLServerSqlAstTranslator
public SQLServerSqlAstTranslator(SessionFactoryImplementor sessionFactory,Statement statement)
Method Detail
visitInsertStatementOnly
protected void visitInsertStatementOnly(InsertSelectStatement statement)
- Overrides:
visitInsertStatementOnlyin classAbstractSqlAstTranslator<T extendsJdbcOperation>
renderDeleteClause
protected void renderDeleteClause(DeleteStatement statement)
- Overrides:
renderDeleteClausein classAbstractSqlAstTranslator<T extendsJdbcOperation>
renderUpdateClause
protected void renderUpdateClause(UpdateStatement updateStatement)
- Overrides:
renderUpdateClausein classAbstractSqlAstTranslator<T extendsJdbcOperation>
renderDmlTargetTableExpression
protected void renderDmlTargetTableExpression(NamedTableReference tableReference)
- Overrides:
renderDmlTargetTableExpressionin classAbstractSqlAstTranslator<T extendsJdbcOperation>
supportsJoinsInDelete
protected boolean supportsJoinsInDelete()
- Overrides:
supportsJoinsInDeletein classAbstractSqlAstTranslator<T extendsJdbcOperation>
renderFromClauseAfterUpdateSet
protected void renderFromClauseAfterUpdateSet(UpdateStatement statement)
- Overrides:
renderFromClauseAfterUpdateSetin classAbstractSqlAstTranslator<T extendsJdbcOperation>
visitConflictClause
protected void visitConflictClause(ConflictClause conflictClause)
- Overrides:
visitConflictClausein classAbstractSqlAstTranslator<T extendsJdbcOperation>
needsRecursiveKeywordInWithClause
protected boolean needsRecursiveKeywordInWithClause()
Description copied from class:AbstractSqlAstTranslatorWhether the SQL with clause requires the "recursive" keyword for recursive CTEs.- Overrides:
needsRecursiveKeywordInWithClausein 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>
renderTableGroupJoin
protected void renderTableGroupJoin(TableGroupJoin tableGroupJoin,List<TableGroupJoin> tableGroupJoinCollector)
- Overrides:
renderTableGroupJoinin classAbstractSqlAstTranslator<T extendsJdbcOperation>
renderPrimaryTableReference
protected boolean renderPrimaryTableReference(TableGroup tableGroup,LockMode lockMode)
- Overrides:
renderPrimaryTableReferencein classAbstractSqlAstTranslator<T extendsJdbcOperation>
renderNamedTableReference
protected boolean renderNamedTableReference(NamedTableReference tableReference,LockMode lockMode)
- Overrides:
renderNamedTableReferencein classAbstractSqlAstTranslator<T extendsJdbcOperation>
determineLockingStrategy
protected AbstractSqlAstTranslator.LockStrategy determineLockingStrategy(QuerySpec querySpec,AbstractSqlAstTranslator.ForUpdateClause forUpdateClause,Boolean followOnLocking)
- Overrides:
determineLockingStrategyin classAbstractSqlAstTranslator<T extendsJdbcOperation>
renderForUpdateClause
protected void renderForUpdateClause(QuerySpec querySpec,AbstractSqlAstTranslator.ForUpdateClause forUpdateClause)
- Overrides:
renderForUpdateClausein classAbstractSqlAstTranslator<T extendsJdbcOperation>
getOffsetFetchClauseMode
protected org.hibernate.dialect.SQLServerSqlAstTranslator.OffsetFetchClauseMode getOffsetFetchClauseMode(QueryPart queryPart)
supportsSimpleQueryGrouping
protected boolean supportsSimpleQueryGrouping()
- Overrides:
supportsSimpleQueryGroupingin classAbstractSqlAstTranslator<T extendsJdbcOperation>
shouldEmulateFetchClause
protected boolean shouldEmulateFetchClause(QueryPart queryPart)
visitQueryGroup
public void visitQueryGroup(QueryGroup queryGroup)
- Specified by:
visitQueryGroupin interfaceSqlAstWalker- Overrides:
visitQueryGroupin classAbstractSqlAstTranslator<T extendsJdbcOperation>
visitQuerySpec
public void visitQuerySpec(QuerySpec querySpec)
- Specified by:
visitQuerySpecin interfaceSqlAstWalker- Overrides:
visitQuerySpecin classAbstractSqlAstTranslator<T extendsJdbcOperation>
visitSelectClause
public void visitSelectClause(SelectClause selectClause)
- Specified by:
visitSelectClausein interfaceSqlAstWalker- Overrides:
visitSelectClausein classAbstractSqlAstTranslator<T extendsJdbcOperation>
visitSqlSelections
protected void visitSqlSelections(SelectClause selectClause)
- Overrides:
visitSqlSelectionsin classAbstractSqlAstTranslator<T extendsJdbcOperation>
renderOrderBy
protected void renderOrderBy(boolean addWhitespace,List<SortSpecification> sortSpecifications)
- Overrides:
renderOrderByin classAbstractSqlAstTranslator<T extendsJdbcOperation>
renderEmptyOrderBy
protected void renderEmptyOrderBy()
visitOffsetFetchClause
public void visitOffsetFetchClause(QueryPart queryPart)
- Specified by:
visitOffsetFetchClausein interfaceSqlAstWalker- Overrides:
visitOffsetFetchClausein classAbstractSqlAstTranslator<T extendsJdbcOperation>
renderComparison
protected void renderComparison(Expression lhs,ComparisonOperator operator,Expression rhs)
- Overrides:
renderComparisonin classAbstractSqlAstTranslator<T extendsJdbcOperation>
renderSelectTupleComparison
protected void renderSelectTupleComparison(List<SqlSelection> lhsExpressions,SqlTuple tuple,ComparisonOperator operator)
- Overrides:
renderSelectTupleComparisonin 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>
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.
renderMergeStatement
protected void renderMergeStatement(OptionalTableUpdate optionalTableUpdate)
Description copied from class:SqlAstTranslatorWithMergeRenders the OptionalTableUpdate as a MERGE query.- Overrides:
renderMergeStatementin classSqlAstTranslatorWithMerge<T extendsJdbcOperation>
renderStringContainsExactlyPredicate
protected void renderStringContainsExactlyPredicate(Expression haystack,Expression needle)
- Overrides:
renderStringContainsExactlyPredicatein classAbstractSqlAstTranslator<T extendsJdbcOperation>