Top Description Fields Constructors Methods
org.hibernate.dialect

public Class PostgreSQLDialect

extends Dialect
Class Inheritance
Known Direct Subclasses
org.hibernate.dialect.PostgresPlusDialect
Imports
java.sql.CallableStatement, .ResultSet, .SQLException, .Types, org.hibernate.Hibernate, .LockOptions, org.hibernate.cfg.Environment, org.hibernate.dialect.function.NoArgSQLFunction, .PositionSubstringFunction, .SQLFunctionTemplate, .StandardSQLFunction, .VarArgsSQLFunction, org.hibernate.exception.JDBCExceptionHelper, .TemplatedViolatedConstraintNameExtracter, .ViolatedConstraintNameExtracter, org.hibernate.id.SequenceGenerator, org.hibernate.type.MaterializedBlobType

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 ViolatedConstraintNameExtracter
EXTRACTER

Hides org.hibernate.dialect.Dialect.EXTRACTER.

Constraint-name extractor for Postgres contraint violation exceptions.
Inherited from org.hibernate.dialect.Dialect:
CLOSED_QUOTEDEFAULT_BATCH_SIZENO_BATCHQUOTE

Constructor Summary

AccessConstructor and Description
public

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 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 String
getCascadeConstraintsString()

Overrides org.hibernate.dialect.Dialect.getCascadeConstraintsString.

Completely optional cascading drop clause
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.

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

Overrides org.hibernate.dialect.Dialect.getCreateTemporaryTablePostfix.

Get any fragments needing to be postfixed to the command for temporary table creation.
public String
public String
getCurrentTimestampSelectString()

Overrides org.hibernate.dialect.Dialect.getCurrentTimestampSelectString.

Retrieve the command used to retrieve the current timestamp from the database.
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
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()

Overrides org.hibernate.dialect.Dialect.getForUpdateString.

Get the string to append to SELECT statements to acquire locks for this dialect.
public String
getIdentityColumnString(int
The java.sql.Types type code.
type
)

Overrides org.hibernate.dialect.Dialect.getIdentityColumnString.

The syntax used during DDL to define a column as being an IDENTITY of a particular type.
public String
getIdentitySelectString(String
The table into which the insert was done
table
,
String
The PK column.
column
,
int
The java.sql.Types type code.
type
)

Overrides org.hibernate.dialect.Dialect.getIdentitySelectString.

Get the select command to use to retrieve the last generated IDENTITY value for a particular table
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 s limit clause to the query.
public Class<T>
getNativeIdentifierGeneratorClass()

Overrides org.hibernate.dialect.Dialect.getNativeIdentifierGeneratorClass.

The class (which implements org.hibernate.id.IdentifierGenerator) which acts as this dialects native generation strategy.
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 WRITE locks for this dialect.
public ResultSet
getResultSet(CallableStatement
The callable statement.
ps
)

Overrides org.hibernate.dialect.Dialect.getResultSet.

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

Overrides org.hibernate.dialect.Dialect.getSelectClauseNullString.

Workaround for postgres bug #1453
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 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 boolean
hasDataTypeInIdentityColumn()

Overrides org.hibernate.dialect.Dialect.hasDataTypeInIdentityColumn.

Whether this dialect have an Identity clause added to the data type or a completely separate identity data type
public boolean
public int
registerResultSetOutParameter(CallableStatement
The callable statement.
statement
,
int
The bind position at which to register the OUT param.
col
)

Overrides org.hibernate.dialect.Dialect.registerResultSetOutParameter.

Registers an OUT parameter which will be returning a java.sql.ResultSet.
public boolean
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
supportsIdentityColumns()

Overrides org.hibernate.dialect.Dialect.supportsIdentityColumns.

Does this dialect support identity column key generation?
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
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
supportsSequences()

Overrides org.hibernate.dialect.Dialect.supportsSequences.

Does this dialect support sequences?
public boolean
supportsTemporaryTables()

