Top Description Fields Constructors Methods
org.hibernate.dialect

pack-priv abstract Class AbstractTransactSQLDialect

extends Dialect
Class Inheritance
Known Direct Subclasses
org.hibernate.dialect.SQLServerDialect, org.hibernate.dialect.Sybase11Dialect, org.hibernate.dialect.SybaseAnywhereDialect, org.hibernate.dialect.SybaseASE15Dialect, org.hibernate.dialect.SybaseDialect
Imports
java.sql.CallableStatement, .ResultSet, .SQLException, .Types, java.util.Map, .Iterator, org.hibernate.LockMode, .LockOptions, org.hibernate.cfg.Environment, org.hibernate.dialect.function.CharIndexFunction, .NoArgSQLFunction, .SQLFunctionTemplate, .StandardSQLFunction, .VarArgsSQLFunction, org.hibernate.type.StandardBasicTypes

An abstract base class for Sybase and MS SQL Server dialects.
Author
Gavin King

Field Summary

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 String
appendIdentitySelectToInsert(String
The insert command
insertSQL
)

Overrides org.hibernate.dialect.Dialect.appendIdentitySelectToInsert.

Provided we supportsInsertSelectIdentity, then attach the "select identity" clause to the insert statement.
public String
appendLockHint(LockMode
The lock mode to apply
mode
,
String
The name of the table to which to apply the lock hint.
tableName
)

Overrides org.hibernate.dialect.Dialect.appendLockHint.

Some dialects support an alternative means to SELECT FOR UPDATE, whereby a "lock hint" is appends to the table name in the from clause.
public String
applyLocksToSql(String
the SQL string to modify
sql
,
LockOptions
lock options indexed by aliased table names.
aliasedLockOptions
,
Map<K, V>
a map of key columns indexed by aliased table names.
keyColumnNames
)

Overrides org.hibernate.dialect.Dialect.applyLocksToSql.

Modifies the given SQL by applying the appropriate updates for the specified lock modes and key columns.
public boolean
doesReadCommittedCauseWritersToBlockReaders()

Overrides org.hibernate.dialect.Dialect.doesReadCommittedCauseWritersToBlockReaders.

For the underlying database, is READ_COMMITTED isolation implemented by forcing readers to wait for write locks to be released?
public boolean
doesRepeatableReadCauseReadersToBlockWriters()

Overrides org.hibernate.dialect.Dialect.doesRepeatableReadCauseReadersToBlockWriters.

For the underlying database, is REPEATABLE_READ isolation implemented by forcing writers to wait for read locks to be released?
public boolean
dropTemporaryTableAfterUse()

Overrides org.hibernate.dialect.Dialect.dropTemporaryTableAfterUse.

Do we need to drop the temporary table after use?
public String
generateTemporaryTableName(String
The table name from which to base the temp table name.
baseTableName
)

Overrides org.hibernate.dialect.Dialect.generateTemporaryTableName.

Generate a temporary table name given the base table.
public String
getAddColumnString()

Overrides org.hibernate.dialect.Dialect.getAddColumnString.

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

Overrides org.hibernate.dialect.Dialect.getCurrentTimestampSelectString.

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

Overrides org.hibernate.dialect.Dialect.getIdentityColumnString.

The syntax used during DDL to define a column as being an IDENTITY.
public String
getIdentitySelectString()

Overrides org.hibernate.dialect.Dialect.getIdentitySelectString.

Get the select command to use to retrieve the last generated IDENTITY value.
public String
getNullColumnString()

Overrides org.hibernate.dialect.Dialect.getNullColumnString.

The keyword used to specify a nullable column.
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
getSelectGUIDString()

Overrides org.hibernate.dialect.Dialect.getSelectGUIDString.

Get the command used to select a GUID from the underlying database.
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 OUT param.
col
)

Overrides org.hibernate.dialect.Dialect.registerResultSetOutParameter.

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

Overrides org.hibernate.dialect.Dialect.supportsExistsInSelect.

Does the dialect support an exists statement in the select clause?
public boolean
supportsIdentityColumns()

Overrides org.hibernate.dialect.Dialect.supportsIdentityColumns.

Does this dialect support identity column key generation?
public boolean
supportsInsertSelectIdentity()

Overrides org.hibernate.dialect.Dialect.supportsInsertSelectIdentity.

Does the dialect support some form of inserting and selecting the generated IDENTITY value all in the same statement.
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
supportsUnionAll()

Overrides org.hibernate.dialect.Dialect.supportsUnionAll.

