public class HSQLDialect extends Dialect
Modifier and Type | Class and Description |
---|---|
static class |
HSQLDialect.ReadUncommittedLockingStrategy |
CLOSED_QUOTE, DEFAULT_BATCH_SIZE, LEGACY_LOB_MERGE_STRATEGY, NEW_LOCATOR_LOB_MERGE_STRATEGY, NO_BATCH, QUOTE, STREAM_XFER_LOB_MERGE_STRATEGY
Constructor and Description |
---|
HSQLDialect() |
Modifier and Type | Method and Description |
---|---|
boolean |
bindLimitParametersFirst()
Does the LIMIT clause come at the start of the
SELECT statement, rather than at the end?
|
boolean |
doesReadCommittedCauseWritersToBlockReaders()
For the underlying database, is READ_COMMITTED isolation implemented by
forcing readers to wait for write locks to be released?
|
boolean |
doesRepeatableReadCauseReadersToBlockWriters()
For the underlying database, is REPEATABLE_READ isolation implemented by
forcing writers to wait for read locks to be released?
|
boolean |
dropTemporaryTableAfterUse()
Do we need to drop the temporary table after use?
todo - clarify usage by Hibernate
Version 1.8 GLOBAL TEMPORARY table definitions persist beyond the end
of the session (by default, data is cleared at commit).
|
String |
generateTemporaryTableName(String baseTableName)
With HSQLDB 2.0, the table name is qualified with MODULE to assist the drop
statement (in-case there is a global name beginning with HT_)
|
String |
getAddColumnString()
The syntax used to add a column to a table (optional).
|
protected String |
getCreateSequenceString(String sequenceName)
Typically dialects which support sequences can create a sequence
with a single command.
|
String |
getCreateTemporaryTablePostfix()
No fragment is needed if data is not needed beyond commit, otherwise
should add "on commit preserve rows"
|
String |
getCreateTemporaryTableString()
Command used to create a temporary table.
|
String |
getCurrentTimestampSelectString()
Retrieve the command used to retrieve the current timestamp from the
database.
|
String |
getCurrentTimestampSQLFunctionName()
The name of the database-specific SQL function for retrieving the
current timestamp.
|
protected String |
getDropSequenceString(String sequenceName)
Typically dialects which support sequences can drop a sequence
with a single command.
|
String |
getDropTemporaryTableString()
Command used to drop a temporary table.
|
String |
getForUpdateString()
Get the string to append to SELECT statements to acquire locks
for this dialect.
|
String |
getIdentityColumnString()
The syntax used during DDL to define a column as being an IDENTITY.
|
String |
getIdentityInsertString()
The keyword used to insert a generated value into an identity column (or null).
|
String |
getIdentitySelectString()
Get the select command to use to retrieve the last generated IDENTITY
value.
|
String |
getLimitString(String sql,
boolean hasOffset)
Apply s limit clause to the query.
|
LockingStrategy |
getLockingStrategy(Lockable lockable,
LockMode lockMode)
For HSQLDB 2.0, this is a copy of the base class implementation.
|
String |
getQuerySequencesString()
Get the select command used retrieve the names of all sequences.
|
String |
getSelectClauseNullString(int sqlType)
Given a
Types type code, determine an appropriate
null value to use in a select clause. |
String |
getSelectSequenceNextValString(String sequenceName)
Generate the select expression fragment that will retrieve the next
value of a sequence as part of another (typically DML) statement.
|
String |
getSequenceNextValString(String sequenceName)
Generate the appropriate select statement to to retrieve the next value
of a sequence.
|
ViolatedConstraintNameExtracter |
getViolatedConstraintNameExtracter() |
boolean |
isCurrentTimestampSelectStringCallable()
Should the value returned by
getCurrentTimestampSelectString()
be treated as callable. |
Boolean |
performTemporaryTableDDLInIsolation()
Different behavior for GLOBAL TEMPORARY (1.8) and LOCAL TEMPORARY (2.0)
Possible return values and their meanings:
Boolean.TRUE - Unequivocally, perform the temporary table DDL
in isolation.
Boolean.FALSE - Unequivocally, do not perform the
temporary table DDL in isolation.
null - defer to the JDBC driver response in regards to
DatabaseMetaData.dataDefinitionCausesTransactionCommit()
|
boolean |
requiresCastingOfParametersInSelectClause()
todo - needs usage clarification
If the SELECT statement is always part of a UNION, then the type of
parameter is resolved by v.
|
boolean |
supportsColumnCheck()
Does this dialect support column-level check constraints?
|
boolean |
supportsCommentOn() |
boolean |
supportsCurrentTimestampSelection()
HSQLDB 1.8.x requires CALL CURRENT_TIMESTAMP but this should not
be treated as a callable statement.
|
boolean |
supportsEmptyInList()
Does this dialect support empty IN lists?
For example, is [where XYZ in ()] a supported construct?
|
boolean |
supportsIdentityColumns()
Does this dialect support identity column key generation?
|
boolean |
supportsIfExistsAfterTableName() |
boolean |
supportsLimit()
Does this dialect support some form of limiting query results
via a SQL clause?
|
boolean |
supportsLobValueChangePropogation()
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...
|
boolean |
supportsLockTimeouts()
Informational metadata about whether this dialect is known to support
specifying timeouts for requested lock acquisitions.
|
boolean |
supportsPooledSequences()
Does this dialect support "pooled" sequences.
|
boolean |
supportsSequences()
Does this dialect support sequences?
|
boolean |
supportsTemporaryTables()
Does this dialect support temporary tables?
|
boolean |
supportsTupleDistinctCounts()
Does this dialect support `count(distinct a,b)`?
|
boolean |
supportsUnionAll()
Does this dialect support UNION ALL, which is generally a faster
variant of UNION?
|
boolean |
supportsUnique()
Does this dialect support the UNIQUE column syntax?
|
String |
toBooleanValueString(boolean bool)
The SQL literal value to which this database maps boolean values.
|
appendIdentitySelectToInsert, appendLockHint, applyLocksToSql, areStringComparisonsCaseInsensitive, bindLimitParametersInReverseOrder, buildSQLExceptionConversionDelegate, buildSQLExceptionConverter, closeQuote, convertToFirstRowValue, createCaseFragment, createOuterJoinFragment, dropConstraints, forceLimitUsage, forUpdateOfColumns, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAddUniqueConstraintString, getCascadeConstraintsString, getCaseInsensitiveLike, getCastTypeName, getColumnAliasExtractor, getColumnComment, getCreateMultisetTableString, getCreateSequenceString, getCreateSequenceStrings, getCreateSequenceStrings, getCreateTableString, getCrossJoinSeparator, getDefaultProperties, getDialect, getDialect, getDropForeignKeyString, getDropSequenceStrings, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getFunctions, getHibernateTypeName, getHibernateTypeName, getIdentityColumnString, getIdentitySelectString, getKeywords, getLimitString, getLobMergeStrategy, getLowercaseFunction, getMaxAliasLength, getNativeIdentifierGeneratorClass, getNoColumnsInsertString, getNullColumnString, getReadLockString, getResultSet, getSelectGUIDString, getSqlTypeDescriptorOverride, getTableComment, getTableTypeString, getTypeName, getTypeName, getWriteLockString, hasAlterTable, hasDataTypeInIdentityColumn, hasSelfReferentialForeignKeyBug, isLockTimeoutParameterized, openQuote, qualifyIndexName, quote, registerColumnType, registerColumnType, registerFunction, registerHibernateType, registerHibernateType, registerKeyword, registerResultSetOutParameter, remapSqlTypeDescriptor, replaceResultVariableInOrderByClauseWithPosition, supportsBindAsCallableArgument, supportsCascadeDelete, supportsCaseInsensitiveLike, supportsCircularCascadeDeleteConstraints, supportsExistsInSelect, supportsExpectedLobUsagePattern, supportsIfExistsBeforeTableName, supportsInsertSelectIdentity, supportsLimitOffset, supportsNotNullUnique, supportsOuterJoinForUpdate, supportsParametersInInsertSelect, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsRowValueConstructorSyntax, supportsRowValueConstructorSyntaxInInList, supportsSubqueryOnMutatingTable, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTupleCounts, supportsUnboundedLobLocatorMaterialization, supportsUniqueConstraintInCreateAlterTable, supportsVariableLimit, toString, transformSelectString, useInputStreamToInsertBlob, useMaxForLimit
public String getAddColumnString()
Dialect
getAddColumnString
in class Dialect
public boolean supportsIdentityColumns()
Dialect
supportsIdentityColumns
in class Dialect
public String getIdentityColumnString()
Dialect
getIdentityColumnString
in class Dialect
public String getIdentitySelectString()
Dialect
getIdentitySelectString
in class Dialect
public String getIdentityInsertString()
Dialect
getIdentityInsertString
in class Dialect
public boolean supportsLockTimeouts()
Dialect
supportsLockTimeouts
in class Dialect
public String getForUpdateString()
Dialect
getForUpdateString
in class Dialect
public boolean supportsUnique()
Dialect
supportsUnique
in class Dialect
public boolean supportsLimit()
Dialect
supportsLimit
in class Dialect
public String getLimitString(String sql, boolean hasOffset)
Dialect
variable
limit clauses when they support limits. Thus, when building the
select command we do not actually need to know the limit or the offest
since we will just be using placeholders.
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
Dialect.getLimitString(String, int, int)
.getLimitString
in class Dialect
sql
- The query to which to apply the limit.hasOffset
- Is the query requesting an offset?public boolean bindLimitParametersFirst()
Dialect
bindLimitParametersFirst
in class Dialect
public boolean supportsIfExistsAfterTableName()
supportsIfExistsAfterTableName
in class Dialect
public boolean supportsColumnCheck()
Dialect
supportsColumnCheck
in class Dialect
public boolean supportsSequences()
Dialect
supportsSequences
in class Dialect
public boolean supportsPooledSequences()
Dialect
supportsPooledSequences
in class Dialect
Dialect.getCreateSequenceStrings(String, int, int)
,
Dialect.getCreateSequenceString(String, int, int)
protected String getCreateSequenceString(String sequenceName)
Dialect
Dialect.getCreateSequenceStrings(java.lang.String)
to help facilitate that.
Dialects which support sequences and can create a sequence in a
single command need *only* override this method. Dialects
which support sequences but require multiple commands to create
a sequence should instead override Dialect.getCreateSequenceStrings(java.lang.String)
.getCreateSequenceString
in class Dialect
sequenceName
- The name of the sequenceprotected String getDropSequenceString(String sequenceName)
Dialect
Dialect.getDropSequenceStrings(java.lang.String)
to help facilitate that.
Dialects which support sequences and can drop a sequence in a
single command need *only* override this method. Dialects
which support sequences but require multiple commands to drop
a sequence should instead override Dialect.getDropSequenceStrings(java.lang.String)
.getDropSequenceString
in class Dialect
sequenceName
- The name of the sequencepublic String getSelectSequenceNextValString(String sequenceName)
Dialect
Dialect.getSequenceNextValString(String)
in that this
should return an expression usable within another statement.getSelectSequenceNextValString
in class Dialect
sequenceName
- the name of the sequencepublic String getSequenceNextValString(String sequenceName)
Dialect
getSequenceNextValString
in class Dialect
sequenceName
- the name of the sequencepublic String getQuerySequencesString()
Dialect
getQuerySequencesString
in class Dialect
SchemaUpdate
public ViolatedConstraintNameExtracter getViolatedConstraintNameExtracter()
getViolatedConstraintNameExtracter
in interface ConversionContext
getViolatedConstraintNameExtracter
in class Dialect
public String getSelectClauseNullString(int sqlType)
Dialect
Types
type code, determine an appropriate
null value to use in a select clause.
One thing to consider here is that certain databases might
require proper casting for the nulls here since the select here
will be part of a UNION/UNION ALL.getSelectClauseNullString
in class Dialect
sqlType
- The Types
type code.public boolean supportsUnionAll()
Dialect
supportsUnionAll
in class Dialect
public boolean supportsTemporaryTables()
supportsTemporaryTables
in class Dialect
public String generateTemporaryTableName(String baseTableName)
generateTemporaryTableName
in class Dialect
baseTableName
- The table name from which to base the temp table name.public String getCreateTemporaryTableString()
getCreateTemporaryTableString
in class Dialect
public String getCreateTemporaryTablePostfix()
getCreateTemporaryTablePostfix
in class Dialect
public String getDropTemporaryTableString()
getDropTemporaryTableString
in class Dialect
public Boolean performTemporaryTableDDLInIsolation()
Boolean.TRUE
- Unequivocally, perform the temporary table DDL
in isolation.Boolean.FALSE
- Unequivocally, do not perform the
temporary table DDL in isolation.DatabaseMetaData.dataDefinitionCausesTransactionCommit()
performTemporaryTableDDLInIsolation
in class Dialect
public boolean dropTemporaryTableAfterUse()
Version 2.x LOCAL TEMPORARY table definitions do not persist beyond the end of the session (by default, data is cleared at commit).
dropTemporaryTableAfterUse
in class Dialect
public boolean supportsCurrentTimestampSelection()
supportsCurrentTimestampSelection
in class Dialect
public boolean isCurrentTimestampSelectStringCallable()
getCurrentTimestampSelectString()
be treated as callable. Typically this indicates that JDBC escape
syntax is being used...CALL CURRENT_TIMESTAMP is used but this should not be treated as a callable statement.
isCurrentTimestampSelectStringCallable
in class Dialect
getCurrentTimestampSelectString()
return
is callable; false otherwise.public String getCurrentTimestampSelectString()
getCurrentTimestampSelectString
in class Dialect
public String getCurrentTimestampSQLFunctionName()
getCurrentTimestampSQLFunctionName
in class Dialect
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode)
getLockingStrategy
in class Dialect
lockable
- The persister for the entity to be locked.lockMode
- The type of lock to be acquired.public boolean supportsCommentOn()
supportsCommentOn
in class Dialect
public boolean supportsEmptyInList()
Dialect
supportsEmptyInList
in class Dialect
public boolean requiresCastingOfParametersInSelectClause()
requiresCastingOfParametersInSelectClause
in class Dialect
public boolean doesReadCommittedCauseWritersToBlockReaders()
doesReadCommittedCauseWritersToBlockReaders
in class Dialect
public boolean doesRepeatableReadCauseReadersToBlockWriters()
doesRepeatableReadCauseReadersToBlockWriters
in class Dialect
public boolean supportsLobValueChangePropogation()
Dialect
Blob.setBinaryStream(long)
,
Blob.setBytes(long, byte[])
,
Blob.setBytes(long, byte[], int, int)
,
or Blob.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)
,
or Clob.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 not Dialect.supportsExpectedLobUsagePattern()
.supportsLobValueChangePropogation
in class Dialect
public String toBooleanValueString(boolean bool)
Dialect
toBooleanValueString
in class Dialect
bool
- The boolean valuepublic boolean supportsTupleDistinctCounts()
Dialect
supportsTupleDistinctCounts
in class Dialect
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.