Overrides org.hibernate.dialect.Dialect.supportsTemporaryTables.

Does this dialect support temporary tables?
public boolean
supportsTupleDistinctCounts()

Overrides org.hibernate.dialect.Dialect.supportsTupleDistinctCounts.

Does this dialect support `count(distinct a,b)`?
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. java.sql.PreparedStatement#setBinaryStream).
Inherited from org.hibernate.dialect.Dialect:
addTypeOverrideappendIdentitySelectToInsertappendLockHintapplyLocksToSqlareStringComparisonsCaseInsensitivebindLimitParametersFirstbuildSQLExceptionConvertercloseQuoteconvertToFirstRowValuecreateCaseFragmentcreateOuterJoinFragmentdoesReadCommittedCauseWritersToBlockReadersdoesRepeatableReadCauseReadersToBlockWritersdropTemporaryTableAfterUseforceLimitUsageforUpdateOfColumnsgenerateTemporaryTableNamegetAddForeignKeyConstraintStringgetAddPrimaryKeyConstraintStringgetCastTypeNamegetColumnAliasExtractorgetColumnCommentgetCreateMultisetTableStringgetCreateSequenceStringsgetCreateSequenceStringsgetCreateTableStringgetCrossJoinSeparatorgetCurrentTimestampSQLFunctionNamegetDefaultPropertiesgetDialectgetDialectgetDropForeignKeyStringgetDropSequenceStringsgetDropTemporaryTableStringgetForUpdateNowaitStringgetForUpdateNowaitStringgetForUpdateStringgetForUpdateStringgetForUpdateStringgetFunctionsgetHibernateTypeNamegetHibernateTypeNamegetIdentityColumnStringgetIdentityInsertStringgetIdentitySelectStringgetKeywordsgetLimitStringgetLockingStrategygetLowercaseFunctiongetMaxAliasLengthgetNullColumnStringgetSelectGUIDStringgetTableCommentgetTableTypeStringgetTypeNamegetTypeNamegetTypeOverrideshasAlterTablehasSelfReferentialForeignKeyBugisLockTimeoutParameterizedopenQuoteperformTemporaryTableDDLInIsolationqualifyIndexNamequoteregisterColumnTyperegisterColumnTyperegisterFunctionregisterHibernateTyperegisterHibernateTyperegisterKeywordreplaceResultVariableInOrderByClauseWithPositionrequiresCastingOfParametersInSelectClausesupportsBindAsCallableArgumentsupportsCascadeDeletesupportsCircularCascadeDeleteConstraintssupportsColumnChecksupportsExistsInSelectsupportsIfExistsAfterTableNamesupportsIfExistsBeforeTableNamesupportsInsertSelectIdentitysupportsLimitOffsetsupportsLockTimeoutssupportsNotNullUniquesupportsParametersInInsertSelectsupportsResultSetPositionQueryMethodsOnForwardOnlyCursorsupportsRowValueConstructorSyntaxsupportsRowValueConstructorSyntaxInInListsupportsSubqueryOnMutatingTablesupportsSubselectAsInPredicateLHSsupportsTableChecksupportsTupleCountssupportsUniquesupportsUniqueConstraintInCreateAlterTablesupportsVariableLimittoStringtransformSelectStringuseMaxForLimit

Field Detail

EXTRACTERback to summary
private static ViolatedConstraintNameExtracter EXTRACTER

Hides org.hibernate.dialect.Dialect.EXTRACTER.

Constraint-name extractor for Postgres contraint violation exceptions. Orginally contributed by Denny Bartelt.

Constructor Detail

PostgreSQLDialectback to summary
public PostgreSQLDialect()

Method Detail

bindLimitParametersInReverseOrderback to summary
public boolean bindLimitParametersInReverseOrder()

Overrides org.hibernate.dialect.Dialect.bindLimitParametersInReverseOrder.

