Package org.hibernate.dialect
Class TeradataDialect
- java.lang.Object
-
- org.hibernate.dialect.Dialect
-
- org.hibernate.dialect.TeradataDialect
-
- All Implemented Interfaces:
ConversionContext
,IdTableSupport
- Direct Known Subclasses:
Teradata14Dialect
public class TeradataDialect extends Dialect implements IdTableSupport
A dialect for the Teradata database created by MCR as part of the dialect certification process.
-
-
Field Summary
-
Fields inherited from class org.hibernate.dialect.Dialect
CLOSED_QUOTE, DEFAULT_BATCH_SIZE, LEGACY_LOB_MERGE_STRATEGY, NEW_LOCATOR_LOB_MERGE_STRATEGY, NO_BATCH, QUOTE, STANDARD_DEFAULT_BATCH_LOAD_SIZING_STRATEGY, STREAM_XFER_LOB_MERGE_STRATEGY, TWO_SINGLE_QUOTES_REPLACEMENT
-
-
Constructor Summary
Constructors Constructor Description TeradataDialect()
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
areStringComparisonsCaseInsensitive()
Are string comparisons implicitly case insensitive.boolean
doesReadCommittedCauseWritersToBlockReaders()
For the underlying database, is READ_COMMITTED isolation implemented by forcing readers to wait for write locks to be released?boolean
doesRepeatableReadCauseReadersToBlockWriters()
For the underlying database, is REPEATABLE_READ isolation implemented by forcing writers to wait for read locks to be released?java.lang.String
generateIdTableName(java.lang.String baseName)
java.lang.String
getAddColumnString()
The syntax used to add a column to a table (optional).java.lang.String
getCreateIdTableCommand()
java.lang.String
getCreateIdTableStatementOptions()
java.lang.String
getCreateMultisetTableString()
Slight variation onDialect.getCreateTableString()
.MultiTableBulkIdStrategy
getDefaultMultiTableBulkIdStrategy()
java.lang.String
getDropIdTableCommand()
java.lang.String
getForUpdateString()
Does this dialect support the FOR UPDATE syntax?int
getInExpressionCountLimit()
Return the limit that the underlying database places on the number of elements in anIN
predicate.java.lang.String
getSelectClauseNullString(int sqlType)
Given aTypes
type code, determine an appropriate null value to use in a select clause.java.lang.String
getTruncateIdTableCommand()
java.lang.String
getTypeName(int code, int length, int precision, int scale)
Get the name of the database type associated with the given java.sql.Types typecode.boolean
supportsBindAsCallableArgument()
Does this dialect support using a JDBC bind parameter as an argument to a function or procedure call?boolean
supportsCascadeDelete()
Does this dialect support cascaded delete on foreign key definitions?boolean
supportsCircularCascadeDeleteConstraints()
Does this dialect support definition of cascade delete constraints which can cause circular chains?boolean
supportsEmptyInList()
Does this dialect support empty IN lists?boolean
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...boolean
supportsSequences()
Does this dialect support sequences?-
Methods inherited from class org.hibernate.dialect.Dialect
addSqlHintOrComment, appendLockHint, appendLockHint, applyLocksToSql, augmentPhysicalTableTypes, augmentRecognizedTableTypes, bindLimitParametersFirst, bindLimitParametersInReverseOrder, buildIdentifierHelper, buildSQLExceptionConversionDelegate, buildSQLExceptionConverter, canCreateCatalog, canCreateSchema, cast, cast, cast, closeQuote, contributeTypes, convertToFirstRowValue, createCaseFragment, createOuterJoinFragment, defaultScrollMode, dropConstraints, equivalentTypes, escapeComment, escapeLiteral, forceLimitUsage, forceLobAsLastValue, forUpdateOfColumns, getAddColumnSuffixString, getAddForeignKeyConstraintString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAddUniqueConstraintString, getAlterTableString, getAuxiliaryDatabaseObjectExporter, getCallableStatementSupport, getCascadeConstraintsString, getCaseInsensitiveLike, getCastTypeName, getColumnAliasExtractor, getColumnComment, getCreateCatalogCommand, getCreateSchemaCommand, getCreateSequenceString, getCreateSequenceString, getCreateSequenceStrings, getCreateSequenceStrings, getCreateTableString, getCreateTemporaryTableColumnAnnotation, getCrossJoinSeparator, getCurrentSchemaCommand, getCurrentTimestampSelectString, getCurrentTimestampSQLFunctionName, getDefaultBatchLoadSizingStrategy, getDefaultProperties, getDialect, getDialect, getDropCatalogCommand, getDropForeignKeyString, getDropSchemaCommand, getDropSequenceString, getDropSequenceStrings, getDropTableString, getForeignKeyExporter, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateSkipLockedString, getForUpdateSkipLockedString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getFunctions, getHibernateTypeName, getHibernateTypeName, getIdentityColumnSupport, getIndexExporter, getKeywords, getLimitHandler, getLimitString, getLimitString, getLobMergeStrategy, getLockingStrategy, getLowercaseFunction, getMaxAliasLength, getNameQualifierSupport, getNativeIdentifierGeneratorClass, getNativeIdentifierGeneratorStrategy, getNoColumnsInsertString, getNotExpression, getNullColumnString, getQueryHintString, getQueryHintString, getQuerySequencesString, getReadLockString, getReadLockString, getResultSet, getResultSet, getResultSet, getSchemaNameResolver, getSelectGUIDString, getSelectSequenceNextValString, getSequenceExporter, getSequenceInformationExtractor, getSequenceNextValString, getSqlTypeDescriptorOverride, getTableComment, getTableExporter, getTableTypeString, getTypeName, getTypeName, getUniqueDelegate, getUniqueKeyExporter, getViolatedConstraintNameExtracter, getWriteLockString, getWriteLockString, hasAlterTable, hasSelfReferentialForeignKeyBug, inlineLiteral, isCurrentTimestampSelectStringCallable, isJdbcLogWarningsEnabledByDefault, isLegacyLimitHandlerBehaviorEnabled, isLockTimeoutParameterized, isTypeNameRegistered, openQuote, prependComment, qualifyIndexName, quote, registerColumnType, registerColumnType, registerFunction, registerHibernateType, registerHibernateType, registerKeyword, registerResultSetOutParameter, registerResultSetOutParameter, remapSqlTypeDescriptor, renderOrderByElement, replaceResultVariableInOrderByClauseWithPosition, requiresCastingOfParametersInSelectClause, requiresParensForTupleDistinctCounts, supportsCaseInsensitiveLike, supportsColumnCheck, supportsCommentOn, supportsCurrentTimestampSelection, supportsExistsInSelect, supportsExpectedLobUsagePattern, supportsIfExistsAfterAlterTable, supportsIfExistsAfterConstraintName, supportsIfExistsAfterTableName, supportsIfExistsBeforeConstraintName, supportsIfExistsBeforeTableName, supportsJdbcConnectionLobCreation, supportsLimit, supportsLimitOffset, supportsLockTimeouts, supportsNamedParameters, supportsNationalizedTypes, supportsNoColumnsInsert, supportsNonQueryWithCTE, supportsNotNullUnique, supportsNoWait, supportsOuterJoinForUpdate, supportsParametersInInsertSelect, supportsPartitionBy, supportsPooledSequences, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsRowValueConstructorSyntax, supportsRowValueConstructorSyntaxInInList, supportsRowValueConstructorSyntaxInSet, supportsSelectAliasInGroupByClause, supportsSkipLocked, supportsSubqueryOnMutatingTable, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTupleCounts, supportsTupleDistinctCounts, supportsTuplesInSubqueries, supportsUnboundedLobLocatorMaterialization, supportsUnionAll, supportsUnique, supportsUniqueConstraintInCreateAlterTable, supportsValuesList, supportsVariableLimit, toBooleanValueString, toString, transformSelectString, useFollowOnLocking, useFollowOnLocking, useInputStreamToInsertBlob, useMaxForLimit
-
-
-
-
Method Detail
-
getForUpdateString
public java.lang.String getForUpdateString()
Does this dialect support the FOR UPDATE syntax?- Overrides:
getForUpdateString
in classDialect
- Returns:
- empty string ... Teradata does not support FOR UPDATE syntax
-
supportsSequences
public boolean supportsSequences()
Description copied from class:Dialect
Does this dialect support sequences?- Overrides:
supportsSequences
in classDialect
- Returns:
- True if sequences supported; false otherwise.
-
getAddColumnString
public java.lang.String getAddColumnString()
Description copied from class:Dialect
The syntax used to add a column to a table (optional).- Overrides:
getAddColumnString
in classDialect
- Returns:
- The "add column" fragment.
-
getDefaultMultiTableBulkIdStrategy
public MultiTableBulkIdStrategy getDefaultMultiTableBulkIdStrategy()
- Overrides:
getDefaultMultiTableBulkIdStrategy
in classDialect
-
generateIdTableName
public java.lang.String generateIdTableName(java.lang.String baseName)
- Specified by:
generateIdTableName
in interfaceIdTableSupport
-
getCreateIdTableCommand
public java.lang.String getCreateIdTableCommand()
- Specified by:
getCreateIdTableCommand
in interfaceIdTableSupport
-
getCreateIdTableStatementOptions
public java.lang.String getCreateIdTableStatementOptions()
- Specified by:
getCreateIdTableStatementOptions
in interfaceIdTableSupport
-
getDropIdTableCommand
public java.lang.String getDropIdTableCommand()
- Specified by:
getDropIdTableCommand
in interfaceIdTableSupport
-
getTruncateIdTableCommand
public java.lang.String getTruncateIdTableCommand()
- Specified by:
getTruncateIdTableCommand
in interfaceIdTableSupport
-
getTypeName
public java.lang.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
- java.sql.Types typecodelength
- the length or precision of the columnprecision
- the precision of the columnscale
- the scale of the column- Returns:
- the database type name
- Throws:
HibernateException
-
supportsCascadeDelete
public boolean supportsCascadeDelete()
Description copied from class:Dialect
Does this dialect support cascaded delete on foreign key definitions?- Overrides:
supportsCascadeDelete
in classDialect
- Returns:
true
indicates that the dialect does support cascaded delete on foreign keys.
-
supportsCircularCascadeDeleteConstraints
public boolean supportsCircularCascadeDeleteConstraints()
Description copied from class:Dialect
Does this dialect support definition of cascade delete constraints which can cause circular chains?- Overrides:
supportsCircularCascadeDeleteConstraints
in classDialect
- Returns:
- True if circular cascade delete constraints are supported; false otherwise.
-
areStringComparisonsCaseInsensitive
public boolean areStringComparisonsCaseInsensitive()
Description copied from class:Dialect
Are string comparisons implicitly case insensitive. In other words, does [where 'XYZ' = 'xyz'] resolve to true?- Overrides:
areStringComparisonsCaseInsensitive
in classDialect
- Returns:
- True if comparisons are case insensitive.
-
supportsEmptyInList
public boolean supportsEmptyInList()
Description copied from class:Dialect
Does this dialect support empty IN lists? For example, is [where XYZ in ()] a supported construct?- Overrides:
supportsEmptyInList
in classDialect
- Returns:
- True if empty in lists are supported; false otherwise.
-
getSelectClauseNullString
public java.lang.String getSelectClauseNullString(int sqlType)
Description copied from class:Dialect
Given aTypes
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.- Overrides:
getSelectClauseNullString
in classDialect
- Parameters:
sqlType
- TheTypes
type code.- Returns:
- The appropriate select clause value fragment.
-
getCreateMultisetTableString
public java.lang.String getCreateMultisetTableString()
Description copied from class:Dialect
Slight variation onDialect.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.- Overrides:
getCreateMultisetTableString
in classDialect
- Returns:
- The command used to create a multiset table.
-
supportsLobValueChangePropogation
public boolean supportsLobValueChangePropogation()
Description copied from class:Dialect
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(long)
,Blob.setBytes(long, byte[])
,Blob.setBytes(long, byte[], int, int)
, orBlob.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)
, orClob.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 notDialect.supportsExpectedLobUsagePattern()
.- Overrides:
supportsLobValueChangePropogation
in classDialect
- Returns:
- True if the changes are propagated back to the database; false otherwise.
-
doesReadCommittedCauseWritersToBlockReaders
public boolean doesReadCommittedCauseWritersToBlockReaders()
Description copied from class:Dialect
For the underlying database, is READ_COMMITTED isolation implemented by forcing readers to wait for write locks to be released?- Overrides:
doesReadCommittedCauseWritersToBlockReaders
in classDialect
- Returns:
- True if writers block readers to achieve READ_COMMITTED; false otherwise.
-
doesRepeatableReadCauseReadersToBlockWriters
public boolean doesRepeatableReadCauseReadersToBlockWriters()
Description copied from class:Dialect
For the underlying database, is REPEATABLE_READ isolation implemented by forcing writers to wait for read locks to be released?- Overrides:
doesRepeatableReadCauseReadersToBlockWriters
in classDialect
- Returns:
- True if readers block writers to achieve REPEATABLE_READ; false otherwise.
-
supportsBindAsCallableArgument
public boolean supportsBindAsCallableArgument()
Description copied from class:Dialect
Does this dialect support using a JDBC bind parameter as an argument to a function or procedure call?- Overrides:
supportsBindAsCallableArgument
in classDialect
- Returns:
- Returns
true
if the database supports accepting bind params as args,false
otherwise. The default istrue
.
-
getInExpressionCountLimit
public int getInExpressionCountLimit()
Description copied from class:Dialect
Return the limit that the underlying database places on the number of elements in anIN
predicate. If the database defines no such limits, simply return zero or less-than-zero.- Overrides:
getInExpressionCountLimit
in classDialect
- Returns:
- int The limit, or zero-or-less to indicate no limit.
-
-