Top Description Fields Constructors Methods
org.hibernate.dialect

public Class PostgreSQL81Dialect

extends Dialect
Class Inheritance
Known Direct Subclasses
org.hibernate.dialect.PostgreSQL82Dialect
Annotations
@SuppressWarnings:deprecation
Imports
java.sql.CallableStatement, .DatabaseMetaData, .ResultSet, .SQLException, .Types, java.util.Iterator, .Map, org.hibernate.JDBCException, .LockMode, .LockOptions, .PessimisticLockException, .QueryTimeoutException, org.hibernate.cfg.Environment, org.hibernate.dialect.function.NoArgSQLFunction, .PositionSubstringFunction, .SQLFunctionTemplate, .StandardSQLFunction, .VarArgsSQLFunction, org.hibernate.dialect.identity.IdentityColumnSupport, .PostgreSQL81IdentityColumnSupport, org.hibernate.dialect.pagination.AbstractLimitHandler, .LimitHandler, .LimitHelper, org.hibernate.engine.jdbc.env.spi.IdentifierCaseStrategy, .IdentifierHelper, .IdentifierHelperBuilder, .NameQualifierSupport, org.hibernate.engine.spi.RowSelection, org.hibernate.exception.LockAcquisitionException, org.hibernate.exception.spi.SQLExceptionConversionDelegate, .TemplatedViolatedConstraintNameExtracter, .ViolatedConstraintNameExtracter, org.hibernate.hql.spi.id.IdTableSupportStandardImpl, .MultiTableBulkIdStrategy, org.hibernate.hql.spi.id.local.AfterUseAction, .LocalTemporaryTableBulkIdStrategy, org.hibernate.internal.util.JdbcExceptionHelper, org.hibernate.procedure.internal.PostgresCallableStatementSupport, org.hibernate.procedure.spi.CallableStatementSupport, org.hibernate.type.StandardBasicTypes, org.hibernate.type.descriptor.sql.BlobTypeDescriptor, .ClobTypeDescriptor, .SqlTypeDescriptor

An SQL dialect for Postgres

For discussion of BLOB support in Postgres, as of 8.4, have a peek at http://jdbc.postgresql.org/documentation/84/binary-data.html. For the effects in regards to Hibernate see http://in.relation.to/15492.lace

Author
Gavin King

Field Summary

Modifier and TypeField and Description
private static final ViolatedConstraintNameExtracter
EXTRACTER

Hides org.hibernate.dialect.Dialect.EXTRACTER.

Constraint-name extractor for Postgres constraint violation exceptions.
private static final AbstractLimitHandler
Inherited from org.hibernate.dialect.Dialect:
CLOSED_QUOTEDEFAULT_BATCH_SIZELEGACY_LOB_MERGE_STRATEGYNEW_LOCATOR_LOB_MERGE_STRATEGYNO_BATCHQUOTESTANDARD_DEFAULT_BATCH_LOAD_SIZING_STRATEGYSTREAM_XFER_LOB_MERGE_STRATEGYTWO_SINGLE_QUOTES_REPLACEMENT

Constructor Summary

AccessConstructor and Description
public
PostgreSQL81Dialect()

Constructs a PostgreSQL81Dialect

Method Summary

Modifier and TypeMethod and Description
public boolean
bindLimitParametersInReverseOrder()

Overrides org.hibernate.dialect.Dialect.bindLimitParametersInReverseOrder.

ANSI SQL defines the LIMIT clause to be in the form LIMIT offset, limit.
public IdentifierHelper
buildIdentifierHelper(IdentifierHelperBuilder
A semi-configured IdentifierHelper builder.
builder
,
DatabaseMetaData
Access to the metadata returned from the driver if needed and if available.

Warning

may be null

dbMetaData
)

Overrides org.hibernate.dialect.Dialect.buildIdentifierHelper.

Build the IdentifierHelper indicated by this Dialect for handling identifier conversions.
public SQLExceptionConversionDelegate
buildSQLExceptionConversionDelegate()

Overrides org.hibernate.dialect.Dialect.buildSQLExceptionConversionDelegate.

