org.hibernate.dialect
Class MimerSQLDialect

java.lang.Object
  extended by org.hibernate.dialect.Dialect
      extended by org.hibernate.dialect.MimerSQLDialect

public class MimerSQLDialect
extends Dialect

An Hibernate 3 SQL dialect for Mimer SQL. This dialect requires Mimer SQL 9.2.1 or later because of the mappings to NCLOB, BINARY, and BINARY VARYING.

Author:
Fredrik ´┐Żlund

Field Summary
 
Fields inherited from class org.hibernate.dialect.Dialect
CLOSED_QUOTE, DEFAULT_BATCH_SIZE, NO_BATCH, QUOTE
 
Constructor Summary
MimerSQLDialect()
          Even thoug Mimer SQL supports character and binary columns up to 15 000 in lenght, this is also the maximum width of the table (exluding LOBs).
 
Method Summary
 boolean dropConstraints()
          We do not have to drop constraints before we drop the table
 boolean forUpdateOfColumns()
          Does the FOR UPDATE OF syntax specify particular columns?
 String getAddColumnString()
          The syntax used to add a column to a table
 String getCascadeConstraintsString()
          The syntax for using cascade on constraints
 String getCreateSequenceString(String sequenceName)
          The syntax used to create a sequence.
 String getDropSequenceString(String sequenceName)
          The syntax used to drop sequences
 String getQuerySequencesString()
          The syntax for fetching all sequnces avialable in the current schema.
 String getSequenceNextValString(String sequenceName)
          The syntax used to get the next value of a sequence in Mimer SQL
 boolean supportsForUpdate()
          Support the FOR UPDATE syntax? For now, returns false since the current version of the Mimer SQL JDBC Driver does not support updatable resultsets.
 boolean supportsIdentityColumns()
          TODO: Check if Mimer SQL cannot handle the way DB2 does
 boolean supportsLimit()
          Mimer SQL does not support limit
 boolean supportsOuterJoinForUpdate()
          For now, simply return false since we don't updatable result sets.
 boolean supportsSequences()
          Mimer SQL supports sequences
 
Methods inherited from class org.hibernate.dialect.Dialect
addTypeOverride, appendIdentitySelectToInsert, appendLockHint, applyLocksToSql, areStringComparisonsCaseInsensitive, bindLimitParametersFirst, bindLimitParametersInReverseOrder, buildSQLExceptionConverter, closeQuote, convertToFirstRowValue, createCaseFragment, createOuterJoinFragment, doesReadCommittedCauseWritersToBlockReaders, doesRepeatableReadCauseReadersToBlockWriters, dropTemporaryTableAfterUse, forceLimitUsage, generateTemporaryTableName, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getCastTypeName, getColumnAliasExtractor, getColumnComment, getCreateMultisetTableString, getCreateSequenceString, getCreateSequenceStrings, getCreateSequenceStrings, getCreateTableString, getCreateTemporaryTablePostfix, getCreateTemporaryTableString, getCrossJoinSeparator, getCurrentTimestampSelectString, getCurrentTimestampSQLFunctionName, getDefaultProperties, getDialect, getDialect, getDropForeignKeyString, getDropSequenceStrings, getDropTemporaryTableString, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getFunctions, getHibernateTypeName, getHibernateTypeName, getIdentityColumnString, getIdentityColumnString, getIdentityInsertString, getIdentitySelectString, getIdentitySelectString, getKeywords, getLimitString, getLimitString, getLockingStrategy, getLowercaseFunction, getMaxAliasLength, getNativeIdentifierGeneratorClass, getNoColumnsInsertString, getNullColumnString, getReadLockString, getResultSet, getSelectClauseNullString, getSelectGUIDString, getSelectSequenceNextValString, getTableComment, getTableTypeString, getTypeName, getTypeName, getTypeOverrides, getViolatedConstraintNameExtracter, getWriteLockString, hasAlterTable, hasDataTypeInIdentityColumn, hasSelfReferentialForeignKeyBug, isCurrentTimestampSelectStringCallable, isLockTimeoutParameterized, openQuote, performTemporaryTableDDLInIsolation, qualifyIndexName, quote, registerColumnType, registerColumnType, registerFunction, registerHibernateType, registerHibernateType, registerKeyword, registerResultSetOutParameter, replaceResultVariableInOrderByClauseWithPosition, requiresCastingOfParametersInSelectClause, supportsBindAsCallableArgument, supportsCascadeDelete, supportsCircularCascadeDeleteConstraints, supportsColumnCheck, supportsCommentOn, supportsCurrentTimestampSelection, supportsEmptyInList, supportsExistsInSelect, supportsExpectedLobUsagePattern, supportsIfExistsAfterTableName, supportsIfExistsBeforeTableName, supportsInsertSelectIdentity, supportsLimitOffset, supportsLobValueChangePropogation, supportsLockTimeouts, supportsNotNullUnique, supportsParametersInInsertSelect, supportsPooledSequences, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsRowValueConstructorSyntax, supportsRowValueConstructorSyntaxInInList, supportsSubqueryOnMutatingTable, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTemporaryTables, supportsTupleCounts, supportsTupleDistinctCounts, supportsUnboundedLobLocatorMaterialization, supportsUnionAll, supportsUnique, supportsUniqueConstraintInCreateAlterTable, supportsVariableLimit, toBooleanValueString, toString, transformSelectString, useInputStreamToInsertBlob, useMaxForLimit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MimerSQLDialect

