Top Description Fields Constructors Methods
org.hibernate.dialect

public Class TeradataDialect

extends Dialect
implements IdTableSupport
Class Inheritance
All Implemented Interfaces
org.hibernate.hql.spi.id.IdTableSupport
Known Direct Subclasses
org.hibernate.dialect.Teradata14Dialect
Imports
java.sql.Types, org.hibernate.HibernateException, org.hibernate.cfg.Environment, org.hibernate.dialect.function.SQLFunctionTemplate, .VarArgsSQLFunction, org.hibernate.hql.spi.id.IdTableSupport, .IdTableSupportStandardImpl, .MultiTableBulkIdStrategy, org.hibernate.hql.spi.id.global.GlobalTemporaryTableBulkIdStrategy, org.hibernate.hql.spi.id.local.AfterUseAction, 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

Modifier and TypeField and Description
private static final int
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
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 String
public String
getAddColumnString()

Overrides org.hibernate.dialect.Dialect.getAddColumnString.

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

Overrides org.hibernate.dialect.Dialect.getInExpressionCountLimit.

Return the limit that the underlying database places on the number of elements in an IN predicate.
public String
getSelectClauseNullString(int
The Types type code.
sqlType
)

Overrides org.hibernate.dialect.Dialect.getSelectClauseNullString.

Given a Types type code, determine an appropriate null value to use in a select clause.
public String
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
)

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

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

Overrides org.hibernate.dialect.Dialect.supportsCascadeDelete.

Does this dialect support cascaded delete on foreign key definitions?
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
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?
Inherited from org.hibernate.dialect.Dialect:
addSqlHintOrCommentappendLockHintappendLockHintapplyLocksToSqlaugmentPhysicalTableTypesaugmentRecognizedTableTypesbindLimitParametersFirstbindLimitParametersInReverseOrderbuildIdentifierHelperbuildSQLExceptionConversionDelegatebuildSQLExceptionConvertercanCreateCatalogcanCreateSchemacastcastcastcloseQuotecontributeTypesconvertToFirstRowValuecreateCaseFragmentcreateOuterJoinFragmentdefaultScrollModedropConstraintsequivalentTypesescapeCommentescapeLiteralforceLimitUsageforceLobAsLastValueforUpdateOfColumnsgetAddColumnSuffixStringgetAddForeignKeyConstraintStringgetAddForeignKeyConstraintStringgetAddPrimaryKeyConstraintStringgetAddUniqueConstraintStringgetAlterTableStringgetAuxiliaryDatabaseObjectExportergetCallableStatementSupportgetCascadeConstraintsStringgetCaseInsensitiveLikegetCastTypeNamegetColumnAliasExtractorgetColumnCommentgetCreateCatalogCommandgetCreateSchemaCommandgetCreateSequenceStringgetCreateSequenceStringgetCreateSequenceStringsgetCreateSequenceStringsgetCreateTableStringgetCreateTemporaryTableColumnAnnotationgetCrossJoinSeparatorgetCurrentSchemaCommandgetCurrentTimestampSelectStringgetCurrentTimestampSQLFunctionNamegetDefaultBatchLoadSizingStrategygetDefaultPropertiesgetDialectgetDialectgetDropCatalogCommandgetDropForeignKeyStringgetDropSchemaCommandgetDropSequenceStringgetDropSequenceStringsgetDropTableStringgetForeignKeyExportergetForUpdateNowaitStringgetForUpdateNowaitStringgetForUpdateSkipLockedStringgetForUpdateSkipLockedStringgetForUpdateStringgetForUpdateStringgetForUpdateStringgetForUpdateStringgetFunctionsgetHibernateTypeNamegetHibernateTypeNamegetIdentityColumnSupportgetIndexExportergetKeywordsgetLimitHandlergetLimitStringgetLimitStringgetLobMergeStrategygetLockingStrategygetLowercaseFunctiongetMaxAliasLengthgetNameQualifierSupportgetNativeIdentifierGeneratorClassgetNativeIdentifierGeneratorStrategygetNoColumnsInsertStringgetNotExpressiongetNullColumnStringgetQueryHintStringgetQueryHintStringgetQuerySequencesStringgetReadLockStringgetReadLockStringgetResultSetgetResultSetgetResultSetgetSchemaNameResolvergetSelectGUIDStringgetSelectSequenceNextValStringgetSequenceExportergetSequenceInformationExtractorgetSequenceNextValStringgetSqlTypeDescriptorOverridegetTableCommentgetTableExportergetTableTypeStringgetTypeNamegetTypeNamegetUniqueDelegategetUniqueKeyExportergetViolatedConstraintNameExtractergetWriteLockStringgetWriteLockStringhasAlterTablehasSelfReferentialForeignKeyBuginlineLiteralisCurrentTimestampSelectStringCallableisJdbcLogWarningsEnabledByDefaultisLegacyLimitHandlerBehaviorEnabledisLockTimeoutParameterizedisTypeNameRegisteredopenQuoteprependCommentqualifyIndexNamequoteregisterColumnTyperegisterColumnTyperegisterFunctionregisterHibernateTyperegisterHibernateTyperegisterKeywordregisterResultSetOutParameterregisterResultSetOutParameterremapSqlTypeDescriptorrenderOrderByElementreplaceResultVariableInOrderByClauseWithPositionrequiresCastingOfParametersInSelectClauserequiresParensForTupleDistinctCountssupportsCaseInsensitiveLikesupportsColumnChecksupportsCommentOnsupportsCurrentTimestampSelectionsupportsExistsInSelectsupportsExpectedLobUsagePatternsupportsIfExistsAfterAlterTablesupportsIfExistsAfterConstraintNamesupportsIfExistsAfterTableNamesupportsIfExistsBeforeConstraintNamesupportsIfExistsBeforeTableNamesupportsJdbcConnectionLobCreationsupportsLimitsupportsLimitOffsetsupportsLockTimeoutssupportsNamedParameterssupportsNationalizedTypessupportsNoColumnsInsertsupportsNonQueryWithCTEsupportsNotNullUniquesupportsNoWaitsupportsOuterJoinForUpdatesupportsParametersInInsertSelectsupportsPartitionBysupportsPooledSequencessupportsResultSetPositionQueryMethodsOnForwardOnlyCursorsupportsRowValueConstructorSyntaxsupportsRowValueConstructorSyntaxInInListsupportsRowValueConstructorSyntaxInSetsupportsSelectAliasInGroupByClausesupportsSkipLockedsupportsSubqueryOnMutatingTablesupportsSubselectAsInPredicateLHSsupportsTableChecksupportsTupleCountssupportsTupleDistinctCountssupportsTuplesInSubqueriessupportsUnboundedLobLocatorMaterializationsupportsUnionAllsupportsUniquesupportsUniqueConstraintInCreateAlterTablesupportsValuesListsupportsVariableLimittoBooleanValueStringtoStringtransformSelectStringuseFollowOnLockinguseFollowOnLockinguseInputStreamToInsertBlobuseMaxForLimit

