org.hibernate.dialect

Class Cache71Dialect


public class Cache71Dialect
extends Dialect

Caché 2007.1 dialect. This class is required in order to use Hibernate with Intersystems Cach? SQL.

Compatible with Cach? 2007.1.
Caché and Hibernate

Caché and Hibernate

PREREQUISITES


HIBERNATE DIRECTORIES AND FILES

InterSystems Worldwide Response Center

CACHÉ DOCUMENTATION

InterSystems

HIBERNATE DOCUMENTATION

Manning Publications Co

TO SET UP HIBERNATE FOR USE WITH CACHÉ

  1. Copy C:\CacheSys\dev\java\lib\JDK15\CacheDB.jar to C:\Hibernate\lib\CacheDB.jar.
  2. Insert the following files into your Java classpath:

    • All jar files in the directory C:\Hibernate\lib
    • The directory (or directories) where hibernate.properties and/or hibernate.cfg.xml are kept.
    • In the file, hibernate.properties (or hibernate.cfg.xml), specify the Caché dialect and the Caché version URL settings.

    Property NameProperty Value
    hibernate.dialectorg.hibernate.dialect.Cache71Dialect
    hibernate.connection.driver_classcom.intersys.jdbc.CacheDriver
    hibernate.connection.username(see note 1)
    hibernate.connection.password(see note 1)
    hibernate.connection.urljdbc:Cache://127.0.0.1:1972/USER

    Note 1

    CACHÉ VERSION URL


    CACHÉ DIALECTS


    1. org.hibernate.dialect.Cache71Dialect (requires Caché 2007.1 or above)

    SUPPORT FOR IDENTITY COLUMNS


    SEQUENCE DIALECTS SUPPORT SEQUENCES

         etc\CacheSequences.xml
     

         <id name="id" column="uid" type="long" unsaved-value="null">
             <generator class="sequence"/>
         </id>
     


    HIBERNATE FILES ASSOCIATED WITH CACHÉ DIALECT

    1. src\org\hibernate\dialect\Cache71Dialect.java
    2. src\org\hibernate\dialect\function\ConditionalParenthesisFunction.java
    3. src\org\hibernate\dialect\function\ConvertFunction.java
    4. src\org\hibernate\exception\CacheSQLStateConverter.java
    5. src\org\hibernate\sql\CacheJoinFragment.java
    Author:
    Jonathan Levinson

    Field Summary

    static ViolatedConstraintNameExtracter
    EXTRACTER

    Fields inherited from class org.hibernate.dialect.Dialect

    CLOSED_QUOTE, DEFAULT_BATCH_SIZE, NO_BATCH, QUOTE

    Constructor Summary

    Cache71Dialect()
    Creates new Cach?71Dialect instance.

    Method Summary

    boolean
    areStringComparisonsCaseInsensitive()
    boolean
    bindLimitParametersFirst()
    SQLExceptionConverter
    buildSQLExceptionConverter()
    protected void
    commonRegistration()
    JoinFragment
    createOuterJoinFragment()
    boolean
    dropConstraints()
    boolean
    dropTemporaryTableAfterUse()
    String
    generateTemporaryTableName(String baseTableName)
    String
    getAddColumnString()
    String
    getAddForeignKeyConstraintString(String constraintName, String[] foreignKey, String referencedTable, String[] primaryKey, boolean referencesPrimaryKey)
    The syntax used to add a foreign key constraint to a table.
    String
    getCascadeConstraintsString()
    String
    getCreateTemporaryTablePostfix()
    String
    getCreateTemporaryTableString()
    String
    getIdentityColumnString()
    String
    getIdentitySelectString()
    String
    getLimitString(String sql, boolean hasOffset)
    LockingStrategy
    getLockingStrategy(Lockable lockable, LockMode lockMode)
    String
    getLowercaseFunction()
    Class
    getNativeIdentifierGeneratorClass()
    String
    getNoColumnsInsertString()
    String
    getNullColumnString()
    ResultSet
    getResultSet(CallableStatement ps)
    boolean
    hasAlterTable()
    boolean
    hasDataTypeInIdentityColumn()
    boolean
    hasSelfReferentialForeignKeyBug()
    Boolean
    performTemporaryTableDDLInIsolation()
    boolean
    qualifyIndexName()
    protected void
    register71Functions()
    int
    registerResultSetOutParameter(CallableStatement statement, int col)
    boolean
    supportsCascadeDelete()
    boolean
    supportsCheck()
    boolean
    supportsEmptyInList()
    boolean
    supportsForUpdate()
    boolean
    supportsForUpdateNowait()
    boolean
    supportsForUpdateOf()
    boolean
    supportsIdentityColumns()
    boolean
    supportsLimit()
    boolean
    supportsLimitOffset()
    boolean
    supportsOuterJoinForUpdate()
    boolean
    supportsResultSetPositionQueryMethodsOnForwardOnlyCursor()
    boolean
    supportsSequences()
    boolean
    supportsTemporaryTables()
    boolean
    supportsUnique()
    boolean
    supportsVariableLimit()
    boolean
    useMaxForLimit()

    Methods inherited from class org.hibernate.dialect.Dialect

    appendIdentitySelectToInsert, appendLockHint, applyLocksToSql, areStringComparisonsCaseInsensitive, bindLimitParametersFirst, bindLimitParametersInReverseOrder, buildSQLExceptionConverter, closeQuote, createCaseFragment, createOuterJoinFragment, doesReadCommittedCauseWritersToBlockReaders, doesRepeatableReadCauseReadersToBlockWriters, dropConstraints, dropTemporaryTableAfterUse, forUpdateOfColumns, generateTemporaryTableName, getAddColumnString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getCascadeConstraintsString, getCastTypeName, getColumnComment, getCreateMultisetTableString, getCreateSequenceString, getCreateSequenceString, getCreateSequenceStrings, getCreateSequenceStrings, getCreateTableString, getCreateTemporaryTablePostfix, getCreateTemporaryTableString, getCurrentTimestampSQLFunctionName, getCurrentTimestampSelectString, getDefaultProperties, getDialect, getDialect, getDropForeignKeyString, getDropSequenceString, getDropSequenceStrings, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateString, getForUpdateString, getForUpdateString, getFunctions, getHibernateTypeName, getHibernateTypeName, getIdentityColumnString, getIdentityColumnString, getIdentityInsertString, getIdentitySelectString, getIdentitySelectString, getKeywords, getLimitString, getLimitString, getLockingStrategy, getLowercaseFunction, getMaxAliasLength, getNativeIdentifierGeneratorClass, getNoColumnsInsertString, getNullColumnString, getQuerySequencesString, getResultSet, getSelectClauseNullString, getSelectGUIDString, getSelectSequenceNextValString, getSequenceNextValString, getTableComment, getTableTypeString, getTypeName, getTypeName, getViolatedConstraintNameExtracter, hasAlterTable, hasDataTypeInIdentityColumn, hasSelfReferentialForeignKeyBug, isCurrentTimestampSelectStringCallable, openQuote, performTemporaryTableDDLInIsolation, qualifyIndexName, quote, registerColumnType, registerColumnType, registerFunction, registerHibernateType, registerHibernateType, registerKeyword, registerResultSetOutParameter, supportsBindAsCallableArgument, supportsCascadeDelete, supportsCircularCascadeDeleteConstraints, supportsColumnCheck, supportsCommentOn, supportsCurrentTimestampSelection, supportsEmptyInList, supportsExistsInSelect, supportsExpectedLobUsagePattern, supportsIdentityColumns, supportsIfExistsAfterTableName, supportsIfExistsBeforeTableName, supportsInsertSelectIdentity, supportsLimit, supportsLimitOffset, supportsLobValueChangePropogation, supportsNotNullUnique, supportsOuterJoinForUpdate, supportsParametersInInsertSelect, supportsPooledSequences, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsRowValueConstructorSyntax, supportsRowValueConstructorSyntaxInInList, supportsSequences, supportsSubqueryOnMutatingTable, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTemporaryTables, supportsUnboundedLobLocatorMaterialization, supportsUnionAll, supportsUnique, supportsUniqueConstraintInCreateAlterTable, supportsVariableLimit, toBooleanValueString, toString, transformSelectString, useInputStreamToInsertBlob, useMaxForLimit

    Field Details

    EXTRACTER

    public static final ViolatedConstraintNameExtracter EXTRACTER

    Constructor Details

    Cache71Dialect

    public Cache71Dialect()
    Creates new Cach?71Dialect instance. Sets up the JDBC / Cach? type mappings.

    Method Details

    areStringComparisonsCaseInsensitive

    public boolean areStringComparisonsCaseInsensitive()
    Overrides:
    areStringComparisonsCaseInsensitive in interface Dialect

    bindLimitParametersFirst

    public boolean bindLimitParametersFirst()
    Overrides:
    bindLimitParametersFirst in interface Dialect

    buildSQLExceptionConverter

    public SQLExceptionConverter buildSQLExceptionConverter()
    Overrides:
    buildSQLExceptionConverter in interface Dialect

    commonRegistration

    protected final void commonRegistration()

    createOuterJoinFragment

    public JoinFragment createOuterJoinFragment()
    Overrides:
    createOuterJoinFragment in interface Dialect

    dropConstraints

    public boolean dropConstraints()
    Overrides:
    dropConstraints in interface Dialect

    dropTemporaryTableAfterUse

    public boolean dropTemporaryTableAfterUse()
    Overrides:
    dropTemporaryTableAfterUse in interface Dialect

    generateTemporaryTableName

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

    getAddColumnString

    public String getAddColumnString()
    Overrides:
    getAddColumnString in interface Dialect

    getAddForeignKeyConstraintString

    public String getAddForeignKeyConstraintString(String constraintName,
                                                   String[] foreignKey,
                                                   String referencedTable,
                                                   String[] primaryKey,
                                                   boolean referencesPrimaryKey)
    The syntax used to add a foreign key constraint to a table.
    Overrides:
    getAddForeignKeyConstraintString in interface Dialect
    Returns:
    String

    getCascadeConstraintsString

    public String getCascadeConstraintsString()
    Overrides:
    getCascadeConstraintsString in interface Dialect

    getCreateTemporaryTablePostfix

    public String getCreateTemporaryTablePostfix()
    Overrides:
    getCreateTemporaryTablePostfix in interface Dialect

    getCreateTemporaryTableString

    public String getCreateTemporaryTableString()
    Overrides:
    getCreateTemporaryTableString in interface Dialect

    getIdentityColumnString

    public String getIdentityColumnString()
                throws MappingException
    Overrides:
    getIdentityColumnString in interface Dialect

    getIdentitySelectString

    public String getIdentitySelectString()
    Overrides:
    getIdentitySelectString in interface Dialect

    getLimitString

    public String getLimitString(String sql,
                                 boolean hasOffset)
    Overrides:
    getLimitString in interface Dialect

    getLockingStrategy

    public LockingStrategy getLockingStrategy(Lockable lockable,
                                              LockMode lockMode)
    Overrides:
    getLockingStrategy in interface Dialect

    getLowercaseFunction

    public String getLowercaseFunction()
    Overrides:
    getLowercaseFunction in interface Dialect

    getNativeIdentifierGeneratorClass

    public Class getNativeIdentifierGeneratorClass()
    Overrides:
    getNativeIdentifierGeneratorClass in interface Dialect

    getNoColumnsInsertString

    public String getNoColumnsInsertString()
    Overrides:
    getNoColumnsInsertString in interface Dialect

    getNullColumnString

    public String getNullColumnString()
    Overrides:
    getNullColumnString in interface Dialect

    getResultSet

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

    hasAlterTable

    public boolean hasAlterTable()
    Overrides:
    hasAlterTable in interface Dialect

    hasDataTypeInIdentityColumn

    public boolean hasDataTypeInIdentityColumn()
    Overrides:
    hasDataTypeInIdentityColumn in interface Dialect

    hasSelfReferentialForeignKeyBug

    public boolean hasSelfReferentialForeignKeyBug()
    Overrides:
    hasSelfReferentialForeignKeyBug in interface Dialect

    performTemporaryTableDDLInIsolation

    public Boolean performTemporaryTableDDLInIsolation()
    Overrides:
    performTemporaryTableDDLInIsolation in interface Dialect

    qualifyIndexName

    public boolean qualifyIndexName()
    Overrides:
    qualifyIndexName in interface Dialect

    register71Functions

    protected final void register71Functions()

    registerResultSetOutParameter

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

    supportsCascadeDelete

    public boolean supportsCascadeDelete()
    Overrides:
    supportsCascadeDelete in interface Dialect

    supportsCheck

    public boolean supportsCheck()

    supportsEmptyInList

    public boolean supportsEmptyInList()
    Overrides:
    supportsEmptyInList in interface Dialect

    supportsForUpdate

    public boolean supportsForUpdate()

    supportsForUpdateNowait

    public boolean supportsForUpdateNowait()

    supportsForUpdateOf

    public boolean supportsForUpdateOf()

    supportsIdentityColumns

    public boolean supportsIdentityColumns()
    Overrides:
    supportsIdentityColumns in interface Dialect

    supportsLimit

    public boolean supportsLimit()
    Overrides:
    supportsLimit in interface Dialect

    supportsLimitOffset

    public boolean supportsLimitOffset()
    Overrides:
    supportsLimitOffset in interface Dialect

    supportsOuterJoinForUpdate

    public boolean supportsOuterJoinForUpdate()
    Overrides:
    supportsOuterJoinForUpdate in interface Dialect

    supportsResultSetPositionQueryMethodsOnForwardOnlyCursor

    public boolean supportsResultSetPositionQueryMethodsOnForwardOnlyCursor()
    Overrides:
    supportsResultSetPositionQueryMethodsOnForwardOnlyCursor in interface Dialect

    supportsSequences

    public boolean supportsSequences()
    Overrides:
    supportsSequences in interface Dialect

    supportsTemporaryTables

    public boolean supportsTemporaryTables()
    Overrides:
    supportsTemporaryTables in interface Dialect

    supportsUnique

    public boolean supportsUnique()
    Overrides:
    supportsUnique in interface Dialect

    supportsVariableLimit

    public boolean supportsVariableLimit()
    Overrides:
    supportsVariableLimit in interface Dialect

    useMaxForLimit

    public boolean useMaxForLimit()
    Overrides:
    useMaxForLimit in interface Dialect