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 booleanareStringComparisonsCaseInsensitive()Are string comparisons implicitly case insensitive.booleandoesReadCommittedCauseWritersToBlockReaders()For the underlying database, is READ_COMMITTED isolation implemented by forcing readers to wait for write locks to be released?booleandoesRepeatableReadCauseReadersToBlockWriters()For the underlying database, is REPEATABLE_READ isolation implemented by forcing writers to wait for read locks to be released?java.lang.StringgenerateIdTableName(java.lang.String baseName)java.lang.StringgetAddColumnString()The syntax used to add a column to a table (optional).java.lang.StringgetCreateIdTableCommand()java.lang.StringgetCreateIdTableStatementOptions()java.lang.StringgetCreateMultisetTableString()Slight variation onDialect.getCreateTableString().MultiTableBulkIdStrategygetDefaultMultiTableBulkIdStrategy()java.lang.StringgetDropIdTableCommand()java.lang.StringgetForUpdateString()Does this dialect support the FOR UPDATE syntax?intgetInExpressionCountLimit()Return the limit that the underlying database places on the number of elements in anINpredicate.java.lang.StringgetSelectClauseNullString(int sqlType)Given aTypestype code, determine an appropriate null value to use in a select clause.java.lang.StringgetTruncateIdTableCommand()java.lang.StringgetTypeName(int code, int length, int precision, int scale)Get the name of the database type associated with the given java.sql.Types typecode.booleansupportsBindAsCallableArgument()Does this dialect support using a JDBC bind parameter as an argument to a function or procedure call?booleansupportsCascadeDelete()Does this dialect support cascaded delete on foreign key definitions?booleansupportsCircularCascadeDeleteConstraints()Does this dialect support definition of cascade delete constraints which can cause circular chains?booleansupportsEmptyInList()Does this dialect support empty IN lists?booleansupportsLobValueChangePropogation()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...booleansupportsSequences()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:
getForUpdateStringin classDialect- Returns:
- empty string ... Teradata does not support FOR UPDATE syntax
-
supportsSequences
public boolean supportsSequences()
Description copied from class:DialectDoes this dialect support sequences?- Overrides:
supportsSequencesin classDialect- Returns:
- True if sequences supported; false otherwise.
-
getAddColumnString
public java.lang.String getAddColumnString()
Description copied from class:DialectThe syntax used to add a column to a table (optional).- Overrides:
getAddColumnStringin classDialect- Returns:
- The "add column" fragment.
-
getDefaultMultiTableBulkIdStrategy
public MultiTableBulkIdStrategy getDefaultMultiTableBulkIdStrategy()
- Overrides:
getDefaultMultiTableBulkIdStrategyin classDialect
-
generateIdTableName
public java.lang.String generateIdTableName(java.lang.String baseName)
- Specified by:
generateIdTableNamein interfaceIdTableSupport
-
getCreateIdTableCommand
public java.lang.String getCreateIdTableCommand()
- Specified by:
getCreateIdTableCommandin interfaceIdTableSupport
-
getCreateIdTableStatementOptions
public java.lang.String getCreateIdTableStatementOptions()
- Specified by:
getCreateIdTableStatementOptionsin interfaceIdTableSupport
-
getDropIdTableCommand
public java.lang.String getDropIdTableCommand()
- Specified by:
getDropIdTableCommandin interfaceIdTableSupport
-
getTruncateIdTableCommand
public java.lang.String getTruncateIdTableCommand()
- Specified by:
getTruncateIdTableCommandin interfaceIdTableSupport
-
getTypeName
public java.lang.String getTypeName(int code, int length, int precision, int scale) throws HibernateExceptionGet 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:DialectDoes this dialect support cascaded delete on foreign key definitions?- Overrides:
supportsCascadeDeletein classDialect- Returns:
trueindicates that the dialect does support cascaded delete on foreign keys.
-
supportsCircularCascadeDeleteConstraints
public boolean supportsCircularCascadeDeleteConstraints()
Description copied from class:DialectDoes this dialect support definition of cascade delete constraints which can cause circular chains?- Overrides:
supportsCircularCascadeDeleteConstraintsin classDialect- Returns:
- True if circular cascade delete constraints are supported; false otherwise.
-
areStringComparisonsCaseInsensitive
public boolean areStringComparisonsCaseInsensitive()
Description copied from class:DialectAre string comparisons implicitly case insensitive. In other words, does [where 'XYZ' = 'xyz'] resolve to true?- Overrides:
areStringComparisonsCaseInsensitivein classDialect- Returns:
- True if comparisons are case insensitive.
-
supportsEmptyInList
public boolean supportsEmptyInList()
Description copied from class:DialectDoes this dialect support empty IN lists? For example, is [where XYZ in ()] a supported construct?- Overrides:
supportsEmptyInListin classDialect- Returns:
- True if empty in lists are supported; false otherwise.
-
getSelectClauseNullString
public java.lang.String getSelectClauseNullString(int sqlType)
Description copied from class:DialectGiven aTypestype 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:
getSelectClauseNullStringin classDialect- Parameters:
sqlType- TheTypestype code.- Returns:
- The appropriate select clause value fragment.
-
getCreateMultisetTableString
public java.lang.String getCreateMultisetTableString()
Description copied from class:DialectSlight 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:
getCreateMultisetTableStringin classDialect- Returns:
- The command used to create a multiset table.
-
supportsLobValueChangePropogation
public boolean supportsLobValueChangePropogation()
Description copied from class:DialectDoes 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:
supportsLobValueChangePropogationin classDialect- Returns:
- True if the changes are propagated back to the database; false otherwise.
-
doesReadCommittedCauseWritersToBlockReaders
public boolean doesReadCommittedCauseWritersToBlockReaders()
Description copied from class:DialectFor the underlying database, is READ_COMMITTED isolation implemented by forcing readers to wait for write locks to be released?- Overrides:
doesReadCommittedCauseWritersToBlockReadersin classDialect- Returns:
- True if writers block readers to achieve READ_COMMITTED; false otherwise.
-
doesRepeatableReadCauseReadersToBlockWriters
public boolean doesRepeatableReadCauseReadersToBlockWriters()
Description copied from class:DialectFor the underlying database, is REPEATABLE_READ isolation implemented by forcing writers to wait for read locks to be released?- Overrides:
doesRepeatableReadCauseReadersToBlockWritersin classDialect- Returns:
- True if readers block writers to achieve REPEATABLE_READ; false otherwise.
-
supportsBindAsCallableArgument
public boolean supportsBindAsCallableArgument()
Description copied from class:DialectDoes this dialect support using a JDBC bind parameter as an argument to a function or procedure call?- Overrides:
supportsBindAsCallableArgumentin classDialect- Returns:
- Returns
trueif the database supports accepting bind params as args,falseotherwise. The default istrue.
-
getInExpressionCountLimit
public int getInExpressionCountLimit()
Description copied from class:DialectReturn the limit that the underlying database places on the number of elements in anINpredicate. If the database defines no such limits, simply return zero or less-than-zero.- Overrides:
getInExpressionCountLimitin classDialect- Returns:
- int The limit, or zero-or-less to indicate no limit.
-
-