Build an instance of a SQLExceptionConversionDelegate for interpreting dialect-specific error or SQLState codes.
public boolean
dropConstraints()

Overrides org.hibernate.dialect.Dialect.dropConstraints.

Do we need to drop constraints before dropping tables in this dialect?
public String
getAddColumnString()

Overrides org.hibernate.dialect.Dialect.getAddColumnString.

The syntax used to add a column to a table (optional).
public CallableStatementSupport
public String
getCascadeConstraintsString()

Overrides org.hibernate.dialect.Dialect.getCascadeConstraintsString.

Completely optional cascading drop clause
public String
getCaseInsensitiveLike()

Overrides org.hibernate.dialect.Dialect.getCaseInsensitiveLike.

The name of the SQL function that can do case insensitive like comparison.
public String
getCreateSequenceString(String
The name of the sequence
sequenceName
)

Overrides org.hibernate.dialect.Dialect.getCreateSequenceString.

Typically dialects which support sequences can create a sequence with a single command.
protected String
getCreateSequenceString(String
The name of the sequence
sequenceName
,
int
The initial value to apply to 'create sequence' statement
initialValue
,
int
The increment value to apply to 'create sequence' statement
incrementSize
)

Overrides org.hibernate.dialect.Dialect.getCreateSequenceString.

only necessary for postgre < 7.4 See http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/ref/create_sequence.sgml

Overloaded form of getCreateSequenceString(String), additionally taking the initial value and increment size to be applied to the sequence definition.

public String
getCurrentSchemaCommand()

Overrides org.hibernate.dialect.Dialect.getCurrentSchemaCommand.

Get the SQL command used to retrieve the current schema name.
public String
getCurrentTimestampSelectString()

Overrides org.hibernate.dialect.Dialect.getCurrentTimestampSelectString.

Retrieve the command used to retrieve the current timestamp from the database.
public MultiTableBulkIdStrategy
public String
getDropSequenceString(String
The name of the sequence
sequenceName
)

Overrides org.hibernate.dialect.Dialect.getDropSequenceString.

Typically dialects which support sequences can drop a sequence with a single command.
public String
getForUpdateNowaitString()

Overrides org.hibernate.dialect.Dialect.getForUpdateNowaitString.

Retrieves the FOR UPDATE NOWAIT syntax specific to this dialect.
public String
getForUpdateNowaitString(String
The columns to be write locked.
aliases
)

Overrides org.hibernate.dialect.Dialect.getForUpdateNowaitString.

Get the FOR UPDATE OF column_list NOWAIT fragment appropriate for this dialect given the aliases of the columns to be write locked.
public String
getForUpdateString(String
The columns to be write locked.
aliases
)

Overrides org.hibernate.dialect.Dialect.getForUpdateString.

Get the FOR UPDATE OF column_list fragment appropriate for this dialect given the aliases of the columns to be write locked.
public String
getForUpdateString(String
The columns to be write locked.
aliases
,
LockOptions
the lock options to apply
lockOptions
)

Overrides org.hibernate.dialect.Dialect.getForUpdateString.

Get the FOR UPDATE OF column_list fragment appropriate for this dialect given the aliases of the columns to be write locked.
public String
getForUpdateString()

Overrides org.hibernate.dialect.Dialect.getForUpdateString.

Get the string to append to SELECT statements to acquire locks for this dialect.
public IdentityColumnSupport
public LimitHandler
getLimitHandler()

Overrides org.hibernate.dialect.Dialect.getLimitHandler.

Returns the delegate managing LIMIT clause.
public String
getLimitString(String
The query to which to apply the limit.
sql
,
boolean
Is the query requesting an offset?
hasOffset
)

Overrides org.hibernate.dialect.Dialect.getLimitString.

Apply a limit clause to the query.
public NameQualifierSupport
getNameQualifierSupport()

Overrides org.hibernate.dialect.Dialect.getNameQualifierSupport.

By default interpret this based on DatabaseMetaData.
public String
getNativeIdentifierGeneratorStrategy()

Overrides org.hibernate.dialect.Dialect.getNativeIdentifierGeneratorStrategy.

