org.hibernate.dialect
Class DerbyDialect

java.lang.Object
  extended by org.hibernate.dialect.Dialect
      extended by org.hibernate.dialect.DB2Dialect
          extended by org.hibernate.dialect.DerbyDialect

public class DerbyDialect
extends DB2Dialect

Author:
Simon Johnston Hibernate Dialect for Cloudscape 10 - aka Derby. This implements both an override for the identity column generator as well as for the case statement issue documented at: http://www.jroller.com/comments/kenlars99/Weblog/cloudscape_soon_to_be_derby

Nested Class Summary
static class DerbyDialect.DerbyTrimFunctionEmulation
          A specialized function template to emulate the ANSI trim function on Derby DB since it does not support the full trim specification.
 
Field Summary
 
Fields inherited from class org.hibernate.dialect.Dialect
CLOSED_QUOTE, DEFAULT_BATCH_SIZE, NO_BATCH, QUOTE
 
Constructor Summary
DerbyDialect()
           
 
Method Summary
 CaseFragment createCaseFragment()
          Return the case statement modified for Cloudscape.
 boolean dropConstraints()
          Do we need to drop constraints before dropping tables in this dialect?
 String getIdentityColumnString()
          This is different in Cloudscape to DB2.
 Class getNativeIdentifierGeneratorClass()
          The class (which implements IdentifierGenerator) which acts as this dialects native generation strategy.
 String getQuerySequencesString()
          Get the select command used retrieve the names of all sequences.
 boolean supportsLimit()
          Does this dialect support some form of limiting query results via a SQL clause?
 boolean supportsLimitOffset()
          Does this dialect's LIMIT support (if any) additionally support specifying an offset?
 boolean supportsLobValueChangePropogation()
          Does the dialect support propogating 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.DB2Dialect
generateTemporaryTableName, getAddColumnString, getCreateSequenceString, getCreateTemporaryTablePostfix, getCreateTemporaryTableString, getCurrentTimestampSelectString, getDropSequenceString, getForUpdateString, getIdentityInsertString, getIdentitySelectString, getLimitString, getLowercaseFunction, getResultSet, getSelectClauseNullString, getSequenceNextValString, isCurrentTimestampSelectStringCallable, main, registerResultSetOutParameter, supportsCommentOn, supportsCurrentTimestampSelection, supportsEmptyInList, supportsIdentityColumns, supportsNotNullUnique, supportsOuterJoinForUpdate, supportsParametersInInsertSelect, supportsTemporaryTables, supportsUnionAll, useMaxForLimit
 
Methods inherited from class org.hibernate.dialect.Dialect
appendIdentitySelectToInsert, appendLockHint, applyLocksToSql, areStringComparisonsCaseInsensitive, bindLimitParametersFirst, bindLimitParametersInReverseOrder, buildSQLExceptionConverter, closeQuote, createOuterJoinFragment, doesReadCommittedCauseWritersToBlockReaders, doesRepeatableReadCauseReadersToBlockWriters, dropTemporaryTableAfterUse, forUpdateOfColumns, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getCascadeConstraintsString, getCastTypeName, getColumnComment, getCreateMultisetTableString, getCreateSequenceString, getCreateSequenceStrings, getCreateSequenceStrings, getCreateTableString, getCurrentTimestampSQLFunctionName, getDefaultProperties, getDialect, getDialect, getDropForeignKeyString, getDropSequenceStrings, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateString, getForUpdateString, getFunctions, getHibernateTypeName, getHibernateTypeName, getIdentityColumnString, getIdentitySelectString, getKeywords, getLimitString, getLockingStrategy, getMaxAliasLength, getNoColumnsInsertString, getNullColumnString, getSelectGUIDString, getSelectSequenceNextValString, getTableComment, getTableTypeString, getTypeName, getTypeName, getViolatedConstraintNameExtracter, hasAlterTable, hasDataTypeInIdentityColumn, hasSelfReferentialForeignKeyBug, openQuote, performTemporaryTableDDLInIsolation, qualifyIndexName, quote, registerColumnType, registerColumnType, registerFunction, registerHibernateType, registerHibernateType, registerKeyword, supportsBindAsCallableArgument, supportsCascadeDelete, supportsCircularCascadeDeleteConstraints, supportsColumnCheck, supportsExistsInSelect, supportsExpectedLobUsagePattern, supportsIfExistsAfterTableName, supportsIfExistsBeforeTableName, supportsInsertSelectIdentity, supportsPooledSequences, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsRowValueConstructorSyntax, supportsRowValueConstructorSyntaxInInList, supportsSubqueryOnMutatingTable, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsUnboundedLobLocatorMaterialization, 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

DerbyDialect

public DerbyDialect()
Method Detail

getIdentityColumnString

public String getIdentityColumnString()
This is different in Cloudscape to DB2.

Overrides:
getIdentityColumnString in class DB2Dialect
Returns:
The appropriate DDL fragment.

createCaseFragment

public CaseFragment createCaseFragment()
Return the case statement modified for Cloudscape.

Overrides:
createCaseFragment in class Dialect
Returns:
This dialect's CaseFragment strategy.

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 DB2Dialect
Returns:
True if constraints must be dropped prior to dropping the table; false otherwise.

getNativeIdentifierGeneratorClass

public Class getNativeIdentifierGeneratorClass()
Description copied from class: Dialect
The class (which implements IdentifierGenerator) which acts as this dialects native generation strategy.

Comes into play whenever the user specifies the native generator.

Overrides:
getNativeIdentifierGeneratorClass in class Dialect
Returns:
The native generator class.

supportsSequences

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

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

supportsLimit

public boolean supportsLimit()
Description copied from class: Dialect
Does this dialect support some form of limiting query results via a SQL clause?

Overrides:
supportsLimit in class DB2Dialect
Returns:
True if this dialect supports some form of LIMIT.

supportsLimitOffset

public boolean supportsLimitOffset()
Description copied from class: Dialect
Does this dialect's LIMIT support (if any) additionally support specifying an offset?

Overrides:
supportsLimitOffset in class Dialect
Returns:
True if the dialect supports an offset within the limit support.

getQuerySequencesString

public String getQuerySequencesString()
Description copied from class: Dialect
Get the select command used retrieve the names of all sequences.

Overrides:
getQuerySequencesString in class DB2Dialect
Returns:
The select command; or null if sequences are not supported.
See Also:
SchemaUpdate

supportsLobValueChangePropogation

public boolean supportsLobValueChangePropogation()
Description copied from class: Dialect
Does the dialect support propogating 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 propogated back to the database; false otherwise.