public class

TeradataDialect

extends Dialect
java.lang.Object
   ↳ org.hibernate.dialect.Dialect
     ↳ org.hibernate.dialect.TeradataDialect

Class Overview

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

Summary

[Expand]
Inherited Constants
From class org.hibernate.dialect.Dialect
Public Constructors
TeradataDialect()
Constructor
Public Methods
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 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?
String getSelectClauseNullString(int sqlType)
Given a java.sql.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?
[Expand]
Inherited Methods
From class org.hibernate.dialect.Dialect
From class java.lang.Object

Public Constructors

public TeradataDialect ()

Constructor

Public Methods

public boolean areStringComparisonsCaseInsensitive ()

Are string comparisons implicitly case insensitive.

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

Returns
  • True if comparisons are case insensitive.

public boolean doesReadCommittedCauseWritersToBlockReaders ()

For the underlying database, is READ_COMMITTED isolation implemented by forcing readers to wait for write locks to be released?

Returns
  • True if writers block readers to achieve READ_COMMITTED; false otherwise.

public boolean doesRepeatableReadCauseReadersToBlockWriters ()

For the underlying database, is REPEATABLE_READ isolation implemented by forcing writers to wait for read locks to be released?

Returns
  • True if readers block writers to achieve REPEATABLE_READ; false otherwise.

public boolean dropTemporaryTableAfterUse ()

Do we need to drop the temporary table after use?

Returns
  • True if the table should be dropped.

public String getAddColumnString ()

The syntax used to add a column to a table (optional).

Returns
  • The "add column" fragment.

public String 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
  • The command used to create a multiset table.

public String getCreateTemporaryTablePostfix ()

Get any fragments needing to be postfixed to the command for temporary table creation.

Returns
  • Any required postfix.

public String getCreateTemporaryTableString ()

Command used to create a temporary table.

Returns
  • The command used to create a temporary table.

public String getForUpdateString ()

Does this dialect support the FOR UPDATE syntax?

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

public String getSelectClauseNullString (int sqlType)

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 The java.sql.Types type code.
Returns
  • The appropriate select clause value fragment.

public 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.

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

public 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.

JDBC defines a standard way to query for this information via the 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:

  • TRUE - Unequivocally, perform the temporary table DDL in isolation.
  • FALSE - Unequivocally, do not perform the temporary table DDL in isolation.
  • null - defer to the JDBC driver response in regards to dataDefinitionCausesTransactionCommit()

Returns
  • see the result matrix above.

public boolean supportsBindAsCallableArgument ()

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

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

public boolean supportsCascadeDelete ()

public boolean supportsCircularCascadeDeleteConstraints ()

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

Returns
  • True if circular cascade delete constraints are supported; false otherwise.

public boolean supportsEmptyInList ()

Does this dialect support empty IN lists?

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

Returns
  • True if empty in lists are supported; false otherwise.

public boolean supportsIdentityColumns ()

Does this dialect support identity column key generation?

Returns
  • True if IDENTITY columns are supported; false otherwise.

public 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...

For BLOBs, the internal value might be changed by: setBinaryStream(long), setBytes(long, byte[]), setBytes(long, byte[], int, int), or truncate(long).

For CLOBs, the internal value might be changed by: setAsciiStream(long), setCharacterStream(long), setString(long, String), setString(long, String, int, int), or 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
  • True if the changes are propagated back to the database; false otherwise.

public boolean supportsSequences ()

Does this dialect support sequences?

Returns
  • True if sequences supported; false otherwise.

public boolean supportsTemporaryTables ()

Does this dialect support temporary tables?

Returns
  • True if temp tables are supported; false otherwise.