Package org.hibernate.dialect
Class DerbyDialect
java.lang.Object
org.hibernate.dialect.Dialect
org.hibernate.dialect.DB2Dialect
org.hibernate.dialect.DerbyDialect
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
-
Field Summary
Fields inherited from class org.hibernate.dialect.Dialect
CLOSED_QUOTE, DEFAULT_BATCH_SIZE, NO_BATCH, QUOTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn the case statement modified for Cloudscape.booleanDo we need to drop constraints before dropping tables in this dialect?Get the separator to use for defining cross joins when translating HQL queries.Get the string to append to SELECT statements to acquire locks for this dialect.getLimitString(String query, int offset, int limit) Given a limit and an offset, apply the limit clause to the query.Get the select command used retrieve the names of all sequences.getReadLockString(int timeout) Get the string to append to SELECT statements to acquire WRITE locks for this dialect.getSequenceNextValString(String sequenceName) Generate the appropriate select statement to to retrieve the next value of a sequence.getWriteLockString(int timeout) Get the string to append to SELECT statements to acquire WRITE locks for this dialect.booleanbooleanDoes this dialect support some form of limiting query results via a SQL clause?booleanDoes this dialect's LIMIT support (if any) additionally support specifying an offset?booleanDoes 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...booleanDoes this dialect support sequences?booleanIs it supported to materialize a LOB locator outside the transaction in which it was created?booleanDoes this dialect support bind variables (i.e., prepared statement parameters) for its limit/offset?Methods inherited from class org.hibernate.dialect.DB2Dialect
convertToFirstRowValue, doesReadCommittedCauseWritersToBlockReaders, generateTemporaryTableName, getAddColumnString, getCreateSequenceString, getCreateTemporaryTablePostfix, getCreateTemporaryTableString, getCurrentTimestampSelectString, getDropSequenceString, getIdentityColumnString, getIdentityInsertString, getIdentitySelectString, getLimitString, getLowercaseFunction, getResultSet, getSelectClauseNullString, isCurrentTimestampSelectStringCallable, main, registerResultSetOutParameter, requiresCastingOfParametersInSelectClause, supportsCurrentTimestampSelection, supportsEmptyInList, supportsIdentityColumns, supportsNotNullUnique, supportsOuterJoinForUpdate, supportsParametersInInsertSelect, supportsPooledSequences, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsTemporaryTables, supportsTupleDistinctCounts, supportsUnionAll, useMaxForLimitMethods inherited from class org.hibernate.dialect.Dialect
addTypeOverride, appendIdentitySelectToInsert, appendLockHint, applyLocksToSql, areStringComparisonsCaseInsensitive, bindLimitParametersFirst, bindLimitParametersInReverseOrder, buildSQLExceptionConverter, closeQuote, createOuterJoinFragment, doesRepeatableReadCauseReadersToBlockWriters, dropTemporaryTableAfterUse, forceLimitUsage, forUpdateOfColumns, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getCascadeConstraintsString, getCastTypeName, getColumnAliasExtractor, getColumnComment, getCreateMultisetTableString, getCreateSequenceString, getCreateSequenceStrings, getCreateSequenceStrings, getCreateTableString, getCurrentTimestampSQLFunctionName, getDefaultProperties, getDialect, getDialect, getDropForeignKeyString, getDropSequenceStrings, getDropTemporaryTableString, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getFunctions, getHibernateTypeName, getHibernateTypeName, getIdentityColumnString, getIdentitySelectString, getKeywords, getLockingStrategy, getMaxAliasLength, getNativeIdentifierGeneratorClass, getNoColumnsInsertString, getNullColumnString, getSelectGUIDString, getSelectSequenceNextValString, getTableComment, getTableTypeString, getTypeName, getTypeName, getTypeOverrides, getViolatedConstraintNameExtracter, hasAlterTable, hasDataTypeInIdentityColumn, hasSelfReferentialForeignKeyBug, isLockTimeoutParameterized, openQuote, performTemporaryTableDDLInIsolation, qualifyIndexName, quote, registerColumnType, registerColumnType, registerFunction, registerHibernateType, registerHibernateType, registerKeyword, replaceResultVariableInOrderByClauseWithPosition, supportsBindAsCallableArgument, supportsCascadeDelete, supportsCircularCascadeDeleteConstraints, supportsColumnCheck, supportsExistsInSelect, supportsExpectedLobUsagePattern, supportsIfExistsAfterTableName, supportsIfExistsBeforeTableName, supportsInsertSelectIdentity, supportsLockTimeouts, supportsRowValueConstructorSyntax, supportsRowValueConstructorSyntaxInInList, supportsSubqueryOnMutatingTable, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTupleCounts, supportsUnique, supportsUniqueConstraintInCreateAlterTable, toBooleanValueString, toString, transformSelectString, useInputStreamToInsertBlob
-
Constructor Details
-
DerbyDialect
public DerbyDialect()
-
-
Method Details
-
getCrossJoinSeparator
Description copied from class:DialectGet the separator to use for defining cross joins when translating HQL queries. Typically this will be either [ cross join ] or [, ] Note that the spaces are important!- Overrides:
getCrossJoinSeparatorin classDB2Dialect- Returns:
-
createCaseFragment
Return the case statement modified for Cloudscape.- Overrides:
createCaseFragmentin classDialect- Returns:
- This dialect's
CaseFragmentstrategy.
-
dropConstraints
public boolean dropConstraints()Description copied from class:DialectDo we need to drop constraints before dropping tables in this dialect?- Overrides:
dropConstraintsin classDB2Dialect- Returns:
- True if constraints must be dropped prior to dropping the table; false otherwise.
-
supportsSequences
public boolean supportsSequences()Description copied from class:DialectDoes this dialect support sequences?- Overrides:
supportsSequencesin classDB2Dialect- Returns:
- True if sequences supported; false otherwise.
-
getSequenceNextValString
Description copied from class:DialectGenerate the appropriate select statement to to retrieve the next value of a sequence. This should be a "stand alone" select statement.- Overrides:
getSequenceNextValStringin classDB2Dialect- Parameters:
sequenceName- the name of the sequence- Returns:
- String The "nextval" select string.
-
supportsLimit
public boolean supportsLimit()Description copied from class:DialectDoes this dialect support some form of limiting query results via a SQL clause?- Overrides:
supportsLimitin classDB2Dialect- Returns:
- True if this dialect supports some form of LIMIT.
-
supportsCommentOn
public boolean supportsCommentOn()- Overrides:
supportsCommentOnin classDB2Dialect
-
supportsLimitOffset
public boolean supportsLimitOffset()Description copied from class:DialectDoes this dialect's LIMIT support (if any) additionally support specifying an offset?- Overrides:
supportsLimitOffsetin classDialect- Returns:
- True if the dialect supports an offset within the limit support.
-
getForUpdateString
Description copied from class:DialectGet the string to append to SELECT statements to acquire locks for this dialect.- Overrides:
getForUpdateStringin classDB2Dialect- Returns:
- The appropriate FOR UPDATE clause string.
-
getWriteLockString
Description copied from class:DialectGet 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.- Overrides:
getWriteLockStringin classDialect- Parameters:
timeout- in milliseconds, -1 for indefinite wait and 0 for no wait.- Returns:
- The appropriate LOCK clause string.
-
getReadLockString
Description copied from class:DialectGet 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.- Overrides:
getReadLockStringin classDialect- Parameters:
timeout- in milliseconds, -1 for indefinite wait and 0 for no wait.- Returns:
- The appropriate LOCK clause string.
-
getLimitString
Given a limit and an offset, apply the limit clause to the query. From Derby 10.5 Docs:Query [ORDER BY clause] [result offset clause] [fetch first clause] [FOR UPDATE clause] [WITH {RR|RS|CS|UR}]- Overrides:
getLimitStringin classDialect- Parameters:
query- The query to which to apply the limit.offset- The offset of the limitlimit- The limit of the limit ;)- Returns:
- The modified query statement with the limit applied.
-
supportsVariableLimit
public boolean supportsVariableLimit()Description copied from class:DialectDoes this dialect support bind variables (i.e., prepared statement parameters) for its limit/offset?- Overrides:
supportsVariableLimitin classDialect- Returns:
- True if bind variables can be used; false otherwise.
-
getQuerySequencesString
Description copied from class:DialectGet the select command used retrieve the names of all sequences.- Overrides:
getQuerySequencesStringin classDB2Dialect- Returns:
- The select command; or null if sequences are not supported.
- See Also:
-
supportsLobValueChangePropogation
public boolean supportsLobValueChangePropogation()Description copied from class:DialectDoes 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... For BLOBs, the internal value might be changed by:Blob.setBinaryStream(long),Blob.setBytes(long, byte[]),Blob.setBytes(long, byte[], int, int), orBlob.truncate(long). 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), orClob.truncate(long). NOTE : I do not know the correct answer currently for databases which (1) are not part of the cruise control process or (2) do notDialect.supportsExpectedLobUsagePattern().- Overrides:
supportsLobValueChangePropogationin classDB2Dialect- Returns:
- True if the changes are propagated back to the database; false otherwise.
-
supportsUnboundedLobLocatorMaterialization
public boolean supportsUnboundedLobLocatorMaterialization()Description copied from class:DialectIs it supported to materialize a LOB locator outside the transaction in which it was created? Again, part of the trickiness here is the fact that this is largely driver dependent. NOTE: all database I have tested whichDialect.supportsExpectedLobUsagePattern()also support the ability to materialize a LOB outside the owning transaction...- Overrides:
supportsUnboundedLobLocatorMaterializationin classDialect- Returns:
- True if unbounded materialization is supported; false otherwise.
-