Does this dialect support UNION ALL, which is generally a faster variant of UNION?
Inherited from org.hibernate.dialect.Dialect:
addTypeOverrideareStringComparisonsCaseInsensitivebindLimitParametersFirstbindLimitParametersInReverseOrderbuildSQLExceptionConvertercloseQuoteconvertToFirstRowValuecreateCaseFragmentcreateOuterJoinFragmentdropConstraintsforceLimitUsageforUpdateOfColumnsgetAddForeignKeyConstraintStringgetAddPrimaryKeyConstraintStringgetCascadeConstraintsStringgetCastTypeNamegetColumnAliasExtractorgetColumnCommentgetCreateMultisetTableStringgetCreateSequenceStringgetCreateSequenceStringgetCreateSequenceStringsgetCreateSequenceStringsgetCreateTableStringgetCreateTemporaryTablePostfixgetCreateTemporaryTableStringgetCrossJoinSeparatorgetCurrentTimestampSQLFunctionNamegetDefaultPropertiesgetDialectgetDialectgetDropForeignKeyStringgetDropSequenceStringgetDropSequenceStringsgetDropTemporaryTableStringgetForUpdateNowaitStringgetForUpdateNowaitStringgetForUpdateStringgetForUpdateStringgetForUpdateStringgetForUpdateStringgetFunctionsgetHibernateTypeNamegetHibernateTypeNamegetIdentityColumnStringgetIdentityInsertStringgetIdentitySelectStringgetKeywordsgetLimitStringgetLimitStringgetLockingStrategygetLowercaseFunctiongetMaxAliasLengthgetNativeIdentifierGeneratorClassgetNoColumnsInsertStringgetQuerySequencesStringgetReadLockStringgetSelectClauseNullStringgetSelectSequenceNextValStringgetSequenceNextValStringgetTableCommentgetTableTypeStringgetTypeNamegetTypeNamegetTypeOverridesgetViolatedConstraintNameExtractergetWriteLockStringhasAlterTablehasDataTypeInIdentityColumnhasSelfReferentialForeignKeyBugisLockTimeoutParameterizedopenQuoteperformTemporaryTableDDLInIsolationquoteregisterColumnTyperegisterColumnTyperegisterFunctionregisterHibernateTyperegisterHibernateTyperegisterKeywordreplaceResultVariableInOrderByClauseWithPositionrequiresCastingOfParametersInSelectClausesupportsBindAsCallableArgumentsupportsCascadeDeletesupportsCircularCascadeDeleteConstraintssupportsColumnChecksupportsCommentOnsupportsExpectedLobUsagePatternsupportsIfExistsAfterTableNamesupportsIfExistsBeforeTableNamesupportsLimitsupportsLimitOffsetsupportsLobValueChangePropogationsupportsLockTimeoutssupportsNotNullUniquesupportsOuterJoinForUpdatesupportsParametersInInsertSelectsupportsPooledSequencessupportsResultSetPositionQueryMethodsOnForwardOnlyCursorsupportsRowValueConstructorSyntaxsupportsRowValueConstructorSyntaxInInListsupportsSequencessupportsSubqueryOnMutatingTablesupportsSubselectAsInPredicateLHSsupportsTableChecksupportsTupleCountssupportsUnboundedLobLocatorMaterializationsupportsUniquesupportsUniqueConstraintInCreateAlterTablesupportsVariableLimittoBooleanValueStringtoStringtransformSelectStringuseInputStreamToInsertBlobuseMaxForLimit

Constructor Detail

AbstractTransactSQLDialectback to summary
public AbstractTransactSQLDialect()

Method Detail

appendIdentitySelectToInsertback to summary
public String appendIdentitySelectToInsert(String insertSQL)

Overrides org.hibernate.dialect.Dialect.appendIdentitySelectToInsert.

Doc from org.hibernate.dialect.Dialect.appendIdentitySelectToInsert.

Provided we supportsInsertSelectIdentity, then attach the "select identity" clause to the insert statement.

Note, if supportsInsertSelectIdentity == false then the insert-string should be returned without modification.

Parameters
insertSQL:String

The insert command

Returns:String

The insert command with any necessary identity select clause attached.

appendLockHintback to summary
public String appendLockHint(LockMode mode, String tableName)

Overrides org.hibernate.dialect.Dialect.appendLockHint.

Doc from org.hibernate.dialect.Dialect.appendLockHint.

Some dialects support an alternative means to SELECT FOR UPDATE, whereby a "lock hint" is appends to the table name in the from clause.

contributed by Helge Schulz

Parameters
mode:LockMode

The lock mode to apply

tableName:String

The name of the table to which to apply the lock hint.

Returns:String

The table with any required lock hints.

