Top Description Fields Constructors Methods
org.hibernate.dialect

public Class TeradataDialect

extends Dialect
Class Inheritance
Imports
java.sql.Types, org.hibernate.HibernateException, org.hibernate.cfg.Environment, org.hibernate.dialect.function.SQLFunctionTemplate, .VarArgsSQLFunction, org.hibernate.type.StandardBasicTypes

A dialect for the Teradata database created by MCR as part of the dialect certification process.
Author
Jay Nance

Field Summary

Inherited from org.hibernate.dialect.Dialect:
CLOSED_QUOTEDEFAULT_BATCH_SIZENO_BATCHQUOTE

Constructor Summary

AccessConstructor and Description
public
TeradataDialect()

Constructor

Method Summary

Modifier and TypeMethod and Description
public boolean
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
getAddColumnString()

Overrides org.hibernate.dialect.Dialect.getAddColumnString.

The syntax used to add a column to a table (optional).
public String
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

Returns:

empty string ... Teradata does not support FOR UPDATE syntax
getForUpdateString
()

Overrides org.hibernate.dialect.Dialect.getForUpdateString.

Does this dialect support the FOR UPDATE syntax?
public String
getSelectClauseNullString(int
The java.sql.Types type code.
sqlType
)

Overrides org.hibernate.dialect.Dialect.getSelectClauseNullString.

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

Returns:

the database type name
getTypeName
(int
java.sql.Types typecode
code
,
int
the length or precision of the column
length
,
int
the precision of the column
precision
,
int
the scale of the column
scale
)

Overrides org.hibernate.dialect.Dialect.getTypeName.

Get the name of the database type associated with the given java.sql.Types typecode.
public Boolean
performTemporaryTableDDLInIsolation()

Overrides org.hibernate.dialect.Dialect.performTemporaryTableDDLInIsolation.

Does the dialect require that temporary table DDL statements occur in isolation from other statements?
public boolean
supportsBindAsCallableArgument()

Overrides org.hibernate.dialect.Dialect.supportsBindAsCallableArgument.

Does this dialect support using a JDBC bind parameter as an argument to a function or procedure call?
public boolean
public boolean
supportsCircularCascadeDeleteConstraints()

Overrides org.hibernate.dialect.Dialect.supportsCircularCascadeDeleteConstraints.

Does this dialect support definition of cascade delete constraints which can cause circular chains?
public boolean
supportsEmptyInList()

Overrides org.hibernate.dialect.Dialect.supportsEmptyInList.

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

Overrides org.hibernate.dialect.Dialect.supportsIdentityColumns.

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

Overrides org.hibernate.dialect.Dialect.supportsLobValueChangePropogation.

Does the dialect support propagating changes to LOB values back to the database?
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?
Inherited from org.hibernate.dialect.Dialect:
addTypeOverrideappendIdentitySelectToInsertappendLockHintapplyLocksToSqlbindLimitParametersFirstbindLimitParametersInReverseOrderbuildSQLExceptionConvertercloseQuoteconvertToFirstRowValuecreateCaseFragmentcreateOuterJoinFragmentdropConstraintsforceLimitUsageforUpdateOfColumnsgenerateTemporaryTableNamegetAddForeignKeyConstraintStringgetAddPrimaryKeyConstraintStringgetCascadeConstraintsStringgetCastTypeNamegetColumnAliasExtractorgetColumnCommentgetCreateSequenceStringgetCreateSequenceStringgetCreateSequenceStringsgetCreateSequenceStringsgetCreateTableStringgetCrossJoinSeparatorgetCurrentTimestampSelectStringgetCurrentTimestampSQLFunctionNamegetDefaultPropertiesgetDialectgetDialectgetDropForeignKeyStringgetDropSequenceStringgetDropSequenceStringsgetDropTemporaryTableStringgetForUpdateNowaitStringgetForUpdateNowaitStringgetForUpdateStringgetForUpdateStringgetForUpdateStringgetForUpdateStringgetFunctionsgetHibernateTypeNamegetHibernateTypeNamegetIdentityColumnStringgetIdentityColumnStringgetIdentityInsertStringgetIdentitySelectStringgetIdentitySelectStringgetKeywordsgetLimitStringgetLimitStringgetLockingStrategygetLowercaseFunctiongetMaxAliasLengthgetNativeIdentifierGeneratorClassgetNoColumnsInsertStringgetNullColumnStringgetQuerySequencesStringgetReadLockStringgetResultSetgetSelectGUIDStringgetSelectSequenceNextValStringgetSequenceNextValStringgetTableCommentgetTableTypeStringgetTypeNamegetTypeOverridesgetViolatedConstraintNameExtractergetWriteLockStringhasAlterTablehasDataTypeInIdentityColumnhasSelfReferentialForeignKeyBugisCurrentTimestampSelectStringCallableisLockTimeoutParameterizedopenQuotequalifyIndexNamequoteregisterColumnTyperegisterColumnTyperegisterFunctionregisterHibernateTyperegisterHibernateTyperegisterKeywordregisterResultSetOutParameterreplaceResultVariableInOrderByClauseWithPositionrequiresCastingOfParametersInSelectClausesupportsColumnChecksupportsCommentOnsupportsCurrentTimestampSelectionsupportsExistsInSelectsupportsExpectedLobUsagePatternsupportsIfExistsAfterTableNamesupportsIfExistsBeforeTableNamesupportsInsertSelectIdentitysupportsLimitsupportsLimitOffsetsupportsLockTimeoutssupportsNotNullUniquesupportsOuterJoinForUpdatesupportsParametersInInsertSelectsupportsPooledSequencessupportsResultSetPositionQueryMethodsOnForwardOnlyCursorsupportsRowValueConstructorSyntaxsupportsRowValueConstructorSyntaxInInListsupportsSubqueryOnMutatingTablesupportsSubselectAsInPredicateLHSsupportsTableChecksupportsTupleCountssupportsTupleDistinctCountssupportsUnboundedLobLocatorMaterializationsupportsUnionAllsupportsUniquesupportsUniqueConstraintInCreateAlterTablesupportsVariableLimittoBooleanValueStringtoStringtransformSelectStringuseInputStreamToInsertBlobuseMaxForLimit