Doc from org.hibernate.dialect.Dialect.bindLimitParametersInReverseOrder.

ANSI SQL defines the LIMIT clause to be in the form LIMIT offset, limit. Does this dialect require us to bind the parameters in reverse order?

Returns:boolean

true if the correct order is limit, offset

dropConstraintsback to summary
public boolean dropConstraints()

Overrides org.hibernate.dialect.Dialect.dropConstraints.

Doc from org.hibernate.dialect.Dialect.dropConstraints.

Do we need to drop constraints before dropping tables in this dialect?

Returns:boolean

True if constraints must be dropped prior to dropping the table; false otherwise.

getAddColumnStringback to summary
public String getAddColumnString()

Overrides org.hibernate.dialect.Dialect.getAddColumnString.

Doc from org.hibernate.dialect.Dialect.getAddColumnString.

The syntax used to add a column to a table (optional).

Returns:String

The "add column" fragment.

getCascadeConstraintsStringback to summary
public String getCascadeConstraintsString()

Overrides org.hibernate.dialect.Dialect.getCascadeConstraintsString.

Doc from org.hibernate.dialect.Dialect.getCascadeConstraintsString.

Completely optional cascading drop clause

Returns:String

String

getCreateSequenceStringback to summary
public String getCreateSequenceString(String sequenceName)

Overrides org.hibernate.dialect.Dialect.getCreateSequenceString.

Doc from org.hibernate.dialect.Dialect.getCreateSequenceString.

Typically dialects which support sequences can create a sequence with a single command. This is convenience form of getCreateSequenceStrings to help facilitate that.

Dialects which support sequences and can create a sequence in a single command need *only* override this method. Dialects which support sequences but require multiple commands to create a sequence should instead override getCreateSequenceStrings.

Parameters
sequenceName:String

The name of the sequence

Returns:String

The sequence creation command

getCreateSequenceStringback to summary
protected String getCreateSequenceString(String sequenceName, int initialValue, int incrementSize)

Overrides org.hibernate.dialect.Dialect.getCreateSequenceString.

Doc from org.hibernate.dialect.Dialect.getCreateSequenceString.

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

The default definition is to suffix getCreateSequenceString(String) with the string: " start with {initialValue} increment by {incrementSize}" where {initialValue} and {incrementSize} are replacement placeholders. Generally dialects should only need to override this method if different key phrases are used to apply the allocation information.
Parameters
sequenceName:String

The name of the sequence

initialValue:int

The initial value to apply to 'create sequence' statement

incrementSize:int

The increment value to apply to 'create sequence' statement

Returns:String

The sequence creation command

getCreateTemporaryTablePostfixback to summary
public String getCreateTemporaryTablePostfix()

Overrides org.hibernate.dialect.Dialect.getCreateTemporaryTablePostfix.

Doc from org.hibernate.dialect.Dialect.getCreateTemporaryTablePostfix.

Get any fragments needing to be postfixed to the command for temporary table creation.

Returns:String

Any required postfix.

getCreateTemporaryTableStringback to summary
public String getCreateTemporaryTableString()

Overrides org.hibernate.dialect.Dialect.getCreateTemporaryTableString.

Doc from org.hibernate.dialect.Dialect.getCreateTemporaryTableString.

Command used to create a temporary table.

Returns:String

The command used to create a temporary table.

getCurrentTimestampSelectStringback to summary
public String getCurrentTimestampSelectString()

Overrides org.hibernate.dialect.Dialect.getCurrentTimestampSelectString.

Doc from org.hibernate.dialect.Dialect.getCurrentTimestampSelectString.

Retrieve the command used to retrieve the current timestamp from the database.

Returns:String

The command.

getDropSequenceStringback to summary
public String getDropSequenceString(String sequenceName)

Overrides org.hibernate.dialect.Dialect.getDropSequenceString.

Doc from org.hibernate.dialect.Dialect.getDropSequenceString.

