com.ca.idms.hibernate
Class IDMSDialect

java.lang.Object
  extended by org.hibernate.dialect.Dialect
      extended by com.ca.idms.hibernate.IDMSDialect

public class IDMSDialect
extends org.hibernate.dialect.Dialect

Hibernate Dialect for CA IDMS

This class provides a base dialect that is appropriate for CA IDMS r16 and r17. It will serve as a superclass, as required, for future dialect versions.

Prerequisites Known Limitations

CA IDMS r16 and earlier does not support ANSI join syntax, although theta-style inner joins are supported. Outer joins must be performed using the CA IDMS PRESERVE SQL extension.

SELECT ... FOR UPDATE is used in CA IDMS for positioned update, not for locking. Pessimistic locking is therefore not supported.

Correct CA IDMS DDL syntax cannot be generated by the hbm2ddl tool, even with the dialect methods coded appropriately. As a result, DDL cannot be exported directly to the DBMS. Instead, export to a file, modify as required, and use as input to the IDMSBCF tool.

CA IDMS does not support comments in SQL commands. Set property use_sql_comments to false.

CA IDMS does not support subqueries in the SELECT projection list. The following is therefore invalid:
SELECT (SELECT COUNT(*) FROM ITEM I WHERE I.ITEM_ID = ITEM_ID) FROM BID

Notes

This dialect's methods write debug-level messages to the Apache commons-logging API. If you are using Apache Log4j, you can enable logging by setting the log4j.logger.org.hibernate property to DEBUG. The log entries will also be written to the CA IDMS Server log if a connection exists at that time and one of the CA IDMS trace options is enabled.

Version:
1.00
Author:
Dave Hearn, CA

Field Summary
 
Fields inherited from class org.hibernate.dialect.Dialect
CLOSED_QUOTE, DEFAULT_BATCH_SIZE, NO_BATCH, QUOTE
 
Constructor Summary
IDMSDialect()
           
 
Method Summary
 boolean dropTemporaryTableAfterUse()
           
 boolean forUpdateOfColumns()
          This method returns the same value (false) as the parent class.
 java.lang.String getAddColumnString()
           
 java.lang.String getAddForeignKeyConstraintString(java.lang.String constraintName, java.lang.String[] foreignKey, java.lang.String referencedTable, java.lang.String[] primaryKey, boolean referencesPrimaryKey)
           
 java.lang.String getAddPrimaryKeyConstraintString(java.lang.String constraintName)
           
 java.lang.String getCascadeConstraintsString()
           
 java.lang.String getCurrentTimestampSelectString()
           
 java.lang.String getCurrentTimestampSQLFunctionName()
          CA IDMS doesn't have a suitable function, therefore this method returns a null string.
 java.lang.String getForUpdateString()
          FOR UPDATE is supported only for positioned update in CA IDMS, not for locking.
 java.lang.String getForUpdateString(org.hibernate.LockMode lockMode)
          FOR UPDATE is supported only for positioned update in CA IDMS, not for locking.
 java.lang.String getForUpdateString(java.lang.String aliases)
          This method returns the same value (aliases) as the parent class.
 org.hibernate.dialect.lock.LockingStrategy getLockingStrategy(org.hibernate.persister.entity.Lockable lockable, org.hibernate.LockMode lockMode)
          FOR UPDATE doesn't affect locking in CA IDMS, so UpdateLockingStrategy is returned when an entity is versioned.
 int getMaxAliasLength()
           
 java.lang.String getNoColumnsInsertString()
           
 boolean hasDataTypeInIdentityColumn()
           
 boolean isCurrentTimestampSelectStringCallable()
           
 boolean qualifyIndexName()
           
 boolean supportsCascadeDelete()
           
 boolean supportsCircularCascadeDeleteConstraints()
           
 boolean supportsColumnCheck()
           
 boolean supportsCurrentTimestampSelection()
           
 boolean supportsEmptyInList()
           
 boolean supportsExpectedLobUsagePattern()
           
 boolean supportsLobValueChangePropogation()
           
 boolean supportsNotNullUnique()
           
 boolean supportsOuterJoinForUpdate()
           
 boolean supportsSubqueryOnMutatingTable()
           
 boolean supportsSubselectAsInPredicateLHS()
           
 boolean supportsTemporaryTables()
           
 boolean supportsUnboundedLobLocatorMaterialization()
           
 boolean supportsUnionAll()
           
 boolean supportsUnique()
           
 boolean supportsUniqueConstraintInCreateAlterTable()
           
 boolean useInputStreamToInsertBlob()
           
 
