@Deprecated public class DerbyDialect extends DB2Dialect
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
CLOSED_QUOTE, DEFAULT_BATCH_SIZE, LEGACY_LOB_MERGE_STRATEGY, NEW_LOCATOR_LOB_MERGE_STRATEGY, NO_BATCH, QUOTE, STANDARD_DEFAULT_BATCH_LOAD_SIZING_STRATEGY, STREAM_XFER_LOB_MERGE_STRATEGY
Constructor and Description |
---|
DerbyDialect()
Deprecated.
Constructs a DerbyDialect
|
Modifier and Type | Method and Description |
---|---|
IdentifierHelper |
buildIdentifierHelper(IdentifierHelperBuilder builder,
DatabaseMetaData dbMetaData)
Deprecated.
Build the IdentifierHelper indicated by this Dialect for handling identifier conversions.
|
CaseFragment |
createCaseFragment()
Deprecated.
Create a
CaseFragment strategy responsible
for handling this dialect’s variations in how CASE statements are
handled. |
boolean |
dropConstraints()
Deprecated.
Do we need to drop constraints before dropping tables in this dialect?
|
String |
getCrossJoinSeparator()
Deprecated.
Returns the separator to use for defining cross joins when translating HQL queries.
|
MultiTableBulkIdStrategy |
getDefaultMultiTableBulkIdStrategy()
Deprecated.
<p>
From Derby docs:
<pre>
The DECLARE GLOBAL TEMPORARY TABLE statement defines a temporary table for the current connection.
|
String |
getForUpdateString()
Deprecated.
Get the string to append to SELECT statements to acquire locks
for this dialect.
|
LimitHandler |
getLimitHandler()
Deprecated.
Returns the delegate managing LIMIT clause.
|
String |
getLimitString(String query,
int offset,
int limit)
Deprecated.
Given a limit and an offset, apply the limit clause to the query.
|
String |
getQuerySequencesString()
Deprecated.
Get the select command used retrieve the names of all sequences.
|
String |
getReadLockString(int timeout)
Deprecated.
Get the string to append to SELECT statements to acquire READ locks
for this dialect.
|
String |
getSequenceNextValString(String sequenceName)
Deprecated.
Generate the appropriate select statement to to retrieve the next value
of a sequence.
|
String |
getWriteLockString(int timeout)
Deprecated.
Get the string to append to SELECT statements to acquire WRITE locks
for this dialect.
|
protected void |
registerDerbyKeywords()
Deprecated.
|
boolean |
supportsCommentOn()
Deprecated.
Does this dialect/database support commenting on tables, columns, etc?
|
boolean |
supportsLimit()
Deprecated.
Does this dialect support some form of limiting query results
via a SQL clause?
|
boolean |
supportsLimitOffset()
Deprecated.
Does this dialect’s LIMIT support (if any) additionally
support specifying an offset?
|
boolean |
supportsLobValueChangePropogation()
Deprecated.
Does the dialect support propagating 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…
<p/>
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) . |
boolean |
supportsSequences()
Deprecated.
Does this dialect support sequences?
|
boolean |
supportsTuplesInSubqueries()
Deprecated.
Does this dialect support tuples in subqueries? Ex:
delete from Table1 where (col1, col2) in (select col1, col2 from Table2)
|
boolean |
supportsUnboundedLobLocatorMaterialization()
Deprecated.
Is it supported to materialize a LOB locator outside the transaction in
which it was created?
<p/>
Again, part of the trickiness here is the fact that this is largely
driver dependent.
|
boolean |
supportsVariableLimit()
Deprecated.
Does this dialect support bind variables (i.e., prepared statement
parameters) for its limit/offset?
|
buildSQLExceptionConversionDelegate, convertToFirstRowValue, doesReadCommittedCauseWritersToBlockReaders, getAddColumnString, getCreateSequenceString, getCurrentTimestampSelectString, getDropSequenceString, getIdentityColumnSupport, getLowercaseFunction, getNotExpression, getResultSet, getSelectClauseNullString, getSelectSequenceNextValString, getSqlTypeDescriptorOverride, getUniqueDelegate, isCurrentTimestampSelectStringCallable, registerResultSetOutParameter, renderOrderByElement, requiresCastingOfParametersInSelectClause, supportsCurrentTimestampSelection, supportsEmptyInList, supportsExistsInSelect, supportsLockTimeouts, supportsOuterJoinForUpdate, supportsParametersInInsertSelect, supportsPartitionBy, supportsPooledSequences, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsTupleDistinctCounts, supportsUnionAll, useMaxForLimit
addSqlHintOrComment, appendLockHint, appendLockHint, applyLocksToSql, areStringComparisonsCaseInsensitive, augmentRecognizedTableTypes, bindLimitParametersFirst, bindLimitParametersInReverseOrder, buildSQLExceptionConverter, canCreateCatalog, canCreateSchema, cast, cast, cast, closeQuote, contributeTypes, createOuterJoinFragment, defaultScrollMode, doesRepeatableReadCauseReadersToBlockWriters, escapeLiteral, forceLimitUsage, forceLobAsLastValue, forUpdateOfColumns, getAddColumnSuffixString, getAddForeignKeyConstraintString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAddUniqueConstraintString, getAlterTableString, getAuxiliaryDatabaseObjectExporter, getCallableStatementSupport, getCascadeConstraintsString, getCaseInsensitiveLike, getCastTypeName, getColumnAliasExtractor, getColumnComment, getCreateCatalogCommand, getCreateMultisetTableString, getCreateSchemaCommand, getCreateSequenceString, getCreateSequenceStrings, getCreateSequenceStrings, getCreateTableString, getCurrentSchemaCommand, getCurrentTimestampSQLFunctionName, getDefaultBatchLoadSizingStrategy, getDefaultProperties, getDialect, getDialect, getDropCatalogCommand, getDropForeignKeyString, getDropSchemaCommand, getDropSequenceStrings, getDropTableString, getForeignKeyExporter, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateSkipLockedString, getForUpdateSkipLockedString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getFunctions, getHibernateTypeName, getHibernateTypeName, getIndexExporter, getInExpressionCountLimit, getKeywords, getLimitString, getLobMergeStrategy, getLockingStrategy, getMaxAliasLength, getNameQualifierSupport, getNativeIdentifierGeneratorClass, getNativeIdentifierGeneratorStrategy, getNoColumnsInsertString, getNullColumnString, getQueryHintString, getQueryHintString, getReadLockString, getResultSet, getResultSet, getSchemaNameResolver, getSelectGUIDString, getSequenceExporter, getSequenceInformationExtractor, getTableComment, getTableExporter, getTableTypeString, getTypeName, getTypeName, getUniqueKeyExporter, getViolatedConstraintNameExtracter, getWriteLockString, hasAlterTable, hasSelfReferentialForeignKeyBug, inlineLiteral, isJdbcLogWarningsEnabledByDefault, isLegacyLimitHandlerBehaviorEnabled, isLockTimeoutParameterized, isTypeNameRegistered, openQuote, prependComment, qualifyIndexName, quote, registerColumnType, registerColumnType, registerFunction, registerHibernateType, registerHibernateType, registerKeyword, registerResultSetOutParameter, remapSqlTypeDescriptor, replaceResultVariableInOrderByClauseWithPosition, requiresParensForTupleDistinctCounts, supportsBindAsCallableArgument, supportsCascadeDelete, supportsCaseInsensitiveLike, supportsCircularCascadeDeleteConstraints, supportsColumnCheck, supportsExpectedLobUsagePattern, supportsIfExistsAfterAlterTable, supportsIfExistsAfterConstraintName, supportsIfExistsAfterTableName, supportsIfExistsBeforeConstraintName, supportsIfExistsBeforeTableName, supportsNamedParameters, supportsNationalizedTypes, supportsNonQueryWithCTE, supportsNotNullUnique, supportsNoWait, supportsRowValueConstructorSyntax, supportsRowValueConstructorSyntaxInInList, supportsSkipLocked, supportsSubqueryOnMutatingTable, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTupleCounts, supportsUnique, supportsUniqueConstraintInCreateAlterTable, supportsValuesList, toBooleanValueString, toString, transformSelectString, useFollowOnLocking, useFollowOnLocking, useInputStreamToInsertBlob
public String getCrossJoinSeparator()
Dialect
Returns the separator to use for defining cross joins when translating HQL queries. <p/> Typically this will be either [<tt> cross join </tt>] or [<tt>, </tt>] <p/> Note that the spaces are important!
getCrossJoinSeparator
in class DB2Dialect
public CaseFragment createCaseFragment()
Dialect
Create a CaseFragment
strategy responsible
for handling this dialect’s variations in how CASE statements are
handled.
createCaseFragment
in class Dialect
CaseFragment
strategy.public boolean dropConstraints()
Dialect
Do we need to drop constraints before dropping tables in this dialect?
dropConstraints
in class DB2Dialect
public boolean supportsSequences()
Dialect
Does this dialect support sequences?
supportsSequences
in class DB2Dialect
public String getQuerySequencesString()
Dialect
Get the select command used retrieve the names of all sequences.
getQuerySequencesString
in class DB2Dialect
SchemaUpdate
public String getSequenceNextValString(String sequenceName)
Dialect
Generate the appropriate select statement to to retrieve the next value of a sequence. <p/> This should be a "stand alone" select statement.
getSequenceNextValString
in class DB2Dialect
sequenceName
- the name of the sequencepublic boolean supportsLimit()
Dialect
Does this dialect support some form of limiting query results via a SQL clause?
supportsLimit
in class DB2Dialect
public boolean supportsCommentOn()
Dialect
Does this dialect/database support commenting on tables, columns, etc?
supportsCommentOn
in class DB2Dialect
true
if commenting is supportedpublic boolean supportsLimitOffset()
Dialect
Does this dialect’s LIMIT support (if any) additionally support specifying an offset?
supportsLimitOffset
in class Dialect
public String getForUpdateString()
Dialect
Get the string to append to SELECT statements to acquire locks for this dialect.
getForUpdateString
in class DB2Dialect
public String getWriteLockString(int timeout)
Dialect
Get the string to append to SELECT statements to acquire WRITE locks for this dialect. Location of the of the returned string is treated the same as getForUpdateString.
getWriteLockString
in class Dialect
timeout
- in milliseconds, -1 for indefinite wait and 0 for no wait.public String getReadLockString(int timeout)
Dialect
Get the string to append to SELECT statements to acquire READ locks for this dialect. Location of the of the returned string is treated the same as getForUpdateString.
getReadLockString
in class Dialect
timeout
- in milliseconds, -1 for indefinite wait and 0 for no wait.public LimitHandler getLimitHandler()
Dialect
Returns the delegate managing LIMIT clause.
getLimitHandler
in class DB2Dialect
public boolean supportsTuplesInSubqueries()
Dialect
Does this dialect support tuples in subqueries? Ex: delete from Table1 where (col1, col2) in (select col1, col2 from Table2)
supportsTuplesInSubqueries
in class Dialect
public String getLimitString(String query, int offset, int limit)
Given a limit and an offset, apply the limit clause to the query.
<p/> From Derby 10.5 Docs: <pre> Query</pre>
getLimitString
in class DB2Dialect
query
- The query to which to apply the limit.offset
- The offset of the limitlimit
- The limit of the limit ;)public boolean supportsVariableLimit()
Dialect
Does this dialect support bind variables (i.e., prepared statement parameters) for its limit/offset?
supportsVariableLimit
in class DB2Dialect
public boolean supportsLobValueChangePropogation()
Dialect
Does the dialect support propagating 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…
<p/>
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)
.
<p/>
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)
.
<p/>
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()
.
supportsLobValueChangePropogation
in class DB2Dialect
public boolean supportsUnboundedLobLocatorMaterialization()
Dialect
Is it supported to materialize a LOB locator outside the transaction in
which it was created?
<p/>
Again, part of the trickiness here is the fact that this is largely
driver dependent.
<p/>
NOTE: all database I have tested which Dialect.supportsExpectedLobUsagePattern()
also support the ability to materialize a LOB outside the owning transaction…
supportsUnboundedLobLocatorMaterialization
in class Dialect
public IdentifierHelper buildIdentifierHelper(IdentifierHelperBuilder builder, DatabaseMetaData dbMetaData) throws SQLException
Dialect
Build the IdentifierHelper indicated by this Dialect for handling identifier conversions.
Returning null
is allowed and indicates that Hibernate should fallback to building a
"standard" helper. In the fallback path, any changes made to the IdentifierHelperBuilder
during this call will still be incorporated into the built IdentifierHelper.
<p/>
The incoming builder will have the following set:<ul>
<li>IdentifierHelperBuilder.isGloballyQuoteIdentifiers()
</li>
<li>IdentifierHelperBuilder.getUnquotedCaseStrategy()
- initialized to UPPER</li>
<li>IdentifierHelperBuilder.getQuotedCaseStrategy()
- initialized to MIXED</li>
</ul>
<p/>
By default Hibernate will do the following:<ul>
<li>Call IdentifierHelperBuilder.applyIdentifierCasing(DatabaseMetaData)
<li>Call IdentifierHelperBuilder.applyReservedWords(DatabaseMetaData)
<li>Applies AnsiSqlKeywords.sql2003()
as reserved words</li>
<li>Applies the {#link #sqlKeywords} collected here as reserved words</li>
<li>Applies the Dialect’s NameQualifierSupport, if it defines one</li>
</ul>
buildIdentifierHelper
in class Dialect
builder
- A semi-configured IdentifierHelper builder.dbMetaData
- Access to the metadata returned from the driver if needed and if available. WARNING: may be null
null
to indicate Hibernate should use its fallback pathSQLException
- Accessing the DatabaseMetaData can throw it. Just re-throw and Hibernate will handle.Dialect.getNameQualifierSupport()
protected void registerDerbyKeywords()
public MultiTableBulkIdStrategy getDefaultMultiTableBulkIdStrategy()
<p> From Derby docs: <pre> The DECLARE GLOBAL TEMPORARY TABLE statement defines a temporary table for the current connection. </pre>
DB2Dialect
returns a GlobalTemporaryTableBulkIdStrategy
that
will make temporary tables created at startup and hence unavailable for subsequent connections.<br/>
see HHH-10238.
</p>
getDefaultMultiTableBulkIdStrategy
in class DB2Dialect
Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.