public MimerSQLDialect()
Even thoug Mimer SQL supports character and binary columns up to 15 000 in lenght, this is also the maximum width of the table (exluding LOBs). To avoid breaking the limit all the time we limit the length of the character columns to CHAR_MAX_LENTH, NATIONAL_CHAR_LENGTH for national characters, and BINARY_MAX_LENGTH for binary types.

Method Detail

getAddColumnString

public String getAddColumnString()
The syntax used to add a column to a table

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

dropConstraints

public boolean dropConstraints()
We do not have to drop constraints before we drop the table

Overrides:
dropConstraints in class Dialect
Returns:
True if constraints must be dropped prior to dropping the table; false otherwise.

supportsIdentityColumns

public boolean supportsIdentityColumns()
TODO: Check if Mimer SQL cannot handle the way DB2 does

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

supportsSequences

public boolean supportsSequences()
Mimer SQL supports sequences

Overrides:
supportsSequences in class Dialect
Returns:
boolean

getSequenceNextValString

public String getSequenceNextValString(String sequenceName)
The syntax used to get the next value of a sequence in Mimer SQL

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

getCreateSequenceString

public String getCreateSequenceString(String sequenceName)
The syntax used to create a sequence. Since we presume the sequences will be used as keys, we make them unique.

Overrides:
getCreateSequenceString in class Dialect
Parameters:
sequenceName - The name of the sequence
Returns:
The sequence creation command

getDropSequenceString

public String getDropSequenceString(String sequenceName)
The syntax used to drop sequences

Overrides:
getDropSequenceString in class Dialect
Parameters:
sequenceName - The name of the sequence
Returns:
The sequence drop commands

supportsLimit

public boolean supportsLimit()
Mimer SQL does not support limit

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

getCascadeConstraintsString

public String getCascadeConstraintsString()
The syntax for using cascade on constraints

Overrides:
getCascadeConstraintsString in class Dialect
Returns:
String

getQuerySequencesString

public String getQuerySequencesString()
The syntax for fetching all sequnces avialable in the current schema.

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

forUpdateOfColumns

public boolean forUpdateOfColumns()
Does the FOR UPDATE OF syntax specify particular columns?

Overrides:
forUpdateOfColumns in class Dialect
Returns:
True if the database supports FOR UPDATE OF syntax; false otherwise.

supportsForUpdate

public boolean supportsForUpdate()
Support the FOR UPDATE syntax? For now, returns false since the current version of the Mimer SQL JDBC Driver does not support updatable resultsets. Otherwise, Mimer SQL actually supports the for update syntax.

Returns:
boolean

supportsOuterJoinForUpdate

public boolean supportsOuterJoinForUpdate()
For now, simply return false since we don't updatable result sets.

Overrides:
supportsOuterJoinForUpdate in class Dialect
Returns:
True if outer joined rows can be locked via FOR UPDATE.


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