Package org.hibernate.dialect
Class PostgreSQLSqlAstTranslator<T extends JdbcOperation>
- java.lang.Object
-
- org.hibernate.sql.ast.spi.AbstractSqlAstTranslator<T>
-
- org.hibernate.dialect.SqlAstTranslatorWithMerge<T>
-
- org.hibernate.dialect.PostgreSQLSqlAstTranslator<T>
-
- All Implemented Interfaces:
Appendable
,SqlAppender
,SqlAstTranslator<T>
,SqlAstWalker
public class PostgreSQLSqlAstTranslator<T extends JdbcOperation> extends SqlAstTranslatorWithMerge<T>
A SQL AST translator for PostgreSQL.
-
-
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 PostgreSQLSqlAstTranslator(SessionFactoryImplementor sessionFactory, Statement statement)
-
Method Summary
All Methods Instance Methods Concrete 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 String
getForShare(int timeoutMillis)
protected String
getForUpdate()
protected void
renderComparison(Expression lhs, ComparisonOperator operator, Expression rhs)
protected void
renderExpressionAsClauseItem(Expression expression)
protected void
renderInsertIntoNoColumns(TableInsertStandard tableInsert)
Handle rendering an insert with no columnsprotected void
renderMaterializationHint(CteMaterialization materialization)
protected void
renderPartitionItem(Expression expression)
protected void
renderStandardCycleClause(CteStatement cte)
protected boolean
shouldEmulateFetchClause(QueryPart queryPart)
protected boolean
supportsArrayConstructor()
Whether the SQL array constructor is supported.boolean
supportsFilterClause()
Whether the FILTER clause for aggregate functions is supported.protected boolean
supportsRecursiveCycleClause()
Whether the SQL cycle clause is supported, which can be used for recursive CTEs.protected boolean
supportsRecursiveCycleUsingClause()
Whether the SQL cycle clause supports the using sub-clause.protected boolean
supportsRecursiveSearchClause()
Whether the SQL search clause is supported, which can be used for recursive CTEs.protected boolean
supportsRowConstructor()
Whether the SQL row constructor is supported.void
visitBinaryArithmeticExpression(BinaryArithmeticExpression arithmeticExpression)
void
visitBooleanExpressionPredicate(BooleanExpressionPredicate booleanExpressionPredicate)
void
visitInArrayPredicate(InArrayPredicate inArrayPredicate)
void
visitLikePredicate(LikePredicate likePredicate)
void
visitNullnessPredicate(NullnessPredicate nullnessPredicate)
void
visitOffsetFetchClause(QueryPart queryPart)
void
visitQueryGroup(QueryGroup queryGroup)
void
visitQuerySpec(QuerySpec querySpec)
-
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, 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, getStatement, getStringType, getWrapperOptions, hasAggregateFunctions, hasLimit, hasLimit, hasNestedTableGroupsToRender, hasOffset, inlineCteTableGroup, inOverOrWithinGroupClause, interpretExpression, isCorrelated, isInRecursiveQueryPart, isLiteral, isParameter, isRowNumberingCurrentQueryPart, isRowsOnlyFetchClauseType, isStruct, needsCteInlining, needsLocking, needsMaxRows, needsRecursiveKeywordInWithClause, needsRowsToSkip, prepareLimitOffsetParameters, processNestedTableGroupJoins, processTableGroupJoin, processTableGroupJoins, registerAffectedTable, registerAffectedTable, render, renderAsLiteral, renderBackslashEscapedLikePattern, renderCaseInsensitiveLikeEmulation, renderCasted, renderCombinedLimitClause, renderCombinedLimitClause, renderCommaSeparated, renderCommaSeparatedSelectExpression, renderCommaSeparatedSelectExpression, renderComparisonDistinctOperator, renderComparisonEmulateCase, renderComparisonEmulateDecode, renderComparisonEmulateIntersect, renderComparisonStandard, renderCteColumns, renderCycleClause, renderDerivedTableReference, renderExpressionAsLiteral, renderExpressionsAsSubquery, renderFetch, renderFetchExpression, renderFetchPlusOffsetExpression, renderFetchPlusOffsetExpressionAsLiteral, renderFetchPlusOffsetExpressionAsSingleParameter, renderFirstClause, renderFirstClause, renderFirstSkipClause, renderFirstSkipClause, renderForUpdateClause, renderIntoIntoAndTable, renderLimitOffsetClause, renderLimitOffsetClause, renderLiteral, renderNamedTableReference, renderOffset, renderOffsetExpression, renderOffsetFetchClause, renderOffsetFetchClause, renderOrderBy, renderParameterAsParameter, renderParameterAsParameter, renderPrimaryTableReference, renderQueryGroup, renderRecursiveCteVirtualSelections, renderRootTableGroup, renderRowNumber, renderRowNumberingSelectItems, renderRowsToClause, renderRowsToClause, renderSearchClause, renderSelectExpression, renderSelectExpressionWithCastedOrInlinedPlainParameters, renderSelectSimpleComparison, renderSelectTupleComparison, renderSetClause, renderSkipFirstClause, renderSkipFirstClause, rendersTableReferenceAlias, renderStandardSearchClause, renderTableGroup, renderTableGroupJoin, renderTableReferenceIdentificationVariable, renderTableReferenceJoins, renderTopClause, renderTopClause, renderTopStartAtClause, renderTopStartAtClause, renderTupleComparisonStandard, renderVirtualSelections, resolveAliasedExpression, resolveAliasedExpression, resolveExpressionToAlias, setLimitParameter, setOffsetParameter, shouldEmulateLateralWithIntersect, shouldInlineCte, simpleColumnWriteFragmentRendering, supportsDistinctFromPredicate, supportsDuplicateSelectItemsInQueryGroup, supportsIntersect, supportsJoinInMutationStatementSubquery, supportsNestedSubqueryCorrelation, supportsNestedWithClause, supportsNullPrecedence, supportsQuantifiedPredicates, supportsRecursiveClauseArrayAndRowEmulation, supportsRowValueConstructorDistinctFromSyntax, supportsRowValueConstructorGtLtSyntax, supportsRowValueConstructorSyntax, supportsRowValueConstructorSyntaxInInList, supportsRowValueConstructorSyntaxInInSubQuery, supportsRowValueConstructorSyntaxInQuantifiedPredicates, supportsRowValueConstructorSyntaxInSet, supportsSimpleQueryGrouping, supportsWithClause, supportsWithClauseInSubquery, translate, translateDelete, translateInsert, translateSelect, translateUpdate, useOffsetFetchClause, visitAggregateColumnWriteExpression, visitAnsiCaseSearchedExpression, visitAnsiCaseSimpleExpression, visitAny, visitAssignment, visitBetweenPredicate, visitCaseSearchedExpression, visitCaseSearchedExpression, visitCaseSimpleExpression, visitCaseSimpleExpression, visitCastTarget, visitCollation, visitColumnReference, visitColumnWriteFragment, visitConversion, visitCteContainer, visitCteDefinition, visitCustomTableDelete, visitCustomTableInsert, visitCustomTableUpdate, visitDecodeCaseSearchedExpression, visitDeleteStatement, visitDeleteStatementOnly, visitDistinct, visitDuration, visitDurationUnit, visitEntityTypeLiteral, visitEvery, visitExistsPredicate, visitExtractUnit, visitFilterFragmentPredicate, visitFilterPredicate, visitFormat, visitForUpdateClause, visitFromClause, visitFunctionTableReference, visitGroupByClause, visitGroupedPredicate, visitHavingClause, visitInListPredicate, visitInsertStatement, visitInsertStatementOnly, visitInSubQueryPredicate, visitJdbcLiteral, visitJunction, visitModifiedSubQueryExpression, visitNamedTableReference, visitNegatedPredicate, visitOrderBy, visitOver, visitOverClause, visitOverClause, visitOverflow, visitParameter, visitParameterAsParameter, visitPartitionByClause, visitPartitionExpressions, visitPartitionExpressions, visitQueryLiteral, visitQueryPartTableReference, visitRecursivePath, visitRelationalPredicate, visitReturningColumns, visitReturningColumns, visitSelectClause, visitSelectStatement, visitSelfRenderingExpression, visitSelfRenderingPredicate, visitSetAssignment, visitSortSpecification, visitSortSpecification, visitSqlFragmentPredicate, visitSqlSelectExpression, visitSqlSelection, visitSqlSelectionExpression, visitSqlSelections, visitStandardTableDelete, visitStandardTableInsert, visitStandardTableUpdate, visitStar, visitSummarization, visitTableGroup, visitTableGroupJoin, visitTableReferenceJoin, visitTrimSpecification, visitTuple, visitUnaryOperationExpression, visitUpdateStatement, visitUpdateStatementOnly, visitValuesList, visitValuesTableReference, visitWhereClause, withParameterRenderingMode, withRowNumbering
-
-
-
-
Constructor Detail
-
PostgreSQLSqlAstTranslator
public PostgreSQLSqlAstTranslator(SessionFactoryImplementor sessionFactory, Statement statement)
-
-
Method Detail
-
visitInArrayPredicate
public void visitInArrayPredicate(InArrayPredicate inArrayPredicate)
- Specified by:
visitInArrayPredicate
in interfaceSqlAstWalker
- Overrides:
visitInArrayPredicate
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>
-
renderInsertIntoNoColumns
protected void renderInsertIntoNoColumns(TableInsertStandard tableInsert)
Description copied from class:AbstractSqlAstTranslator
Handle rendering an insert with no columns- Overrides:
renderInsertIntoNoColumns
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
renderExpressionAsClauseItem
protected void renderExpressionAsClauseItem(Expression expression)
- Overrides:
renderExpressionAsClauseItem
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
renderComparison
protected void renderComparison(Expression lhs, ComparisonOperator operator, Expression rhs)
- Overrides:
renderComparison
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitBooleanExpressionPredicate
public void visitBooleanExpressionPredicate(BooleanExpressionPredicate booleanExpressionPredicate)
- Specified by:
visitBooleanExpressionPredicate
in interfaceSqlAstWalker
- Overrides:
visitBooleanExpressionPredicate
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitNullnessPredicate
public void visitNullnessPredicate(NullnessPredicate nullnessPredicate)
- Specified by:
visitNullnessPredicate
in interfaceSqlAstWalker
- Overrides:
visitNullnessPredicate
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
renderMaterializationHint
protected void renderMaterializationHint(CteMaterialization materialization)
- Overrides:
renderMaterializationHint
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>
-
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>
-
getForUpdate
protected String getForUpdate()
- Overrides:
getForUpdate
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
getForShare
protected String getForShare(int timeoutMillis)
- Overrides:
getForShare
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
shouldEmulateFetchClause
protected boolean shouldEmulateFetchClause(QueryPart queryPart)
-
visitQueryGroup
public void visitQueryGroup(QueryGroup queryGroup)
- Specified by:
visitQueryGroup
in interfaceSqlAstWalker
- Overrides:
visitQueryGroup
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitQuerySpec
public void visitQuerySpec(QuerySpec querySpec)
- Specified by:
visitQuerySpec
in interfaceSqlAstWalker
- Overrides:
visitQuerySpec
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitOffsetFetchClause
public void visitOffsetFetchClause(QueryPart queryPart)
- Specified by:
visitOffsetFetchClause
in interfaceSqlAstWalker
- Overrides:
visitOffsetFetchClause
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
supportsRecursiveSearchClause
protected boolean supportsRecursiveSearchClause()
Description copied from class:AbstractSqlAstTranslator
Whether the SQL search clause is supported, which can be used for recursive CTEs.- Overrides:
supportsRecursiveSearchClause
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
supportsRecursiveCycleClause
protected boolean supportsRecursiveCycleClause()
Description copied from class:AbstractSqlAstTranslator
Whether the SQL cycle clause is supported, which can be used for recursive CTEs.- Overrides:
supportsRecursiveCycleClause
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
supportsRecursiveCycleUsingClause
protected boolean supportsRecursiveCycleUsingClause()
Description copied from class:AbstractSqlAstTranslator
Whether the SQL cycle clause supports the using sub-clause.- Overrides:
supportsRecursiveCycleUsingClause
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
renderStandardCycleClause
protected void renderStandardCycleClause(CteStatement cte)
- Overrides:
renderStandardCycleClause
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
renderPartitionItem
protected void renderPartitionItem(Expression expression)
- Overrides:
renderPartitionItem
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitLikePredicate
public void visitLikePredicate(LikePredicate likePredicate)
- Specified by:
visitLikePredicate
in interfaceSqlAstWalker
- Overrides:
visitLikePredicate
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
visitBinaryArithmeticExpression
public void visitBinaryArithmeticExpression(BinaryArithmeticExpression arithmeticExpression)
- Specified by:
visitBinaryArithmeticExpression
in interfaceSqlAstWalker
- Overrides:
visitBinaryArithmeticExpression
in classAbstractSqlAstTranslator<T extends JdbcOperation>
-
-