If either product is installed in a different location, the pathnames that follow should be modified appropriately.
Caché version 2007.1 and above is recommended for use with Hibernate. The next step depends on the location of your CacheDB.jar depending on your version of Caché.
For example, in Hibernate 3.2, typical entries in hibernate.properties would have the following "name=value" pairs:
| Property Name | Property Value |
|---|---|
| hibernate.dialect | org.hibernate.dialect.Cache71Dialect |
| hibernate.connection.driver_class | com.intersys.jdbc.CacheDriver |
| hibernate.connection.username | (see note 1) |
| hibernate.connection.password | (see note 1) |
| hibernate.connection.url | jdbc:Cache://127.0.0.1:1972/USER |
To use Hibernate sequence support with Caché in a namespace, you must FIRST load the following file into that namespace:
etc\CacheSequences.xml
For example, at the COS terminal prompt in the namespace, run the
following command:
d LoadFile^%apiOBJ("c:\hibernate\etc\CacheSequences.xml","ck")
In your Hibernate mapping you can specify sequence use.
For example, the following shows the use of a sequence generator in a Hibernate mapping:
<id name="id" column="uid" type="long" unsaved-value="null">
<generator class="sequence"/>
</id>
Some versions of Hibernate under some circumstances call
getSelectSequenceNextValString() in the dialect. If this happens
you will receive the error message: new MappingException( "Dialect
does not support sequences" ).
| Modifier and Type | Field and Description |
|---|---|
| public static final ViolatedConstraintNameExtracter |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | areStringComparisonsCaseInsensitive()
Overrides org. |
| public boolean | bindLimitParametersFirst()
Overrides org. |
| public SQLExceptionConverter | buildSQLExceptionConverter()
Overrides org. |
| protected final void | |
| public JoinFragment | createOuterJoinFragment()
Overrides org. org. strategy responsible
for handling this dialect's variations in how joins are handled.
|
| public boolean | dropConstraints()
Do we need to drop constraints before dropping tables in this dialect?
|
| public boolean | dropTemporaryTableAfterUse()
Overrides org. |
| public String | generateTemporaryTableName(String
The table name from which to base the temp table name. baseTableName)Overrides org. |
| public String | getAddColumnString()
The syntax used to add a column to a table (optional).
|
| public String | Returns: StringThe FK constraint name. constraintName, String[] The names of the columns comprising the FK foreignKey, String The table referenced by the FK referencedTable, String[] The explicit columns in the referencedTable referenced
by this FK. primaryKey, boolean if false, constraint should be
explicit about which column names the constraint refers to referencesPrimaryKey)Overrides org. |
| public String | getCascadeConstraintsString()
Overrides org. |
| public String | getCreateTemporaryTablePostfix()
Overrides org. |
| public String | getCreateTemporaryTableString()
Overrides org. |
| public String | getIdentityColumnString()
Overrides org. |
| public String | getIdentitySelectString()
Overrides org. |
| public String | getLimitString(String
The query to which to apply the limit. sql, boolean Is the query requesting an offset? hasOffset)Overrides org. |
| public LockingStrategy | getLockingStrategy(Lockable
The persister for the entity to be locked. lockable, LockMode The type of lock to be acquired. lockMode)
Get a strategy instance which knows how to acquire a database-level lock
of the specified mode for this dialect.
|
| public String | getLowercaseFunction()
Overrides org. |
| public Class | getNativeIdentifierGeneratorClass()
Overrides org. org.)
which acts as this dialects native generation strategy.
|
| public String | getNoColumnsInsertString()
Overrides org. |
| public String | getNullColumnString()
Overrides org. |
| public ResultSet | getResultSet(CallableStatement
The callable statement. ps)Overrides org. registerResultSetOutParameter,
extract the java. from the OUT parameter.
|
| public boolean | hasAlterTable()
Overrides org. |
| public boolean | hasDataTypeInIdentityColumn()
Overrides org. |
| public boolean | |
| public Boolean | performTemporaryTableDDLInIsolation()
Overrides org. |
| public boolean | qualifyIndexName()
Do we need to qualify index names with the schema name?
|
| protected final void | |
| public int | registerResultSetOutParameter(CallableStatement
The callable statement. statement, int The bind position at which to register the OUT param. col)Overrides org. java..
|
| public boolean | |
| public boolean | |
| public boolean | supportsEmptyInList()
Overrides org. |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | supportsIdentityColumns()
Overrides org. |
| public boolean | supportsLimit()
Overrides org. |
| public boolean | supportsLimitOffset()
Overrides org. |
| public boolean | supportsOuterJoinForUpdate()
Overrides org. |
| public boolean | supportsResultSetPositionQueryMethodsOnForwardOnlyCursor()
Overrides org. |
| public boolean | supportsSequences()
Does this dialect support sequences?
|
| public boolean | supportsTemporaryTables()
Overrides org. |
| public boolean | supportsUnique()
Overrides org. |
| public boolean | supportsVariableLimit()
Overrides org. |
| public boolean | useMaxForLimit()
Overrides org. |
| EXTRACTER | back to summary |
|---|---|
| public static final ViolatedConstraintNameExtracter EXTRACTER | |
| Cache71Dialect | back to summary |
|---|---|
| public Cache71Dialect() Creates new | |
| areStringComparisonsCaseInsensitive | back to summary |
|---|---|
| public boolean areStringComparisonsCaseInsensitive() Overrides org. Doc from org. Are string comparisons implicitly case insensitive. In other words, does [where 'XYZ' = 'xyz'] resolve to true?
| |
| bindLimitParametersFirst | back to summary |
|---|---|
| public boolean bindLimitParametersFirst() Overrides org. Doc from org. Does the LIMIT clause come at the start of the SELECT statement, rather than at the end?
| |
| buildSQLExceptionConverter | back to summary |
|---|---|
| public SQLExceptionConverter buildSQLExceptionConverter() Overrides org. Doc from org. Build an instance of the SQLExceptionConverter preferred by this dialect for converting SQLExceptions into Hibernate's JDBCException hierarchy. The default Dialect implementation simply returns a converter based on X/Open SQLState codes. It is strongly recommended that specific Dialect implementations override this method, since interpretation of a SQL error is much more accurate when based on the ErrorCode rather than the SQLState. Unfortunately, the ErrorCode is a vendor- specific approach.
| |
| commonRegistration | back to summary |
|---|---|
| protected final void commonRegistration() | |
| createOuterJoinFragment | back to summary |
|---|---|
| public JoinFragment createOuterJoinFragment() Overrides org. Doc from org. Create a
| |
| dropConstraints | back to summary |
|---|---|
| public boolean dropConstraints() Overrides org. Doc from org. Do we need to drop constraints before dropping tables in this dialect?
| |
| dropTemporaryTableAfterUse | back to summary |
|---|---|
| public boolean dropTemporaryTableAfterUse() Overrides org. Doc from org. Do we need to drop the temporary table after use?
| |
| generateTemporaryTableName | back to summary |
|---|---|
| public String generateTemporaryTableName(String baseTableName) Overrides org. Doc from org. Generate a temporary table name given the base table. | |
| getAddColumnString | back to summary |
|---|---|
| public String getAddColumnString() Overrides org. Doc from org. The syntax used to add a column to a table (optional).
| |
| getAddForeignKeyConstraintString | back to summary |
|---|---|
| public String getAddForeignKeyConstraintString(String constraintName, String[] foreignKey, String referencedTable, String[] primaryKey, boolean referencesPrimaryKey) Overrides org. The syntax used to add a foreign key constraint to a table.
| |
| getCascadeConstraintsString | back to summary |
|---|---|
| public String getCascadeConstraintsString() Overrides org. Doc from org. Completely optional cascading drop clause
| |
| getCreateTemporaryTablePostfix | back to summary |
|---|---|
| public String getCreateTemporaryTablePostfix() Overrides org. Doc from org. Get any fragments needing to be postfixed to the command for temporary table creation.
| |
| getCreateTemporaryTableString | back to summary |
|---|---|
| public String getCreateTemporaryTableString() Overrides org. Doc from org. Command used to create a temporary table.
| |
| getIdentityColumnString | back to summary |
|---|---|
| public String getIdentityColumnString() throws MappingException Overrides org. Doc from org. The syntax used during DDL to define a column as being an IDENTITY.
| |
| getIdentitySelectString | back to summary |
|---|---|
| public String getIdentitySelectString() Overrides org. Doc from org. Get the select command to use to retrieve the last generated IDENTITY value.
| |
| getLimitString | back to summary |
|---|---|
| public String getLimitString(String sql, boolean hasOffset) Overrides org. Doc from org. Apply s limit clause to the query.
Typically dialects utilize
Here we do still pass along whether or not an offset was specified
so that dialects not supporting offsets can generate proper exceptions.
In general, dialects will override one or the other of this method and
| |
| getLockingStrategy | back to summary |
|---|---|
| public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode) Overrides org. Doc from org. Get a strategy instance which knows how to acquire a database-level lock of the specified mode for this dialect.
| |
| getLowercaseFunction | back to summary |
|---|---|
| public String getLowercaseFunction() Overrides org. Doc from org. The name of the SQL function that transforms a string to lowercase
| |
| getNativeIdentifierGeneratorClass | back to summary |
|---|---|
| public Class Overrides org. Doc from org. The class (which implements Comes into play whenever the user specifies the native generator.
| |
| getNoColumnsInsertString | back to summary |
|---|---|
| public String getNoColumnsInsertString() Overrides org. Doc from org. The fragment used to insert a row without specifying any column values. This is not possible on some databases.
| |
| getNullColumnString | back to summary |
|---|---|
| public String getNullColumnString() Overrides org. Doc from org. The keyword used to specify a nullable column.
| |
| getResultSet | back to summary |
|---|---|
| public ResultSet getResultSet(CallableStatement ps) throws SQLException Overrides org. Doc from org. Given a callable statement previously processed by
| |
| hasAlterTable | back to summary |
|---|---|
| public boolean hasAlterTable() Overrides org. Doc from org. Does this dialect support the ALTER TABLE syntax?
| |
| hasDataTypeInIdentityColumn | back to summary |
|---|---|
| public boolean hasDataTypeInIdentityColumn() Overrides org. Doc from org. Whether this dialect have an Identity clause added to the data type or a completely separate identity data type
| |
| hasSelfReferentialForeignKeyBug | back to summary |
|---|---|
| public boolean hasSelfReferentialForeignKeyBug() Overrides org. | |
| performTemporaryTableDDLInIsolation | back to summary |
|---|---|
| public Boolean performTemporaryTableDDLInIsolation() Overrides org. Doc from org. Does the dialect require that temporary table DDL statements occur in isolation from other statements? This would be the case if the creation would cause any current transaction to get committed implicitly.
JDBC defines a standard way to query for this information via the
Possible return values and their meanings:
| |
| qualifyIndexName | back to summary |
|---|---|
| public boolean qualifyIndexName() Overrides org. Doc from org. Do we need to qualify index names with the schema name?
| |
| register71Functions | back to summary |
|---|---|
| protected final void register71Functions() | |
| registerResultSetOutParameter | back to summary |
|---|---|
| public int registerResultSetOutParameter(CallableStatement statement, int col) throws SQLException Overrides org. Doc from org. Registers an OUT parameter which will be returning a
| |
| supportsCascadeDelete | back to summary |
|---|---|
| public boolean supportsCascadeDelete() Overrides org. | |
| supportsCheck | back to summary |
|---|---|
| public boolean supportsCheck() | |
| supportsEmptyInList | back to summary |
|---|---|
| public boolean supportsEmptyInList() Overrides org. Doc from org. Does this dialect support empty IN lists? For example, is [where XYZ in ()] a supported construct?
| |
| supportsForUpdate | back to summary |
|---|---|
| public boolean supportsForUpdate() | |
| supportsForUpdateNowait | back to summary |
|---|---|
| public boolean supportsForUpdateNowait() | |
| supportsForUpdateOf | back to summary |
|---|---|
| public boolean supportsForUpdateOf() | |
| supportsIdentityColumns | back to summary |
|---|---|
| public boolean supportsIdentityColumns() Overrides org. Doc from org. Does this dialect support identity column key generation?
| |
| supportsLimit | back to summary |
|---|---|
| public boolean supportsLimit() Overrides org. Doc from org. Does this dialect support some form of limiting query results via a SQL clause?
| |
| supportsLimitOffset | back to summary |
|---|---|
| public boolean supportsLimitOffset() Overrides org. Doc from org. Does this dialect's LIMIT support (if any) additionally support specifying an offset?
| |
| supportsOuterJoinForUpdate | back to summary |
|---|---|
| public boolean supportsOuterJoinForUpdate() Overrides org. Doc from org. Does this dialect support FOR UPDATE in conjunction with outer joined rows?
| |
| supportsResultSetPositionQueryMethodsOnForwardOnlyCursor | back to summary |
|---|---|
| public boolean supportsResultSetPositionQueryMethodsOnForwardOnlyCursor() Overrides org. Doc from org. Does this dialect support asking the result set its positioning
information on forward only cursors. Specifically, in the case of
scrolling fetches, Hibernate needs to use
NOTE : this is highly driver dependent!
| |
| supportsSequences | back to summary |
|---|---|
| public boolean supportsSequences() Overrides org. Doc from org. Does this dialect support sequences?
| |
| supportsTemporaryTables | back to summary |
|---|---|
| public boolean supportsTemporaryTables() Overrides org. Doc from org. Does this dialect support temporary tables?
| |
| supportsUnique | back to summary |
|---|---|
| public boolean supportsUnique() Overrides org. Doc from org. Does this dialect support the UNIQUE column syntax?
| |
| supportsVariableLimit | back to summary |
|---|---|
| public boolean supportsVariableLimit() Overrides org. Doc from org. Does this dialect support bind variables (i.e., prepared statement parameters) for its limit/offset?
| |
| useMaxForLimit | back to summary |
|---|---|
| public boolean useMaxForLimit() Overrides org. Doc from org. Does the LIMIT clause take a "maximum" row number instead of a total number of returned rows? This is easiest understood via an example. Consider you have a table with 20 rows, but you only want to retrieve rows number 11 through 20. Generally, a limit with offset would say that the offset = 11 and the limit = 10 (we only want 10 rows at a time); this is specifying the total number of returned rows. Some dialects require that we instead specify offset = 11 and limit = 20, where 20 is the "last" row we want relative to offset (i.e. total number of rows = 20 - 11 = 9) So essentially, is limit relative from offset? Or is limit absolute?
| |