public class PostgresDialect extends StandardDialect
| Modifier and Type | Class and Description |
|---|---|
static class |
PostgresDialect.PostgresCriteriaBuilder |
static class |
PostgresDialect.PostgresExpressionFunctions |
static class |
PostgresDialect.PostgresJdbcMappingVisitor |
static class |
PostgresDialect.PostgresResultSetType |
static class |
PostgresDialect.PostgresScriptBlockContext |
static class |
PostgresDialect.PostgresSqlLogFormattingVisitor |
StandardDialect.StandardCriteriaBuilder, StandardDialect.StandardExpressionFunctions, StandardDialect.StandardJdbcMappingVisitor, StandardDialect.StandardScriptBlockContext, StandardDialect.StandardSqlLogFormattingVisitor| Modifier and Type | Field and Description |
|---|---|
protected static JdbcType<java.sql.ResultSet> |
RESULT_SET
the JDBC type for
ResultSet |
protected static java.lang.String |
UNIQUE_CONSTRAINT_VIOLATION_STATE_CODE
the SQLState that represents unique violation
|
CLOSE_QUOTE, expressionFunctions, jdbcMappingVisitor, OPEN_QUOTE, sqlLogFormattingVisitor, UNIQUE_CONSTRAINT_VIOLATION_STATE_CODES| Constructor and Description |
|---|
PostgresDialect() |
PostgresDialect(ExpressionFunctions expressionFunctions) |
PostgresDialect(JdbcMappingVisitor jdbcMappingVisitor) |
PostgresDialect(JdbcMappingVisitor jdbcMappingVisitor,
SqlLogFormattingVisitor sqlLogFormattingVisitor) |
PostgresDialect(JdbcMappingVisitor jdbcMappingVisitor,
SqlLogFormattingVisitor sqlLogFormattingVisitor,
ExpressionFunctions expressionFunctions) |
PostgresDialect(SqlLogFormattingVisitor sqlLogFormattingVisitor) |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
createIdentitySequenceFunctionExpression(java.lang.String catalogName,
java.lang.String schemaName,
java.lang.String tableName,
java.lang.String columnName,
boolean isQuoteRequired,
boolean isIdColumnQuoteRequired) |
ScriptBlockContext |
createScriptBlockContext()
Creates the context object to process an SQL block in a script.
|
CriteriaBuilder |
getCriteriaBuilder() |
Sql<?> |
getIdentityReservationSql(java.lang.String catalogName,
java.lang.String schemaName,
java.lang.String tableName,
java.lang.String columnName,
boolean isQuoteRequired,
boolean isIdColumnQuoteRequired,
int reservationSize)
Returns an SQL object to reserve identity in the database.
|
PreparedSql |
getIdentitySelectSql(java.lang.String catalogName,
java.lang.String schemaName,
java.lang.String tableName,
java.lang.String columnName,
boolean isQuoteRequired,
boolean isIdColumnQuoteRequired)
Returns an SQL object to get IDENTITY values that are generated in the database.
|
java.lang.String |
getName()
The dialect name.
|
JdbcType<java.sql.ResultSet> |
getResultSetType()
Returns the
JdbcType object that corresponds to the ResultSet class. |
PreparedSql |
getSequenceNextValSql(java.lang.String qualifiedSequenceName,
long allocationSize)
Returns an SQL object to get next sequence values.
|
UpsertAssembler |
getUpsertAssembler(UpsertAssemblerContext context)
Returns the UpsertAssembler implementation for the given context.
|
boolean |
isUniqueConstraintViolated(java.sql.SQLException sqlException)
Whether the
sqlException represents an unique violation. |
boolean |
supportsIdentity()
Whether this object supports the IDENTITY column.
|
boolean |
supportsIdentityReservation()
Whether this object supports a reservation of identity.
|
boolean |
supportsResultSetReturningAsOutParameter()
Whether this object supports an out parameter that is mapped to a result set in stored
functions or stored procedures .
|
boolean |
supportsSelectForUpdate(SelectForUpdateType type,
boolean withTargets)
Whether this object supports pessimistic locking.
|
boolean |
supportsSequence()
Whether this object supports the SEQUENCE.
|
protected SqlNode |
toForUpdateSqlNode(SqlNode sqlNode,
SelectForUpdateType forUpdateType,
int waitSeconds,
java.lang.String... aliases) |
protected SqlNode |
toPagingSqlNode(SqlNode sqlNode,
long offset,
long limit) |
applyQuote, getAutoGeneratedKeysType, getCauseSQLException, getErrorCode, getExpressionFunctions, getJdbcMappingVisitor, getRootCause, getScriptBlockDelimiter, getSqlLogFormattingVisitor, getSQLState, includesIdentityColumn, removeQuote, supportsAutoGeneratedKeys, supportsBatchUpdateResults, toCountCalculatingSqlNode, toCountGettingSqlNode, transformSelectSqlNode, transformSelectSqlNodeForGettingCountclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsupportsAliasInDeleteClause, supportsAliasInUpdateClause, supportsBatchExecutionReturningGeneratedValues, supportsModOperatorprotected static final java.lang.String UNIQUE_CONSTRAINT_VIOLATION_STATE_CODE
protected static final JdbcType<java.sql.ResultSet> RESULT_SET
ResultSetpublic PostgresDialect()
public PostgresDialect(JdbcMappingVisitor jdbcMappingVisitor)
public PostgresDialect(SqlLogFormattingVisitor sqlLogFormattingVisitor)
public PostgresDialect(ExpressionFunctions expressionFunctions)
public PostgresDialect(JdbcMappingVisitor jdbcMappingVisitor, SqlLogFormattingVisitor sqlLogFormattingVisitor)
public PostgresDialect(JdbcMappingVisitor jdbcMappingVisitor, SqlLogFormattingVisitor sqlLogFormattingVisitor, ExpressionFunctions expressionFunctions)
public java.lang.String getName()
DialectgetName in interface DialectgetName in class StandardDialectprotected SqlNode toForUpdateSqlNode(SqlNode sqlNode, SelectForUpdateType forUpdateType, int waitSeconds, java.lang.String... aliases)
toForUpdateSqlNode in class StandardDialectprotected SqlNode toPagingSqlNode(SqlNode sqlNode, long offset, long limit)
toPagingSqlNode in class StandardDialectpublic boolean isUniqueConstraintViolated(java.sql.SQLException sqlException)
DialectsqlException represents an unique violation.isUniqueConstraintViolated in interface DialectisUniqueConstraintViolated in class StandardDialectsqlException - the SQL exceptiontrue, if the sqlException represents an unique violationpublic PreparedSql getIdentitySelectSql(java.lang.String catalogName, java.lang.String schemaName, java.lang.String tableName, java.lang.String columnName, boolean isQuoteRequired, boolean isIdColumnQuoteRequired)
DialectThis method is available, only if Dialect.supportsIdentity() returns true.
getIdentitySelectSql in interface DialectgetIdentitySelectSql in class StandardDialectcatalogName - the catalog nameschemaName - the schema nametableName - the table namecolumnName - the IDENTITY column nameisQuoteRequired - whether the quotation marks are requiredisIdColumnQuoteRequired - whether the quotation marks are required for the IDENTITY columnpublic Sql<?> getIdentityReservationSql(java.lang.String catalogName, java.lang.String schemaName, java.lang.String tableName, java.lang.String columnName, boolean isQuoteRequired, boolean isIdColumnQuoteRequired, int reservationSize)
DialectThis method is available, only if Dialect.supportsIdentityReservation() returns true.
getIdentityReservationSql in interface DialectgetIdentityReservationSql in class StandardDialectcatalogName - the catalog nameschemaName - the schema nametableName - the table namecolumnName - the IDENTITY column nameisQuoteRequired - whether the quotation marks are requiredisIdColumnQuoteRequired - whether the quotation marks are required for the IDENTITY columnreservationSize - the size of the reservationprotected java.lang.String createIdentitySequenceFunctionExpression(java.lang.String catalogName,
java.lang.String schemaName,
java.lang.String tableName,
java.lang.String columnName,
boolean isQuoteRequired,
boolean isIdColumnQuoteRequired)
public PreparedSql getSequenceNextValSql(java.lang.String qualifiedSequenceName, long allocationSize)
DialectThis method is available, only if Dialect.supportsSequence() returns true.
getSequenceNextValSql in interface DialectgetSequenceNextValSql in class StandardDialectqualifiedSequenceName - the qualified sequence nameallocationSize - the allocation size of the sequencepublic boolean supportsIdentity()
DialectsupportsIdentity in interface DialectsupportsIdentity in class StandardDialecttrue, if this object supports itpublic boolean supportsSequence()
DialectsupportsSequence in interface DialectsupportsSequence in class StandardDialecttrue, if this object supports itpublic boolean supportsIdentityReservation()
DialectsupportsIdentityReservation in interface DialectsupportsIdentityReservation in class StandardDialecttrue, if this object supports itpublic boolean supportsSelectForUpdate(SelectForUpdateType type, boolean withTargets)
DialectsupportsSelectForUpdate in interface DialectsupportsSelectForUpdate in class StandardDialecttype - a kind of pessimistic lockingwithTargets - true if a lock target is specifiedtrue, if this object supports itpublic boolean supportsResultSetReturningAsOutParameter()
DialectsupportsResultSetReturningAsOutParameter in interface DialectsupportsResultSetReturningAsOutParameter in class StandardDialecttrue, if this object supports itpublic JdbcType<java.sql.ResultSet> getResultSetType()
DialectJdbcType object that corresponds to the ResultSet class.
This method is available, only if Dialect.supportsResultSetReturningAsOutParameter() is
true.
getResultSetType in interface DialectgetResultSetType in class StandardDialectJdbcType object for the ResultSet classpublic ScriptBlockContext createScriptBlockContext()
DialectcreateScriptBlockContext in interface DialectcreateScriptBlockContext in class StandardDialectpublic CriteriaBuilder getCriteriaBuilder()
getCriteriaBuilder in interface DialectgetCriteriaBuilder in class StandardDialectpublic UpsertAssembler getUpsertAssembler(UpsertAssemblerContext context)
DialectgetUpsertAssembler in interface DialectgetUpsertAssembler in class StandardDialectcontext - the UpsertAssemblerContext object