Methods inherited from class org.hibernate.dialect.Dialect
appendIdentitySelectToInsert, appendLockHint, applyLocksToSql, areStringComparisonsCaseInsensitive, bindLimitParametersFirst, bindLimitParametersInReverseOrder, buildSQLExceptionConverter, closeQuote, createCaseFragment, createOuterJoinFragment, doesReadCommittedCauseWritersToBlockReaders, doesRepeatableReadCauseReadersToBlockWriters, dropConstraints, generateTemporaryTableName, getCastTypeName, getColumnComment, getCreateMultisetTableString, getCreateSequenceString, getCreateSequenceString, getCreateSequenceStrings, getCreateSequenceStrings, getCreateTableString, getCreateTemporaryTablePostfix, getCreateTemporaryTableString, getDefaultProperties, getDialect, getDialect, getDropForeignKeyString, getDropSequenceString, getDropSequenceStrings, getForUpdateNowaitString, getForUpdateNowaitString, getFunctions, getHibernateTypeName, getHibernateTypeName, getIdentityColumnString, getIdentityColumnString, getIdentityInsertString, getIdentitySelectString, getIdentitySelectString, getKeywords, getLimitString, getLimitString, getLowercaseFunction, getNativeIdentifierGeneratorClass, getNullColumnString, getQuerySequencesString, getResultSet, getSelectClauseNullString, getSelectGUIDString, getSelectSequenceNextValString, getSequenceNextValString, getTableComment, getTableTypeString, getTypeName, getTypeName, getViolatedConstraintNameExtracter, hasAlterTable, hasSelfReferentialForeignKeyBug, openQuote, performTemporaryTableDDLInIsolation, quote, registerColumnType, registerColumnType, registerFunction, registerHibernateType, registerHibernateType, registerKeyword, registerResultSetOutParameter, supportsBindAsCallableArgument, supportsCommentOn, supportsExistsInSelect, supportsIdentityColumns, supportsIfExistsAfterTableName, supportsIfExistsBeforeTableName, supportsInsertSelectIdentity, supportsLimit, supportsLimitOffset, supportsParametersInInsertSelect, supportsPooledSequences, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsRowValueConstructorSyntax, supportsRowValueConstructorSyntaxInInList, supportsSequences, supportsTableCheck, supportsVariableLimit, toBooleanValueString, toString, transformSelectString, useMaxForLimit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

IDMSDialect

public IDMSDialect()
Method Detail

hasDataTypeInIdentityColumn

public boolean hasDataTypeInIdentityColumn()
Overrides:
hasDataTypeInIdentityColumn in class org.hibernate.dialect.Dialect

getForUpdateString

public java.lang.String getForUpdateString(org.hibernate.LockMode lockMode)
FOR UPDATE is supported only for positioned update in CA IDMS, not for locking. Therefore, this method returns a null string.

Overrides:
getForUpdateString in class org.hibernate.dialect.Dialect

getForUpdateString

public java.lang.String getForUpdateString()
FOR UPDATE is supported only for positioned update in CA IDMS, not for locking. Therefore, this method returns a null string.

Overrides:
getForUpdateString in class org.hibernate.dialect.Dialect

getLockingStrategy

public org.hibernate.dialect.lock.LockingStrategy getLockingStrategy(org.hibernate.persister.entity.Lockable lockable,
                                                                     org.hibernate.LockMode lockMode)
FOR UPDATE doesn't affect locking in CA IDMS, so UpdateLockingStrategy is returned when an entity is versioned. Since most CA IDMS customers are working with legacy schemas that are not easy to modify for versioning, we return SelectLockingStrategy for non-versioned entities (UpdateLockingStrategy is only supported for versioned entities). Non-versioned entities should be always defined with optimistic-lock="all" or optimistic-lock="dirty".

Overrides:
getLockingStrategy in class org.hibernate.dialect.Dialect

forUpdateOfColumns

public boolean forUpdateOfColumns()
This method returns the same value (false) as the parent class. It's included here only to provide a trace point for possible further research.

Overrides:
forUpdateOfColumns in class org.hibernate.dialect.Dialect

getForUpdateString

public java.lang.String getForUpdateString(java.lang.String aliases)
This method returns the same value (aliases) as the parent class. It's included here only to provide a trace point for possible further research.

Overrides:
getForUpdateString in class org.hibernate.dialect.Dialect

supportsOuterJoinForUpdate

public boolean supportsOuterJoinForUpdate()
Overrides:
supportsOuterJoinForUpdate in class org.hibernate.dialect.Dialect

supportsTemporaryTables

public boolean supportsTemporaryTables()
Overrides:
supportsTemporaryTables in class org.hibernate.dialect.Dialect

dropTemporaryTableAfterUse

public boolean dropTemporaryTableAfterUse()
Overrides:
dropTemporaryTableAfterUse in class org.hibernate.dialect.Dialect

supportsCurrentTimestampSelection