Typically dialects which support sequences can drop a sequence with a single command. This is convenience form of getDropSequenceStrings to help facilitate that.

Dialects which support sequences and can drop a sequence in a single command need *only* override this method. Dialects which support sequences but require multiple commands to drop a sequence should instead override getDropSequenceStrings.

Parameters
sequenceName:String

The name of the sequence

Returns:String

The sequence drop commands

getForUpdateStringback to summary
public String getForUpdateString(String aliases)

Overrides org.hibernate.dialect.Dialect.getForUpdateString.

Doc from 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.

Parameters
aliases:String

The columns to be write locked.

Returns:String

The appropriate FOR UPDATE OF column_list clause string.

getForUpdateStringback to summary
public String getForUpdateString()

Overrides org.hibernate.dialect.Dialect.getForUpdateString.

Doc from org.hibernate.dialect.Dialect.getForUpdateString.

Get the string to append to SELECT statements to acquire locks for this dialect.

Returns:String

The appropriate FOR UPDATE clause string.

getIdentityColumnStringback to summary
public String getIdentityColumnString(int type)

Overrides org.hibernate.dialect.Dialect.getIdentityColumnString.

Doc from org.hibernate.dialect.Dialect.getIdentityColumnString.

The syntax used during DDL to define a column as being an IDENTITY of a particular type.

Parameters
type:int

The java.sql.Types type code.

Returns:String

The appropriate DDL fragment.

getIdentitySelectStringback to summary
public String getIdentitySelectString(String table, String column, int type)

Overrides org.hibernate.dialect.Dialect.getIdentitySelectString.

Doc from org.hibernate.dialect.Dialect.getIdentitySelectString.

Get the select command to use to retrieve the last generated IDENTITY value for a particular table

Parameters
table:String

The table into which the insert was done

column:String

The PK column.

type:int

The java.sql.Types type code.

Returns:String

The appropriate select command

getLimitStringback to summary
public String getLimitString(String sql, boolean hasOffset)

Overrides org.hibernate.dialect.Dialect.getLimitString.

Doc from org.hibernate.dialect.Dialect.getLimitString.

Apply s limit clause to the query.

Typically dialects utilize variable limit clauses when they support limits. Thus, when building the select command we do not actually need to know the limit or the offest since we will just be using placeholders.

Here we do still pass along whether or not an offset was specified so that dialects not supporting offsets can generate proper exceptions. In general, dialects will override one or the other of this method and getLimitString(String, int, int).

Parameters
sql:String

The query to which to apply the limit.

hasOffset:boolean

Is the query requesting an offset?

Returns:String

the modified SQL

getNativeIdentifierGeneratorClassback to summary
public Class<T> getNativeIdentifierGeneratorClass()

Overrides org.hibernate.dialect.Dialect.getNativeIdentifierGeneratorClass.

Doc from org.hibernate.dialect.Dialect.getNativeIdentifierGeneratorClass.

The class (which implements org.hibernate.id.IdentifierGenerator) which acts as this dialects native generation strategy.

Comes into play whenever the user specifies the native generator.

Returns:Class<T>

The native generator class.

getNoColumnsInsertStringback to summary
public String getNoColumnsInsertString()

Overrides org.hibernate.dialect.Dialect.getNoColumnsInsertString.

Doc from org.hibernate.dialect.Dialect.getNoColumnsInsertString.

The fragment used to insert a row without specifying any column values. This is not possible on some databases.

Returns:String

The appropriate empty values clause.

getQuerySequencesStringback to summary
public String getQuerySequencesString()

Overrides org.hibernate.dialect.Dialect.getQuerySequencesString.

Doc from org.hibernate.dialect.Dialect.getQuerySequencesString.

Get the select command used retrieve the names of all sequences.

Returns:String

The select command; or null if sequences are not supported.

getReadLockStringback to summary
public String getReadLockString(int timeout)

