org.hibernate.dialect
Class TeradataDialect

java.lang.Object
  extended by org.hibernate.dialect.Dialect
      extended by org.hibernate.dialect.TeradataDialect
All Implemented Interfaces:
ConversionContext

public class TeradataDialect
extends Dialect

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, STREAM_XFER_LOB_MERGE_STRATEGY
 
Constructor Summary
TeradataDialect()
          Constructor
 
Method Summary
 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?
 boolean dropTemporaryTableAfterUse()
          Do we need to drop the temporary table after use?
 String getAddColumnString()
          The syntax used to add a column to a table (optional).
 String getCreateMultisetTableString()
          Slight variation on Dialect.getCreateTableString().
 String getCreateTemporaryTablePostfix()
          Get any fragments needing to be postfixed to the command for temporary table creation.
 String getCreateTemporaryTableString()
          Command used to create a temporary table.
 String getForUpdateString()
          Does this dialect support the FOR UPDATE syntax?
 int getInExpressionCountLimit()
          Return the limit that the underlying database places on the number elements in an IN predicate.
 String getSelectClauseNullString(int sqlType)
          Given a Types type code, determine an appropriate null value to use in a select clause.
 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 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.
 boolean supportsBindAsCallableArgument()
          Does this dialect support using a JDBC bind parameter as an argument to a function or procedure call?
 boolean supportsCascadeDelete()
           
 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?

For example, is [where XYZ in ()] a supported construct?

 boolean supportsIdentityColumns()
          Does this dialect support identity column key generation?
 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?
 boolean supportsTemporaryTables()
          Does this dialect support temporary tables?
 
Methods inherited from class org.hibernate.dialect.Dialect
appendIdentitySelectToInsert, appendLockHint, appendLockHint, applyLocksToSql, bindLimitParametersFirst, bindLimitParametersInReverseOrder, buildLimitHandler, buildSQLExceptionConversionDelegate, buildSQLExceptionConverter, cast, cast, cast, closeQuote, convertToFirstRowValue, createCaseFragment, createOuterJoinFragment, dropConstraints, forceLimitUsage, forceLobAsLastValue, forUpdateOfColumns, generateTemporaryTableName, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAddUniqueConstraintString, getCascadeConstraintsString, getCaseInsensitiveLike, getCastTypeName, getColumnAliasExtractor, getColumnComment, getCreateSequenceString, getCreateSequenceString, getCreateSequenceStrings, getCreateSequenceStrings, getCreateTableString, getCrossJoinSeparator, getCurrentTimestampSelectString, getCurrentTimestampSQLFunctionName, getDefaultProperties, getDialect, getDialect, getDropForeignKeyString, getDropSequenceString, getDropSequenceStrings, getDropTableString, getDropTemporaryTableString, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getFunctions, getHibernateTypeName, getHibernateTypeName, getIdentityColumnString, getIdentityColumnString, getIdentityInsertString, getIdentitySelectString, getIdentitySelectString, getKeywords, getLimitString, getLimitString, getLobMergeStrategy, getLockingStrategy, getLowercaseFunction, getMaxAliasLength, getNativeIdentifierGeneratorClass, getNoColumnsInsertString, getNotExpression, getNullColumnString, getQuerySequencesString, getReadLockString, getResultSet, getSelectGUIDString, getSelectSequenceNextValString, getSequenceNextValString, getSqlTypeDescriptorOverride, getTableComment, getTableTypeString, getTypeName, getTypeName, getViolatedConstraintNameExtracter, getWriteLockString, hasAlterTable, hasDataTypeInIdentityColumn, hasSelfReferentialForeignKeyBug, isCurrentTimestampSelectStringCallable, isLockTimeoutParameterized, openQuote, qualifyIndexName, quote, registerColumnType, registerColumnType, registerFunction, registerHibernateType, registerHibernateType, registerKeyword, registerResultSetOutParameter, remapSqlTypeDescriptor, replaceResultVariableInOrderByClauseWithPosition, requiresCastingOfParametersInSelectClause, supportsCaseInsensitiveLike, supportsColumnCheck, supportsCommentOn, supportsCurrentTimestampSelection, supportsExistsInSelect, supportsExpectedLobUsagePattern, supportsIfExistsAfterTableName, supportsIfExistsBeforeTableName, supportsInsertSelectIdentity, supportsLimit, supportsLimitOffset, supportsLockTimeouts, supportsNotNullUnique, supportsOuterJoinForUpdate, supportsParametersInInsertSelect, supportsPooledSequences, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsRowValueConstructorSyntax, supportsRowValueConstructorSyntaxInInList, supportsSubqueryOnMutatingTable, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTupleCounts, supportsTupleDistinctCounts, supportsUnboundedLobLocatorMaterialization, supportsUnionAll, supportsUnique, supportsUniqueConstraintInCreateAlterTable, supportsVariableLimit, toBooleanValueString, toString, transformSelectString, useFollowOnLocking, useInputStreamToInsertBlob, useMaxForLimit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TeradataDialect

