org.hibernate.dialect
Class DB2Dialect

java.lang.Object
  extended byorg.hibernate.dialect.Dialect
      extended byorg.hibernate.dialect.DB2Dialect
Direct Known Subclasses:
DB2390Dialect, DB2400Dialect, DerbyDialect

public class DB2Dialect
extends Dialect

An SQL dialect for DB2.

Author:
Gavin King

Field Summary
 
Fields inherited from class org.hibernate.dialect.Dialect
CLOSED_QUOTE, QUOTE
 
Constructor Summary
DB2Dialect()
           
 
Method Summary
 boolean dropConstraints()
          Do we need to drop constraints before dropping tables in this dialect?
 String generateTemporaryTableName(String baseTableName)
           
 String getAddColumnString()
          The syntax used to add a column to a table (optional).
 String getCreateSequenceString(String sequenceName)
          The syntax used to create a sequence, if sequences are supported.
 String getCreateTemporaryTablePostfix()
           
 String getCreateTemporaryTableString()
           
 String getCurrentTimestampSelectString()
           
 String getCurrentTimestampSQLFunctionName()
          The name of the database-specific SQL function for retrieving the current timestamp.
 String getDropSequenceString(String sequenceName)
          The syntax used to drop a sequence, if sequences are supported.
 String getForUpdateString()
          Does this dialect support the FOR UPDATE syntax?
 String getIdentityColumnString()
           
 String getIdentityInsertString()
          The keyword used to insert a generated value into an identity column (or null).
 String getIdentitySelectString()
           
 String getLimitString(String sql, boolean hasOffset)
          Add a LIMIT clause to the given SQL SELECT
 String getLowercaseFunction()
          The name of the SQL function that transforms a string to lowercase
 String getQuerySequencesString()
          A query used to find all sequences
 ResultSet getResultSet(CallableStatement ps)
           
 String getSelectClauseNullString(int sqlType)
           
 String getSequenceNextValString(String sequenceName)
          Generate the appropriate select statement to to retreive the next value of a sequence, if sequences are supported.
 boolean isCurrentTimestampSelectStringCallable()
           
static void main(String[] args)
           
 int registerResultSetOutParameter(CallableStatement statement, int col)
           
 boolean supportsCommentOn()
           
 boolean supportsCurrentTimestampSelection()
           
 boolean supportsIdentityColumns()
          Does this dialect support identity column key generation?
 boolean supportsLimit()
          Does this Dialect have some kind of LIMIT syntax?
 boolean supportsNotNullUnique()
           
 boolean supportsOuterJoinForUpdate()
           
 boolean supportsParametersInInsertSelect()
          Does this dialect support parameters within the select clause of INSERT ...
 boolean supportsSequences()
          Does this dialect support sequences?
 boolean supportsTemporaryTables()
           
 boolean supportsUnionAll()
           
 boolean useMaxForLimit()
          Does the LIMIT clause take a "maximum" row number instead of a total number of returned rows?
 
Methods inherited from class org.hibernate.dialect.Dialect
appendIdentitySelectToInsert, appendLockHint, bindLimitParametersFirst, bindLimitParametersInReverseOrder, buildSQLExceptionConverter, closeQuote, createCaseFragment, createOuterJoinFragment, dropTemporaryTableAfterUse, forUpdateOfColumns, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getCascadeConstraintsString, getCastTypeName, getColumnComment, getCreateSequenceStrings, getDefaultProperties, getDialect, getDialect, getDropForeignKeyString, getDropSequenceStrings, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateString, getForUpdateString, getFunctions, getHibernateTypeName, getHibernateTypeName, getIdentityColumnString, getIdentitySelectString, getKeywords, getLimitString, getMaxAliasLength, getNativeIdentifierGeneratorClass, getNoColumnsInsertString, getNullColumnString, getSelectGUIDString, getSelectSequenceNextValString, getTableComment, getTableTypeString, getTypeName, getTypeName, getViolatedConstraintNameExtracter, hasAlterTable, hasDataTypeInIdentityColumn, hasSelfReferentialForeignKeyBug, openQuote, performTemporaryTableDDLInIsolation, qualifyIndexName, quote, registerColumnType, registerColumnType, registerFunction, registerHibernateType, registerHibernateType, registerKeyword, supportsCascadeDelete, supportsColumnCheck, supportsIfExistsAfterTableName, supportsIfExistsBeforeTableName, supportsInsertSelectIdentity, supportsLimitOffset, supportsTableCheck, supportsUnique, supportsUniqueConstraintInCreateAlterTable, supportsVariableLimit, toBooleanValueString, toString, transformSelectString, useInputStreamToInsertBlob
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DB2Dialect

public DB2Dialect()
Method Detail

getLowercaseFunction

public String getLowercaseFunction()
Description copied from class: Dialect
The name of the SQL function that transforms a string to lowercase

Overrides:
getLowercaseFunction in class Dialect
Returns:
String

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

dropConstraints

public boolean dropConstraints()
Description copied from class: Dialect
Do we need to drop constraints before dropping tables in this dialect?

Overrides:
dropConstraints in class Dialect
Returns:
boolean

supportsIdentityColumns

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

Overrides:
supportsIdentityColumns in class Dialect
Returns:
boolean