Overrides org.hibernate.dialect.Dialect.getReadLockString.

Doc from org.hibernate.dialect.Dialect.getReadLockString.

Get the string to append to SELECT statements to acquire WRITE locks for this dialect. Location of the of the returned string is treated the same as getForUpdateString.

Parameters
timeout:int

in milliseconds, -1 for indefinite wait and 0 for no wait.

Returns:String

The appropriate LOCK clause string.

getResultSetback to summary
public ResultSet getResultSet(CallableStatement ps) throws SQLException

Overrides org.hibernate.dialect.Dialect.getResultSet.

Doc from org.hibernate.dialect.Dialect.getResultSet.

Given a callable statement previously processed by registerResultSetOutParameter, extract the java.sql.ResultSet from the OUT parameter.

Parameters
ps:CallableStatement

The callable statement.

Returns:ResultSet

The extracted result set.

Exceptions
SQLException:
Indicates problems extracting the result set.
getSelectClauseNullStringback to summary
public String getSelectClauseNullString(int sqlType)

Overrides org.hibernate.dialect.Dialect.getSelectClauseNullString.

Workaround for postgres bug #1453

Parameters
sqlType:int

Doc from org.hibernate.dialect.Dialect.getSelectClauseNullString.

The java.sql.Types type code.

Returns:String

Doc from org.hibernate.dialect.Dialect.getSelectClauseNullString.

The appropriate select clause value fragment.

getSelectSequenceNextValStringback to summary
public String getSelectSequenceNextValString(String sequenceName)

Overrides org.hibernate.dialect.Dialect.getSelectSequenceNextValString.

Doc from 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.

This differs from getSequenceNextValString(String) in that this should return an expression usable within another statement.

Parameters
sequenceName:String

the name of the sequence

Returns:String

The "nextval" fragment.

getSequenceNextValStringback to summary
public String getSequenceNextValString(String sequenceName)

Overrides org.hibernate.dialect.Dialect.getSequenceNextValString.

Doc from org.hibernate.dialect.Dialect.getSequenceNextValString.

Generate the appropriate select statement to to retrieve the next value of a sequence.

This should be a "stand alone" select statement.

Parameters
sequenceName:String

the name of the sequence

Returns:String

String The "nextval" select string.

getViolatedConstraintNameExtracterback to summary
public ViolatedConstraintNameExtracter getViolatedConstraintNameExtracter()

Overrides org.hibernate.dialect.Dialect.getViolatedConstraintNameExtracter.

getWriteLockStringback to summary
public String getWriteLockString(int timeout)

Overrides org.hibernate.dialect.Dialect.getWriteLockString.

Doc from org.hibernate.dialect.Dialect.getWriteLockString.

Get the string to append to SELECT statements to acquire WRITE locks for this dialect. Location of the of the returned string is treated the same as getForUpdateString.

Parameters
timeout:int

in milliseconds, -1 for indefinite wait and 0 for no wait.

Returns:String

The appropriate LOCK clause string.

hasDataTypeInIdentityColumnback to summary
public boolean hasDataTypeInIdentityColumn()

Overrides org.hibernate.dialect.Dialect.hasDataTypeInIdentityColumn.

Doc from org.hibernate.dialect.Dialect.hasDataTypeInIdentityColumn.

Whether this dialect have an Identity clause added to the data type or a completely separate identity data type

Returns:boolean

boolean

isCurrentTimestampSelectStringCallableback to summary
public boolean isCurrentTimestampSelectStringCallable()

Overrides org.hibernate.dialect.Dialect.isCurrentTimestampSelectStringCallable.

Doc from org.hibernate.dialect.Dialect.isCurrentTimestampSelectStringCallable.

Should the value returned by getCurrentTimestampSelectString be treated as callable. Typically this indicates that JDBC escape syntax is being used...

Returns:boolean

True if the getCurrentTimestampSelectString return is callable; false otherwise.