Field Detail

PARAM_LIST_SIZE_LIMITback to summary
private static final int PARAM_LIST_SIZE_LIMIT

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.

Annotations
@Override
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.

Annotations
@Override
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.

Annotations
@Override
generateIdTableNameback to summary
public String generateIdTableName(String baseName)

Implements org.hibernate.hql.spi.id.IdTableSupport.generateIdTableName.

Annotations
@Override
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.

Annotations
@Override
getCreateIdTableCommandback to summary
public String getCreateIdTableCommand()

Implements org.hibernate.hql.spi.id.IdTableSupport.getCreateIdTableCommand.

Annotations
@Override
getCreateIdTableStatementOptionsback to summary
public String getCreateIdTableStatementOptions()

Implements org.hibernate.hql.spi.id.IdTableSupport.getCreateIdTableStatementOptions.

Annotations
@Override
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.

Annotations
@Override
getDefaultMultiTableBulkIdStrategyback to summary
public MultiTableBulkIdStrategy getDefaultMultiTableBulkIdStrategy()

Overrides org.hibernate.dialect.Dialect.getDefaultMultiTableBulkIdStrategy.

Annotations
@Override
getDropIdTableCommandback to summary
public String getDropIdTableCommand()

Implements org.hibernate.hql.spi.id.IdTableSupport.getDropIdTableCommand.

Annotations
@Override
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

Annotations
@Override
getInExpressionCountLimitback to summary
public int getInExpressionCountLimit()

Overrides org.hibernate.dialect.Dialect.getInExpressionCountLimit.

Doc from org.hibernate.dialect.Dialect.getInExpressionCountLimit.

Return the limit that the underlying database places on the number of elements in an IN predicate. If the database defines no such limits, simply return zero or less-than-zero.

Returns:int

int The limit, or zero-or-less to indicate no limit.

Annotations
@Override
getSelectClauseNullStringback to summary
public String getSelectClauseNullString(int sqlType)

Overrides org.hibernate.dialect.Dialect.getSelectClauseNullString.

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

Given a 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 Types type code.

Returns:String

The appropriate select clause value fragment.

Annotations
@Override
getTruncateIdTableCommandback to summary
public String getTruncateIdTableCommand()

Implements org.hibernate.hql.spi.id.IdTableSupport.getTruncateIdTableCommand.

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

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

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

Returns true if the database supports accepting bind params as args, false otherwise. The default is true.

Annotations
@Override
supportsCascadeDeleteback to summary
public boolean supportsCascadeDelete()

Overrides org.hibernate.dialect.Dialect.supportsCascadeDelete.

Doc from org.hibernate.dialect.Dialect.supportsCascadeDelete.

Does this dialect support cascaded delete on foreign key definitions?

Returns:boolean

true indicates that the dialect does support cascaded delete on foreign keys.

Annotations
@Override
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.

Annotations
@Override
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.

Annotations
@Override
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: Blob#setBinaryStream, Blob#setBytes(long, byte[]), Blob#setBytes(long, byte[], int, int), or Blob#truncate(long).

For CLOBs, the internal value might be changed by: Clob#setAsciiStream(long), Clob#setCharacterStream(long), Clob#setString(long, String), Clob#setString(long, String, int, int), or 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
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.

Annotations
@Override