Resolves the native generation strategy associated to this dialect.
public String
getNoColumnsInsertString()

Overrides org.hibernate.dialect.Dialect.getNoColumnsInsertString.

The fragment used to insert a row without specifying any column values.
public String
getQuerySequencesString()

Overrides org.hibernate.dialect.Dialect.getQuerySequencesString.

Get the select command used retrieve the names of all sequences.
public String
getReadLockString(int
in milliseconds, -1 for indefinite wait and 0 for no wait.
timeout
)

Overrides org.hibernate.dialect.Dialect.getReadLockString.

Get the string to append to SELECT statements to acquire READ locks for this dialect.
public String
getReadLockString(String
The columns to be read locked.
aliases
,
int
in milliseconds, -1 for indefinite wait and 0 for no wait.
timeout
)

Overrides org.hibernate.dialect.Dialect.getReadLockString.

Get the string to append to SELECT statements to acquire READ locks for this dialect given the aliases of the columns to be read locked.
public ResultSet
getResultSet(CallableStatement
The callable statement.
ps
)

Overrides org.hibernate.dialect.Dialect.getResultSet.

Given a callable statement previously processed by registerResultSetOutParameter, extract the ResultSet from the OUT parameter.
public ResultSet
getResultSet(CallableStatement
The callable statement.
statement
,
int
The bind position at which to register the output param.
position
)

Overrides org.hibernate.dialect.Dialect.getResultSet.

Given a callable statement previously processed by registerResultSetOutParameter, extract the ResultSet.
public ResultSet
getResultSet(CallableStatement
The callable statement.
statement
,
String
The parameter name (for drivers which support named parameters).
name
)

Overrides org.hibernate.dialect.Dialect.getResultSet.

Given a callable statement previously processed by registerResultSetOutParameter, extract the ResultSet from the OUT parameter.
public String
getSelectClauseNullString(int
The Types type code.
sqlType
)

Overrides org.hibernate.dialect.Dialect.getSelectClauseNullString.

Workaround for postgres bug #1453

Given a Types type code, determine an appropriate null value to use in a select clause.

public String
getSelectSequenceNextValString(String
the name of the sequence
sequenceName
)

Overrides org.hibernate.dialect.Dialect.getSelectSequenceNextValString.

Generate the select expression fragment that will retrieve the next value of a sequence as part of another (typically DML) statement.
public String
getSequenceNextValString(String
the name of the sequence
sequenceName
)

Overrides org.hibernate.dialect.Dialect.getSequenceNextValString.

Generate the appropriate select statement to to retrieve the next value of a sequence.
public SqlTypeDescriptor
getSqlTypeDescriptorOverride(int
A Types constant indicating the SQL column type
sqlCode
)

Overrides org.hibernate.dialect.Dialect.getSqlTypeDescriptorOverride.

Returns the SqlTypeDescriptor that should be used to handle the given JDBC type code.
public ViolatedConstraintNameExtracter
public String
getWriteLockString(int
in milliseconds, -1 for indefinite wait and 0 for no wait.
timeout
)

Overrides org.hibernate.dialect.Dialect.getWriteLockString.

Get the string to append to SELECT statements to acquire WRITE locks for this dialect.
public String
getWriteLockString(String
The columns to be read locked.
aliases
,
int
in milliseconds, -1 for indefinite wait and 0 for no wait.
timeout
)

Overrides org.hibernate.dialect.Dialect.getWriteLockString.

Get the string to append to SELECT statements to acquire WRITE locks for this dialect given the aliases of the columns to be write locked.
public boolean
public boolean
qualifyIndexName()

Overrides org.hibernate.dialect.Dialect.qualifyIndexName.

Do we need to qualify index names with the schema name?
public int
registerResultSetOutParameter(CallableStatement
The callable statement.
statement
,
int
The bind position at which to register the output param.
col
)

Overrides org.hibernate.dialect.Dialect.registerResultSetOutParameter.

Registers a parameter (either OUT, or the new REF_CURSOR param type available in Java 8) capable of returning ResultSet *by position*.
public boolean
requiresParensForTupleDistinctCounts()