registerResultSetOutParameterback to summary
public int registerResultSetOutParameter(CallableStatement statement, int col) throws SQLException

Overrides org.hibernate.dialect.Dialect.registerResultSetOutParameter.

Doc from org.hibernate.dialect.Dialect.registerResultSetOutParameter.

Registers an OUT parameter which will be returning a java.sql.ResultSet. How this is accomplished varies greatly from DB to DB, hence its inclusion (along with getResultSet) here.

Parameters
statement:CallableStatement

The callable statement.

col:int

The bind position at which to register the OUT param.

Returns:int

The number of (contiguous) bind positions used.

Exceptions
SQLException:
Indicates problems registering the OUT param.
supportsCommentOnback to summary
public boolean supportsCommentOn()

Overrides org.hibernate.dialect.Dialect.supportsCommentOn.

supportsCurrentTimestampSelectionback to summary
public boolean supportsCurrentTimestampSelection()

Overrides org.hibernate.dialect.Dialect.supportsCurrentTimestampSelection.

Doc from org.hibernate.dialect.Dialect.supportsCurrentTimestampSelection.

Does this dialect support a way to retrieve the database's current timestamp value?

Returns:boolean

True if the current timestamp can be retrieved; false otherwise.

supportsEmptyInListback to summary
public boolean supportsEmptyInList()

Overrides org.hibernate.dialect.Dialect.supportsEmptyInList.

Doc from org.hibernate.dialect.Dialect.supportsEmptyInList.

Does this dialect support empty IN lists?

For example, is [where XYZ in ()] a supported construct?

Returns:boolean

True if empty in lists are supported; false otherwise.

supportsExpectedLobUsagePatternback to summary
public boolean supportsExpectedLobUsagePattern()

Overrides org.hibernate.dialect.Dialect.supportsExpectedLobUsagePattern.

Doc from 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...

Part of the trickiness here is the fact that this is largely driver dependent. For example, Oracle (which is notoriously bad with LOB support in their drivers historically) actually does a pretty good job with LOB support as of the 10.2.x versions of their drivers...

Returns:boolean

True if normal LOB usage patterns can be used with this driver; false if driver-specific hookiness needs to be applied.

Annotations
@Override
supportsIdentityColumnsback to summary
public boolean supportsIdentityColumns()

Overrides org.hibernate.dialect.Dialect.supportsIdentityColumns.

Doc from org.hibernate.dialect.Dialect.supportsIdentityColumns.

Does this dialect support identity column key generation?

Returns:boolean

True if IDENTITY columns are supported; false otherwise.

supportsLimitback to summary
public boolean supportsLimit()

Overrides org.hibernate.dialect.Dialect.supportsLimit.

Doc from org.hibernate.dialect.Dialect.supportsLimit.

Does this dialect support some form of limiting query results via a SQL clause?

Returns:boolean

True if this dialect supports some form of LIMIT.

supportsLobValueChangePropogationback to summary
public boolean supportsLobValueChangePropogation()

Overrides org.hibernate.dialect.Dialect.supportsLobValueChangePropogation.

Doc from org.hibernate.dialect.Dialect.supportsLobValueChangePropogation.

Does the dialect support propagating changes to LOB values back to the database? Talking about mutating the internal value of the locator as opposed to supplying a new locator instance...

For BLOBs, the internal value might be changed by: java.sql.Blob#setBinaryStream, java.sql.Blob#setBytes(long, byte[]), java.sql.Blob#setBytes(long, byte[], int, int), or java.sql.Blob#truncate(long).

For CLOBs, the internal value might be changed by: java.sql.Clob#setAsciiStream(long), java.sql.Clob#setCharacterStream(long), java.sql.Clob#setString(long, String), java.sql.Clob#setString(long, String, int, int), or java.sql.Clob#truncate(long).

NOTE : I do not know the correct answer currently for databases which (1) are not part of the cruise control process or (2) do not supportsExpectedLobUsagePattern.