getIdentitySelectString

public String getIdentitySelectString()
Overrides:
getIdentitySelectString in class Dialect

getIdentityColumnString

public String getIdentityColumnString()
Overrides:
getIdentityColumnString in class Dialect

getIdentityInsertString

public String getIdentityInsertString()
Description copied from class: Dialect
The keyword used to insert a generated value into an identity column (or null). Need if the dialect does not support inserts that specify no column values.

Overrides:
getIdentityInsertString in class Dialect
Returns:
String

getSequenceNextValString

public String getSequenceNextValString(String sequenceName)
Description copied from class: Dialect
Generate the appropriate select statement to to retreive the next value of a sequence, if sequences are supported.

This should be a "stand alone" select statement.

Overrides:
getSequenceNextValString in class Dialect
Parameters:
sequenceName - the name of the sequence
Returns:
String The "nextval" select string.

getCreateSequenceString

public String getCreateSequenceString(String sequenceName)
Description copied from class: Dialect
The syntax used to create a sequence, if sequences are supported.

Overrides:
getCreateSequenceString in class Dialect
Parameters:
sequenceName - the name of the sequence
Returns:
String

getDropSequenceString

public String getDropSequenceString(String sequenceName)
Description copied from class: Dialect
The syntax used to drop a sequence, if sequences are supported.

Overrides:
getDropSequenceString in class Dialect
Parameters:
sequenceName - the name of the sequence
Returns:
String

supportsSequences

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

Overrides:
supportsSequences in class Dialect
Returns:
boolean

getQuerySequencesString

public String getQuerySequencesString()
Description copied from class: Dialect
A query used to find all sequences

Overrides:
getQuerySequencesString in class Dialect
See Also:
SchemaUpdate

supportsLimit

public boolean supportsLimit()
Description copied from class: Dialect
Does this Dialect have some kind of LIMIT syntax?

Overrides:
supportsLimit in class Dialect

getLimitString

public String getLimitString(String sql,
                             boolean hasOffset)
Description copied from class: Dialect
Add a LIMIT clause to the given SQL SELECT

Overrides:
getLimitString in class Dialect
Returns:
the modified SQL

getForUpdateString

public String getForUpdateString()
Description copied from class: Dialect
Does this dialect support the FOR UPDATE syntax?

Overrides:
getForUpdateString in class Dialect
Returns:
boolean

useMaxForLimit

public boolean useMaxForLimit()
Description copied from class: Dialect
Does the LIMIT clause take a "maximum" row number instead of a total number of returned rows?

Overrides:
useMaxForLimit in class Dialect

supportsOuterJoinForUpdate

public boolean supportsOuterJoinForUpdate()
Overrides:
supportsOuterJoinForUpdate in class Dialect

supportsNotNullUnique

public boolean supportsNotNullUnique()
Overrides:
supportsNotNullUnique in class Dialect

getSelectClauseNullString

public String getSelectClauseNullString(int sqlType)
Overrides:
getSelectClauseNullString in class Dialect

main

public static void main(String[] args)

supportsUnionAll

public boolean supportsUnionAll()
Overrides:
supportsUnionAll in class Dialect

registerResultSetOutParameter

public int registerResultSetOutParameter(CallableStatement statement,
                                         int col)
                                  throws SQLException
Overrides:
registerResultSetOutParameter in class Dialect
Throws:
SQLException

getResultSet

public ResultSet getResultSet(CallableStatement ps)
                       throws SQLException
Overrides:
getResultSet in class Dialect
Throws:
SQLException

supportsCommentOn

public boolean supportsCommentOn()
Overrides:
supportsCommentOn in class Dialect

supportsTemporaryTables

public boolean supportsTemporaryTables()
Overrides:
supportsTemporaryTables in class Dialect

getCreateTemporaryTableString

public String getCreateTemporaryTableString()
Overrides:
getCreateTemporaryTableString in class Dialect

getCreateTemporaryTablePostfix

public String getCreateTemporaryTablePostfix()
Overrides:
getCreateTemporaryTablePostfix in class Dialect

generateTemporaryTableName

public String generateTemporaryTableName(String baseTableName)
Overrides:
generateTemporaryTableName in class Dialect

supportsCurrentTimestampSelection

public boolean supportsCurrentTimestampSelection()
Overrides:
supportsCurrentTimestampSelection in class Dialect

getCurrentTimestampSelectString

public String getCurrentTimestampSelectString()
Overrides:
getCurrentTimestampSelectString in class Dialect

isCurrentTimestampSelectStringCallable

public boolean isCurrentTimestampSelectStringCallable()
Overrides:
isCurrentTimestampSelectStringCallable in class Dialect

supportsParametersInInsertSelect

public boolean supportsParametersInInsertSelect()
Description copied from class: Dialect
Does this dialect support parameters within the select clause of INSERT ... SELECT ... statements?

Overrides:
supportsParametersInInsertSelect in class Dialect
Returns:
True if this is supported; false otherwise.

getCurrentTimestampSQLFunctionName

public String getCurrentTimestampSQLFunctionName()
Description copied from class: Dialect
The name of the database-specific SQL function for retrieving the current timestamp.

Overrides:
getCurrentTimestampSQLFunctionName in class Dialect
Returns:
The function name.