applyLocksToSqlback to summary
public String applyLocksToSql(String sql, LockOptions aliasedLockOptions, Map<K, V> keyColumnNames)

Overrides org.hibernate.dialect.Dialect.applyLocksToSql.

Doc from org.hibernate.dialect.Dialect.applyLocksToSql.

Modifies the given SQL by applying the appropriate updates for the specified lock modes and key columns.

The behavior here is that of an ANSI SQL SELECT FOR UPDATE. This method is really intended to allow dialects which do not support SELECT FOR UPDATE to achieve this in their own fashion.

Parameters
sql:String

the SQL string to modify

aliasedLockOptions:LockOptions

lock options indexed by aliased table names.

keyColumnNames:Map<K, V>

a map of key columns indexed by aliased table names.

Returns:String

the modified SQL string.

doesReadCommittedCauseWritersToBlockReadersback to summary
public boolean doesReadCommittedCauseWritersToBlockReaders()

Overrides org.hibernate.dialect.Dialect.doesReadCommittedCauseWritersToBlockReaders.

Doc from org.hibernate.dialect.Dialect.doesReadCommittedCauseWritersToBlockReaders.

For the underlying database, is READ_COMMITTED isolation implemented by forcing readers to wait for write locks to be released?

Returns:boolean

True if writers block readers to achieve READ_COMMITTED; false otherwise.

doesRepeatableReadCauseReadersToBlockWritersback to summary
public boolean doesRepeatableReadCauseReadersToBlockWriters()

Overrides org.hibernate.dialect.Dialect.doesRepeatableReadCauseReadersToBlockWriters.

Doc from org.hibernate.dialect.Dialect.doesRepeatableReadCauseReadersToBlockWriters.

For the underlying database, is REPEATABLE_READ isolation implemented by forcing writers to wait for read locks to be released?

Returns:boolean

True if readers block writers to achieve REPEATABLE_READ; false otherwise.

dropTemporaryTableAfterUseback to summary
public boolean dropTemporaryTableAfterUse()

Overrides org.hibernate.dialect.Dialect.dropTemporaryTableAfterUse.

Doc from org.hibernate.dialect.Dialect.dropTemporaryTableAfterUse.

Do we need to drop the temporary table after use?

Returns:boolean

True if the table should be dropped.

generateTemporaryTableNameback to summary
public String generateTemporaryTableName(String baseTableName)

Overrides org.hibernate.dialect.Dialect.generateTemporaryTableName.

Doc from org.hibernate.dialect.Dialect.generateTemporaryTableName.

Generate a temporary table name given the base table.

Parameters
baseTableName:String

The table name from which to base the temp table name.

Returns:String

The generated temp table name.

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.

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.

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

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.

Returns:String

The appropriate DDL fragment.

getIdentitySelectStringback to summary
public String getIdentitySelectString()

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.

Returns:String

The appropriate select command

getNullColumnStringback to summary
public String getNullColumnString()

Overrides org.hibernate.dialect.Dialect.getNullColumnString.

Doc from org.hibernate.dialect.Dialect.getNullColumnString.

The keyword used to specify a nullable column.

Returns:String

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.
getSelectGUIDStringback to summary
public String getSelectGUIDString()

Overrides org.hibernate.dialect.Dialect.getSelectGUIDString.

Doc from org.hibernate.dialect.Dialect.getSelectGUIDString.

Get the command used to select a GUID from the underlying database.

Optional operation.

Returns:String

The appropriate command.

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.

qualifyIndexNameback to summary
public boolean qualifyIndexName()

Overrides org.hibernate.dialect.Dialect.qualifyIndexName.

Doc from org.hibernate.dialect.Dialect.qualifyIndexName.

Do we need to qualify index names with the schema name?

Returns:boolean

boolean

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

supportsExistsInSelectback to summary
public boolean supportsExistsInSelect()

Overrides org.hibernate.dialect.Dialect.supportsExistsInSelect.

Doc from org.hibernate.dialect.Dialect.supportsExistsInSelect.

Does the dialect support an exists statement in the select clause?

Returns:boolean

True if exists checks are allowed in the select clause; false otherwise.

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.

supportsInsertSelectIdentityback to summary
public boolean supportsInsertSelectIdentity()

Overrides org.hibernate.dialect.Dialect.supportsInsertSelectIdentity.

Doc from org.hibernate.dialect.Dialect.supportsInsertSelectIdentity.

Does the dialect support some form of inserting and selecting the generated IDENTITY value all in the same statement.

Returns:boolean

True if the dialect supports selecting the just generated IDENTITY in the insert statement.

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.

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.