Returns:boolean

True if the changes are propagated back to the database; false otherwise.

Annotations
@Override
supportsOuterJoinForUpdateback to summary
public boolean supportsOuterJoinForUpdate()

Overrides org.hibernate.dialect.Dialect.supportsOuterJoinForUpdate.

Doc from org.hibernate.dialect.Dialect.supportsOuterJoinForUpdate.

Does this dialect support FOR UPDATE in conjunction with outer joined rows?

Returns:boolean

True if outer joined rows can be locked via FOR UPDATE.

supportsPooledSequencesback to summary
public boolean supportsPooledSequences()

Overrides org.hibernate.dialect.Dialect.supportsPooledSequences.

Doc from org.hibernate.dialect.Dialect.supportsPooledSequences.

Does this dialect support "pooled" sequences. Not aware of a better name for this. Essentially can we specify the initial and increment values?

Returns:boolean

True if such "pooled" sequences are supported; false otherwise.

supportsSequencesback to summary
public boolean supportsSequences()

Overrides org.hibernate.dialect.Dialect.supportsSequences.

Doc from org.hibernate.dialect.Dialect.supportsSequences.

Does this dialect support sequences?

Returns:boolean

True if sequences supported; false otherwise.

supportsTemporaryTablesback to summary
public boolean supportsTemporaryTables()

Overrides org.hibernate.dialect.Dialect.supportsTemporaryTables.

Doc from org.hibernate.dialect.Dialect.supportsTemporaryTables.

Does this dialect support temporary tables?

Returns:boolean

True if temp tables are supported; false otherwise.

supportsTupleDistinctCountsback to summary
public boolean supportsTupleDistinctCounts()

Overrides org.hibernate.dialect.Dialect.supportsTupleDistinctCounts.

Doc from org.hibernate.dialect.Dialect.supportsTupleDistinctCounts.

Does this dialect support `count(distinct a,b)`?

Returns:boolean

True if the database supports counting disintct tuples; false otherwise.

supportsUnboundedLobLocatorMaterializationback to summary
public boolean supportsUnboundedLobLocatorMaterialization()

Overrides org.hibernate.dialect.Dialect.supportsUnboundedLobLocatorMaterialization.

Doc from org.hibernate.dialect.Dialect.supportsUnboundedLobLocatorMaterialization.

Is it supported to materialize a LOB locator outside the transaction in which it was created?

Again, part of the trickiness here is the fact that this is largely driver dependent.

Note

all database I have tested which supportsExpectedLobUsagePattern() also support the ability to materialize a LOB outside the owning transaction...

Returns:boolean

True if unbounded materialization is supported; false otherwise.

Annotations
@Override
supportsUnionAllback to summary
public boolean supportsUnionAll()

Overrides org.hibernate.dialect.Dialect.supportsUnionAll.

Doc from org.hibernate.dialect.Dialect.supportsUnionAll.

Does this dialect support UNION ALL, which is generally a faster variant of UNION?

Returns:boolean

True if UNION ALL is supported; false otherwise.

toBooleanValueStringback to summary
public String toBooleanValueString(boolean bool)

Overrides org.hibernate.dialect.Dialect.toBooleanValueString.

Doc from org.hibernate.dialect.Dialect.toBooleanValueString.

The SQL literal value to which this database maps boolean values.

Parameters
bool:boolean

The boolean value

Returns:String

The appropriate SQL literal.

useInputStreamToInsertBlobback to summary
public boolean useInputStreamToInsertBlob()

Overrides org.hibernate.dialect.Dialect.useInputStreamToInsertBlob.

Doc from org.hibernate.dialect.Dialect.useInputStreamToInsertBlob.

Should LOBs (both BLOB and CLOB) be bound using stream operations (i.e. java.sql.PreparedStatement#setBinaryStream).

Returns:boolean

True if BLOBs and CLOBs should be bound using stream operations.