Overrides org.hibernate.dialect.Dialect.requiresParensForTupleDistinctCounts.

If supportsTupleDistinctCounts() is true, does the Dialect require the tuple to be wrapped with parens?
public boolean
supportsCaseInsensitiveLike()

Overrides org.hibernate.dialect.Dialect.supportsCaseInsensitiveLike.

Does this dialect support case insensitive LIKE restrictions?
public boolean
supportsCommentOn()

Overrides org.hibernate.dialect.Dialect.supportsCommentOn.

Does this dialect/database support commenting on tables, columns, etc?
public boolean
supportsCurrentTimestampSelection()

Overrides org.hibernate.dialect.Dialect.supportsCurrentTimestampSelection.

Does this dialect support a way to retrieve the database's current timestamp value?
public boolean
supportsEmptyInList()

Overrides org.hibernate.dialect.Dialect.supportsEmptyInList.

Does this dialect support empty IN lists?
public boolean
supportsExpectedLobUsagePattern()

Overrides org.hibernate.dialect.Dialect.supportsExpectedLobUsagePattern.

Expected LOB usage pattern is such that I can perform an insert via prepared statement with a parameter binding for a LOB value without crazy casting to JDBC driver implementation-specific classes...
public boolean
supportsJdbcConnectionLobCreation(DatabaseMetaData
JDBC DatabaseMetaData which can be used if LOB creation is supported only starting from a given Driver version
databaseMetaData
)

Overrides org.hibernate.dialect.Dialect.supportsJdbcConnectionLobCreation.

Check whether the JDBC Connection supports creating LOBs via Connection#createBlob(), Connection#createNClob() or Connection#createClob().
public boolean
supportsLimit()

Overrides org.hibernate.dialect.Dialect.supportsLimit.

Does this dialect support some form of limiting query results via a SQL clause?
public boolean
supportsLobValueChangePropogation()

Overrides org.hibernate.dialect.Dialect.supportsLobValueChangePropogation.

Does the dialect support propagating changes to LOB values back to the database?
public boolean
supportsNationalizedTypes()

Overrides org.hibernate.dialect.Dialect.supportsNationalizedTypes.

Does this dialect supports Nationalized Types
public boolean
supportsNoWait()

Overrides org.hibernate.dialect.Dialect.supportsNoWait.

Does this dialect/database support NO_WAIT timeout.
public boolean
supportsOuterJoinForUpdate()

Overrides org.hibernate.dialect.Dialect.supportsOuterJoinForUpdate.

Does this dialect support FOR UPDATE in conjunction with outer joined rows?
public boolean
supportsPooledSequences()

Overrides org.hibernate.dialect.Dialect.supportsPooledSequences.

Does this dialect support "pooled" sequences.
public boolean
supportsRowValueConstructorSyntax()

Overrides org.hibernate.dialect.Dialect.supportsRowValueConstructorSyntax.

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

Overrides org.hibernate.dialect.Dialect.supportsSequences.

Does this dialect support sequences?
public boolean
supportsUnboundedLobLocatorMaterialization()

Overrides org.hibernate.dialect.Dialect.supportsUnboundedLobLocatorMaterialization.

Is it supported to materialize a LOB locator outside the transaction in which it was created?
public boolean
supportsUnionAll()

Overrides org.hibernate.dialect.Dialect.supportsUnionAll.

Does this dialect support UNION ALL, which is generally a faster variant of UNION?
public String
toBooleanValueString(boolean
The boolean value
bool
)

Overrides org.hibernate.dialect.Dialect.toBooleanValueString.

The SQL literal value to which this database maps boolean values.
public boolean
useInputStreamToInsertBlob()

Overrides org.hibernate.dialect.Dialect.useInputStreamToInsertBlob.