public TeradataDialect()
Constructor

Method Detail

getForUpdateString

public String getForUpdateString()
Does this dialect support the FOR UPDATE syntax?

Overrides:
getForUpdateString in class Dialect
Returns:
empty string ... Teradata does not support FOR UPDATE syntax

supportsIdentityColumns

public boolean supportsIdentityColumns()
Description copied from class: Dialect
Does this dialect support identity column key generation?

Overrides:
supportsIdentityColumns in class Dialect
Returns:
True if IDENTITY columns are supported; false otherwise.

supportsSequences

public boolean supportsSequences()
Description copied from class: Dialect
Does this dialect support sequences?

Overrides:
supportsSequences in class Dialect
Returns:
True if sequences supported; false otherwise.

getAddColumnString

public String getAddColumnString()
Description copied from class: Dialect
The syntax used to add a column to a table (optional).

Overrides:
getAddColumnString in class Dialect
Returns:
The "add column" fragment.

supportsTemporaryTables

public boolean supportsTemporaryTables()
Description copied from class: Dialect
Does this dialect support temporary tables?

Overrides:
supportsTemporaryTables in class Dialect
Returns:
True if temp tables are supported; false otherwise.

getCreateTemporaryTableString

public String getCreateTemporaryTableString()
Description copied from class: Dialect
Command used to create a temporary table.

Overrides:
getCreateTemporaryTableString in class Dialect
Returns:
The command used to create a temporary table.

getCreateTemporaryTablePostfix

public String getCreateTemporaryTablePostfix()
Description copied from class: Dialect
Get any fragments needing to be postfixed to the command for temporary table creation.

Overrides:
getCreateTemporaryTablePostfix in class Dialect
Returns:
Any required postfix.

performTemporaryTableDDLInIsolation

public Boolean performTemporaryTableDDLInIsolation()
Description copied from class: Dialect
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 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:

Overrides:
performTemporaryTableDDLInIsolation in class Dialect
Returns:
see the result matrix above.

dropTemporaryTableAfterUse

public boolean dropTemporaryTableAfterUse()
Description copied from class: Dialect
Do we need to drop the temporary table after use?

Overrides:
dropTemporaryTableAfterUse in class Dialect
Returns:
True if the table should be dropped.

getTypeName

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 - java.sql.Types typecode
length - the length or precision of the column
precision - the precision of the column
scale - the scale of the column
Returns:
the database type name
Throws:
HibernateException

supportsCascadeDelete

public boolean supportsCascadeDelete()
Overrides:
supportsCascadeDelete in class Dialect

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 class Dialect
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 class Dialect
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 class Dialect
Returns:
True if empty in lists are supported; false otherwise.

getSelectClauseNullString

public String getSelectClauseNullString(int sqlType)
Description copied from class: Dialect
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.

Overrides:
getSelectClauseNullString in class Dialect
Parameters:
sqlType - The Types type code.
Returns:
The appropriate select clause value fragment.

getCreateMultisetTableString

public String getCreateMultisetTableString()
Description copied from class: Dialect
Slight variation on Dialect.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 class Dialect
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), 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 Dialect.supportsExpectedLobUsagePattern().

Overrides:
supportsLobValueChangePropogation in class Dialect
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 class Dialect
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 class Dialect
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 class Dialect
Returns:
Returns true if the database supports accepting bind params as args, false otherwise. The default is true.

getInExpressionCountLimit

public int getInExpressionCountLimit()
Description copied from class: Dialect
Return the limit that the underlying database places on the number elements in an IN predicate. If the database defines no such limits, simply return zero or less-than-zero.

Overrides:
getInExpressionCountLimit in class Dialect
Returns:
int The limit, or zero-or-less to indicate no limit.


Copyright © 2001-2013 Red Hat, Inc. All Rights Reserved.