public boolean supportsCurrentTimestampSelection()
Overrides:
supportsCurrentTimestampSelection in class org.hibernate.dialect.Dialect

isCurrentTimestampSelectStringCallable

public boolean isCurrentTimestampSelectStringCallable()
Overrides:
isCurrentTimestampSelectStringCallable in class org.hibernate.dialect.Dialect

getCurrentTimestampSelectString

public java.lang.String getCurrentTimestampSelectString()
Overrides:
getCurrentTimestampSelectString in class org.hibernate.dialect.Dialect

getCurrentTimestampSQLFunctionName

public java.lang.String getCurrentTimestampSQLFunctionName()
CA IDMS doesn't have a suitable function, therefore this method returns a null string.

Overrides:
getCurrentTimestampSQLFunctionName in class org.hibernate.dialect.Dialect

supportsUnionAll

public boolean supportsUnionAll()
Overrides:
supportsUnionAll in class org.hibernate.dialect.Dialect

getNoColumnsInsertString

public java.lang.String getNoColumnsInsertString()
Overrides:
getNoColumnsInsertString in class org.hibernate.dialect.Dialect

getMaxAliasLength

public int getMaxAliasLength()
Overrides:
getMaxAliasLength in class org.hibernate.dialect.Dialect

qualifyIndexName

public boolean qualifyIndexName()
Overrides:
qualifyIndexName in class org.hibernate.dialect.Dialect

supportsUnique

public boolean supportsUnique()
Overrides:
supportsUnique in class org.hibernate.dialect.Dialect

supportsUniqueConstraintInCreateAlterTable

public boolean supportsUniqueConstraintInCreateAlterTable()
Overrides:
supportsUniqueConstraintInCreateAlterTable in class org.hibernate.dialect.Dialect

getAddColumnString

public java.lang.String getAddColumnString()
Overrides:
getAddColumnString in class org.hibernate.dialect.Dialect

getAddForeignKeyConstraintString

public java.lang.String getAddForeignKeyConstraintString(java.lang.String constraintName,
                                                         java.lang.String[] foreignKey,
                                                         java.lang.String referencedTable,
                                                         java.lang.String[] primaryKey,
                                                         boolean referencesPrimaryKey)
Overrides:
getAddForeignKeyConstraintString in class org.hibernate.dialect.Dialect

getAddPrimaryKeyConstraintString

public java.lang.String getAddPrimaryKeyConstraintString(java.lang.String constraintName)
Overrides:
getAddPrimaryKeyConstraintString in class org.hibernate.dialect.Dialect

supportsColumnCheck

public boolean supportsColumnCheck()
Overrides:
supportsColumnCheck in class org.hibernate.dialect.Dialect

supportsCascadeDelete

public boolean supportsCascadeDelete()
Overrides:
supportsCascadeDelete in class org.hibernate.dialect.Dialect

supportsNotNullUnique

public boolean supportsNotNullUnique()
Overrides:
supportsNotNullUnique in class org.hibernate.dialect.Dialect

getCascadeConstraintsString

public java.lang.String getCascadeConstraintsString()
Overrides:
getCascadeConstraintsString in class org.hibernate.dialect.Dialect

supportsEmptyInList

public boolean supportsEmptyInList()
Overrides:
supportsEmptyInList in class org.hibernate.dialect.Dialect

useInputStreamToInsertBlob

public boolean useInputStreamToInsertBlob()
Overrides:
useInputStreamToInsertBlob in class org.hibernate.dialect.Dialect

supportsCircularCascadeDeleteConstraints

public boolean supportsCircularCascadeDeleteConstraints()
Overrides:
supportsCircularCascadeDeleteConstraints in class org.hibernate.dialect.Dialect

supportsSubselectAsInPredicateLHS

public boolean supportsSubselectAsInPredicateLHS()
Overrides:
supportsSubselectAsInPredicateLHS in class org.hibernate.dialect.Dialect

supportsExpectedLobUsagePattern

public boolean supportsExpectedLobUsagePattern()
Overrides:
supportsExpectedLobUsagePattern in class org.hibernate.dialect.Dialect

supportsLobValueChangePropogation

public boolean supportsLobValueChangePropogation()
Overrides:
supportsLobValueChangePropogation in class org.hibernate.dialect.Dialect

supportsUnboundedLobLocatorMaterialization

public boolean supportsUnboundedLobLocatorMaterialization()
Overrides:
supportsUnboundedLobLocatorMaterialization in class org.hibernate.dialect.Dialect

supportsSubqueryOnMutatingTable

public boolean supportsSubqueryOnMutatingTable()
Overrides:
supportsSubqueryOnMutatingTable in class org.hibernate.dialect.Dialect


Copyright © 2009 CA, All rights reserved