Should LOBs (both BLOB and CLOB) be bound using stream operations (i.e. PreparedStatement#setBinaryStream).
Inherited from org.hibernate.dialect.Dialect:
addSqlHintOrCommentappendLockHintappendLockHintapplyLocksToSqlareStringComparisonsCaseInsensitiveaugmentPhysicalTableTypesaugmentRecognizedTableTypesbindLimitParametersFirstbuildSQLExceptionConvertercanCreateCatalogcanCreateSchemacastcastcastcloseQuotecontributeTypesconvertToFirstRowValuecreateCaseFragmentcreateOuterJoinFragmentdefaultScrollModedoesReadCommittedCauseWritersToBlockReadersdoesRepeatableReadCauseReadersToBlockWritersequivalentTypesescapeCommentescapeLiteralforceLimitUsageforceLobAsLastValueforUpdateOfColumnsgetAddColumnSuffixStringgetAddForeignKeyConstraintStringgetAddForeignKeyConstraintStringgetAddPrimaryKeyConstraintStringgetAddUniqueConstraintStringgetAlterTableStringgetAuxiliaryDatabaseObjectExportergetCastTypeNamegetColumnAliasExtractorgetColumnCommentgetCreateCatalogCommandgetCreateMultisetTableStringgetCreateSchemaCommandgetCreateSequenceStringsgetCreateSequenceStringsgetCreateTableStringgetCreateTemporaryTableColumnAnnotationgetCrossJoinSeparatorgetCurrentTimestampSQLFunctionNamegetDefaultBatchLoadSizingStrategygetDefaultPropertiesgetDialectgetDialectgetDropCatalogCommandgetDropForeignKeyStringgetDropSchemaCommandgetDropSequenceStringsgetDropTableStringgetForeignKeyExportergetForUpdateSkipLockedStringgetForUpdateSkipLockedStringgetForUpdateStringgetForUpdateStringgetFunctionsgetHibernateTypeNamegetHibernateTypeNamegetIndexExportergetInExpressionCountLimitgetKeywordsgetLimitStringgetLobMergeStrategygetLockingStrategygetLowercaseFunctiongetMaxAliasLengthgetNativeIdentifierGeneratorClassgetNotExpressiongetNullColumnStringgetQueryHintStringgetQueryHintStringgetSchemaNameResolvergetSelectGUIDStringgetSequenceExportergetSequenceInformationExtractorgetTableCommentgetTableExportergetTableTypeStringgetTypeNamegetTypeNamegetUniqueDelegategetUniqueKeyExporterhasAlterTablehasSelfReferentialForeignKeyBuginlineLiteralisJdbcLogWarningsEnabledByDefaultisLegacyLimitHandlerBehaviorEnabledisLockTimeoutParameterizedisTypeNameRegisteredopenQuoteprependCommentquoteregisterColumnTyperegisterColumnTyperegisterFunctionregisterHibernateTyperegisterHibernateTyperegisterKeywordregisterResultSetOutParameterremapSqlTypeDescriptorrenderOrderByElementreplaceResultVariableInOrderByClauseWithPositionrequiresCastingOfParametersInSelectClausesupportsBindAsCallableArgumentsupportsCascadeDeletesupportsCircularCascadeDeleteConstraintssupportsColumnChecksupportsExistsInSelectsupportsIfExistsAfterAlterTablesupportsIfExistsAfterConstraintNamesupportsIfExistsAfterTableNamesupportsIfExistsBeforeConstraintNamesupportsIfExistsBeforeTableNamesupportsLimitOffsetsupportsLockTimeoutssupportsNamedParameterssupportsNoColumnsInsertsupportsNonQueryWithCTEsupportsNotNullUniquesupportsParametersInInsertSelectsupportsPartitionBysupportsResultSetPositionQueryMethodsOnForwardOnlyCursorsupportsRowValueConstructorSyntaxInInListsupportsRowValueConstructorSyntaxInSetsupportsSkipLockedsupportsSubqueryOnMutatingTablesupportsSubselectAsInPredicateLHSsupportsTableChecksupportsTupleCountssupportsTupleDistinctCountssupportsTuplesInSubqueriessupportsUniquesupportsUniqueConstraintInCreateAlterTablesupportsValuesListsupportsVariableLimittoStringtransformSelectStringuseFollowOnLockinguseFollowOnLockinguseMaxForLimit