Constructor Detail

TeradataDialectback to summary
public TeradataDialect()

Constructor

Method Detail

areStringComparisonsCaseInsensitiveback to summary
public boolean areStringComparisonsCaseInsensitive()

Overrides org.hibernate.dialect.Dialect.areStringComparisonsCaseInsensitive.

Doc from org.hibernate.dialect.Dialect.areStringComparisonsCaseInsensitive.

Are string comparisons implicitly case insensitive.

In other words, does [where 'XYZ' = 'xyz'] resolve to true?

Returns:boolean

True if comparisons are case insensitive.

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.

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.

getCreateMultisetTableStringback to summary
public String getCreateMultisetTableString()

Overrides org.hibernate.dialect.Dialect.getCreateMultisetTableString.

Doc from org.hibernate.dialect.Dialect.getCreateMultisetTableString.

Slight variation on getCreateTableString. Here, we have the command used to create a table when there is no primary key and duplicate rows are expected.

Most databases do not care about the distinction; originally added for Teradata support which does care.

Returns:String

The command used to create a multiset table.

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.

getForUpdateStringback to summary
public String getForUpdateString()

Overrides org.hibernate.dialect.Dialect.getForUpdateString.

Does this dialect support the FOR UPDATE syntax?

Returns:String

empty string ... Teradata does not support FOR UPDATE syntax

getSelectClauseNullStringback to summary
public String getSelectClauseNullString(int sqlType)

Overrides org.hibernate.dialect.Dialect.getSelectClauseNullString.

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

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

One thing to consider here is that certain databases might require proper casting for the nulls here since the select here will be part of a UNION/UNION ALL.

Parameters
sqlType:int

The java.sql.Types type code.

Returns:String

The appropriate select clause value fragment.

getTypeNameback to summary
public String getTypeName(int code, int length, int precision, int scale) throws HibernateException

Overrides org.hibernate.dialect.Dialect.getTypeName.

Get the name of the database type associated with the given java.sql.Types typecode.

Parameters
code:int

java.sql.Types typecode

length:int

the length or precision of the column

precision:int

the precision of the column

scale:int

the scale of the column

Returns:String

the database type name

Exceptions
HibernateException:

Doc from org.hibernate.dialect.Dialect.getTypeName.

If no mapping was specified for that type.

performTemporaryTableDDLInIsolationback to summary
public Boolean performTemporaryTableDDLInIsolation()

Overrides org.hibernate.dialect.Dialect.performTemporaryTableDDLInIsolation.

Doc from org.hibernate.dialect.Dialect.performTemporaryTableDDLInIsolation.

Does the dialect require that temporary table DDL statements occur in isolation from other statements? This would be the case if the creation would cause any current transaction to get committed implicitly.

JDBC defines a standard way to query for this information via the java.sql.DatabaseMetaData#dataDefinitionCausesTransactionCommit() method. However, that does not distinguish between temporary table DDL and other forms of DDL; MySQL, for example, reports DDL causing a transaction commit via its driver, even though that is not the case for temporary table DDL.

Possible return values and their meanings:

Returns:Boolean

see the result matrix above.

supportsBindAsCallableArgumentback to summary
public boolean supportsBindAsCallableArgument()

Overrides org.hibernate.dialect.Dialect.supportsBindAsCallableArgument.

Doc from org.hibernate.dialect.Dialect.supportsBindAsCallableArgument.

Does this dialect support using a JDBC bind parameter as an argument to a function or procedure call?

Returns:boolean

True if the database supports accepting bind params as args; false otherwise.

supportsCascadeDeleteback to summary
public boolean supportsCascadeDelete()

Overrides org.hibernate.dialect.Dialect.supportsCascadeDelete.

supportsCircularCascadeDeleteConstraintsback to summary
public boolean supportsCircularCascadeDeleteConstraints()

Overrides org.hibernate.dialect.Dialect.supportsCircularCascadeDeleteConstraints.

Doc from org.hibernate.dialect.Dialect.supportsCircularCascadeDeleteConstraints.

Does this dialect support definition of cascade delete constraints which can cause circular chains?

Returns:boolean

True if circular cascade delete constraints are supported; 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.

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.

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.

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.