Top Description Inners Fields Constructors Methods
org.hibernate.dialect

public Class HSQLDialect

extends Dialect
Class Inheritance
Annotations
@SuppressWarnings:deprecation
Imports
java.io.Serializable, java.sql.DatabaseMetaData, .SQLException, .Types, java.util.Locale, org.hibernate.JDBCException, .LockMode, .MappingException, .StaleObjectStateException, org.hibernate.boot.TempTableDdlTransactionHandling, org.hibernate.cfg.Environment, org.hibernate.dialect.function.AvgWithArgumentCastFunction, .NoArgSQLFunction, .SQLFunctionTemplate, .StandardSQLFunction, .VarArgsSQLFunction, org.hibernate.dialect.identity.HSQLIdentityColumnSupport, .IdentityColumnSupport, org.hibernate.dialect.lock.LockingStrategy, .OptimisticForceIncrementLockingStrategy, .OptimisticLockingStrategy, .PessimisticForceIncrementLockingStrategy, .PessimisticReadSelectLockingStrategy, .PessimisticWriteSelectLockingStrategy, .SelectLockingStrategy, org.hibernate.dialect.pagination.AbstractLimitHandler, .LimitHandler, .LimitHelper, org.hibernate.engine.jdbc.env.spi.NameQualifierSupport, org.hibernate.engine.spi.RowSelection, .SharedSessionContractImplementor, org.hibernate.exception.spi.TemplatedViolatedConstraintNameExtracter, .ViolatedConstraintNameExtracter, org.hibernate.hql.spi.id.IdTableSupportStandardImpl, .MultiTableBulkIdStrategy, org.hibernate.hql.spi.id.global.GlobalTemporaryTableBulkIdStrategy, org.hibernate.hql.spi.id.local.AfterUseAction, .LocalTemporaryTableBulkIdStrategy, org.hibernate.internal.CoreMessageLogger, org.hibernate.internal.util.JdbcExceptionHelper, .ReflectHelper, org.hibernate.persister.entity.Lockable, org.hibernate.tool.schema.extract.internal.SequenceInformationExtractorHANADatabaseImpl, .SequenceInformationExtractorHSQLDBDatabaseImpl, org.hibernate.tool.schema.extract.spi.SequenceInformationExtractor, org.hibernate.type.StandardBasicTypes, org.jboss.logging.Logger

An SQL dialect compatible with HSQLDB (HyperSQL).

Note this version supports HSQLDB version 1.8 and higher, only.

Enhancements to version 3.5.0 GA to provide basic support for both HSQLDB 1.8.x and 2.x Does not works with Hibernate 3.2 - 3.4 without alteration.

Authors
Christoph Sturm, Phillip Baird, Fred Toussi

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private static class

Field Summary

Modifier and TypeField and Description
private static final ViolatedConstraintNameExtracter
private static final ViolatedConstraintNameExtracter
EXTRACTER_20

HSQLDB 2.0 messages have changed messages may be localized - therefore use the common, non-locale element " table: "

private int
hsqldbVersion

version is 180 for 1.8.0 or 200 for 2.0.0

private final LimitHandler
private static final CoreMessageLogger
Inherited from org.hibernate.dialect.Dialect:
CLOSED_QUOTEDEFAULT_BATCH_SIZELEGACY_LOB_MERGE_STRATEGYNEW_LOCATOR_LOB_MERGE_STRATEGYNO_BATCHQUOTESTANDARD_DEFAULT_BATCH_LOAD_SIZING_STRATEGYSTREAM_XFER_LOB_MERGE_STRATEGYTWO_SINGLE_QUOTES_REPLACEMENT

Constructor Summary

AccessConstructor and Description
public
HSQLDialect()

Constructs a HSQLDialect

Method Summary

Modifier and TypeMethod and Description
public boolean
bindLimitParametersFirst()

Overrides org.hibernate.dialect.Dialect.bindLimitParametersFirst.

Does the LIMIT clause come at the start of the SELECT statement, rather than at the end?
public boolean
doesReadCommittedCauseWritersToBlockReaders()

Overrides org.hibernate.dialect.Dialect.doesReadCommittedCauseWritersToBlockReaders.

For the underlying database, is READ_COMMITTED isolation implemented by forcing readers to wait for write locks to be released?
public boolean
doesRepeatableReadCauseReadersToBlockWriters()

Overrides org.hibernate.dialect.Dialect.doesRepeatableReadCauseReadersToBlockWriters.

For the underlying database, is REPEATABLE_READ isolation implemented by forcing writers to wait for read locks to be released?
public boolean
dropConstraints()

Overrides org.hibernate.dialect.Dialect.dropConstraints.

Do we need to drop constraints before dropping tables in this dialect?
public String
getAddColumnString()

Overrides org.hibernate.dialect.Dialect.getAddColumnString.

The syntax used to add a column to a table (optional).
public String
getCascadeConstraintsString()

Overrides org.hibernate.dialect.Dialect.getCascadeConstraintsString.

Completely optional cascading drop clause
protected String
getCreateSequenceString(String
The name of the sequence
sequenceName
)

Overrides org.hibernate.dialect.Dialect.getCreateSequenceString.

HSQL will start with 0, by default.
protected String
getCreateSequenceString(String
The name of the sequence
sequenceName
,
int
The initial value to apply to 'create sequence' statement
initialValue
,
int
The increment value to apply to 'create sequence' statement
incrementSize
)

Overrides org.hibernate.dialect.Dialect.getCreateSequenceString.

Because of the overridden getCreateSequenceString(String), we must also override getCreateSequenceString(String, int, int) to prevent 2 instances of "start with".
public String
getCurrentTimestampSelectString()

Overrides org.hibernate.dialect.Dialect.getCurrentTimestampSelectString.

Retrieve the command used to retrieve the current timestamp from the database.
public String
getCurrentTimestampSQLFunctionName()

Overrides org.hibernate.dialect.Dialect.getCurrentTimestampSQLFunctionName.

The name of the database-specific SQL function for retrieving the current timestamp.
public MultiTableBulkIdStrategy
protected String
getDropSequenceString(String
The name of the sequence
sequenceName
)

Overrides org.hibernate.dialect.Dialect.getDropSequenceString.

Typically dialects which support sequences can drop a sequence with a single command.
public String
getForUpdateString()

Overrides org.hibernate.dialect.Dialect.getForUpdateString.

Get the string to append to SELECT statements to acquire locks for this dialect.
public IdentityColumnSupport
public LimitHandler
getLimitHandler()

Overrides org.hibernate.dialect.Dialect.getLimitHandler.

Returns the delegate managing LIMIT clause.
public String
getLimitString(String
The query to which to apply the limit.
sql
,
boolean
Is the query requesting an offset?
hasOffset
)

Overrides org.hibernate.dialect.Dialect.getLimitString.

Apply a limit clause to the query.
public LockingStrategy
getLockingStrategy(Lockable
The persister for the entity to be locked.
lockable
,
LockMode
The type of lock to be acquired.
lockMode
)

Overrides org.hibernate.dialect.Dialect.getLockingStrategy.

For HSQLDB 2.0, this is a copy of the base class implementation.
public NameQualifierSupport
getNameQualifierSupport()

Overrides org.hibernate.dialect.Dialect.getNameQualifierSupport.

By default interpret this based on DatabaseMetaData.
public String
getQuerySequencesString()

Overrides org.hibernate.dialect.Dialect.getQuerySequencesString.

Get the select command used retrieve the names of all sequences.
public String
getSelectClauseNullString(int
The Types type code.
sqlType
)

Overrides org.hibernate.dialect.Dialect.getSelectClauseNullString.

Given a Types type code, determine an appropriate null value to use in a select clause.
public String
getSelectSequenceNextValString(String
the name of the sequence
sequenceName
)

Overrides org.hibernate.dialect.Dialect.getSelectSequenceNextValString.

Generate the select expression fragment that will retrieve the next value of a sequence as part of another (typically DML) statement.
public SequenceInformationExtractor
public String
getSequenceNextValString(String
the name of the sequence
sequenceName
)

Overrides org.hibernate.dialect.Dialect.getSequenceNextValString.

Generate the appropriate select statement to to retrieve the next value of a sequence.
public ViolatedConstraintNameExtracter
public boolean
public boolean
requiresCastingOfParametersInSelectClause()

Overrides org.hibernate.dialect.Dialect.requiresCastingOfParametersInSelectClause.

Does this dialect require that parameters appearing in the SELECT clause be wrapped in cast() calls to tell the db parser the expected type.
public boolean
supportsColumnCheck()

Overrides org.hibernate.dialect.Dialect.supportsColumnCheck.

Does this dialect support column-level check constraints?
public boolean
supportsCommentOn()

Overrides org.hibernate.dialect.Dialect.supportsCommentOn.

Does this dialect/database support commenting on tables, columns, etc?
public boolean
supportsCurrentTimestampSelection()

Overrides org.hibernate.dialect.Dialect.supportsCurrentTimestampSelection.

HSQLDB 1.8.x requires CALL CURRENT_TIMESTAMP but this should not be treated as a callable statement.
public boolean
supportsEmptyInList()

Overrides org.hibernate.dialect.Dialect.supportsEmptyInList.

Does this dialect support empty IN lists?
public boolean
supportsIfExistsAfterTableName()

Overrides org.hibernate.dialect.Dialect.supportsIfExistsAfterTableName.

For dropping a table, can the phrase "if exists" be applied after the table name?
public boolean
supportsIfExistsBeforeTableName()

Overrides org.hibernate.dialect.Dialect.supportsIfExistsBeforeTableName.

For dropping a table, can the phrase "if exists" be applied before the table name?
public boolean
supportsLimit()

Overrides org.hibernate.dialect.Dialect.supportsLimit.

Does this dialect support some form of limiting query results via a SQL clause?
public boolean
supportsLobValueChangePropogation()

Overrides org.hibernate.dialect.Dialect.supportsLobValueChangePropogation.

Does the dialect support propagating changes to LOB values back to the database?
public boolean
supportsLockTimeouts()

Overrides org.hibernate.dialect.Dialect.supportsLockTimeouts.

Informational metadata about whether this dialect is known to support specifying timeouts for requested lock acquisitions.
public boolean
supportsNamedParameters(DatabaseMetaData databaseMetaData)

Overrides org.hibernate.dialect.Dialect.supportsNamedParameters.

Override the DatabaseMetaData#supportsNamedParameters()
public boolean
supportsPooledSequences()

Overrides org.hibernate.dialect.Dialect.supportsPooledSequences.

Does this dialect support "pooled" sequences.
public boolean
supportsSequences()

Overrides org.hibernate.dialect.Dialect.supportsSequences.

Does this dialect support sequences?
public boolean
supportsTupleDistinctCounts()

Overrides org.hibernate.dialect.Dialect.supportsTupleDistinctCounts.

Does this dialect support `count(distinct a,b)`?
public boolean
supportsUnionAll()

Overrides org.hibernate.dialect.Dialect.supportsUnionAll.

Does this dialect support UNION ALL, which is generally a faster variant of UNION?
public String
toBooleanValueString(boolean
The boolean value
bool
)

Overrides org.hibernate.dialect.Dialect.toBooleanValueString.

The SQL literal value to which this database maps boolean values.
Inherited from org.hibernate.dialect.Dialect:
addSqlHintOrCommentappendLockHintappendLockHintapplyLocksToSqlareStringComparisonsCaseInsensitiveaugmentPhysicalTableTypesaugmentRecognizedTableTypesbindLimitParametersInReverseOrderbuildIdentifierHelperbuildSQLExceptionConversionDelegatebuildSQLExceptionConvertercanCreateCatalogcanCreateSchemacastcastcastcloseQuotecontributeTypesconvertToFirstRowValuecreateCaseFragmentcreateOuterJoinFragmentdefaultScrollModeequivalentTypesescapeCommentescapeLiteralforceLimitUsageforceLobAsLastValueforUpdateOfColumnsgetAddColumnSuffixStringgetAddForeignKeyConstraintStringgetAddForeignKeyConstraintStringgetAddPrimaryKeyConstraintStringgetAddUniqueConstraintStringgetAlterTableStringgetAuxiliaryDatabaseObjectExportergetCallableStatementSupportgetCaseInsensitiveLikegetCastTypeNamegetColumnAliasExtractorgetColumnCommentgetCreateCatalogCommandgetCreateMultisetTableStringgetCreateSchemaCommandgetCreateSequenceStringsgetCreateSequenceStringsgetCreateTableStringgetCreateTemporaryTableColumnAnnotationgetCrossJoinSeparatorgetCurrentSchemaCommandgetDefaultBatchLoadSizingStrategygetDefaultPropertiesgetDialectgetDialectgetDropCatalogCommandgetDropForeignKeyStringgetDropSchemaCommandgetDropSequenceStringsgetDropTableStringgetForeignKeyExportergetForUpdateNowaitStringgetForUpdateNowaitStringgetForUpdateSkipLockedStringgetForUpdateSkipLockedStringgetForUpdateStringgetForUpdateStringgetForUpdateStringgetForUpdateStringgetFunctionsgetHibernateTypeNamegetHibernateTypeNamegetIndexExportergetInExpressionCountLimitgetKeywordsgetLimitStringgetLobMergeStrategygetLowercaseFunctiongetMaxAliasLengthgetNativeIdentifierGeneratorClassgetNativeIdentifierGeneratorStrategygetNoColumnsInsertStringgetNotExpressiongetNullColumnStringgetQueryHintStringgetQueryHintStringgetReadLockStringgetReadLockStringgetResultSetgetResultSetgetResultSetgetSchemaNameResolvergetSelectGUIDStringgetSequenceExportergetSqlTypeDescriptorOverridegetTableCommentgetTableExportergetTableTypeStringgetTypeNamegetTypeNamegetUniqueDelegategetUniqueKeyExportergetWriteLockStringgetWriteLockStringhasAlterTablehasSelfReferentialForeignKeyBuginlineLiteralisJdbcLogWarningsEnabledByDefaultisLegacyLimitHandlerBehaviorEnabledisLockTimeoutParameterizedisTypeNameRegisteredopenQuoteprependCommentqualifyIndexNamequoteregisterColumnTyperegisterColumnTyperegisterFunctionregisterHibernateTyperegisterHibernateTyperegisterKeywordregisterResultSetOutParameterregisterResultSetOutParameterremapSqlTypeDescriptorrenderOrderByElementreplaceResultVariableInOrderByClauseWithPositionrequiresParensForTupleDistinctCountssupportsBindAsCallableArgumentsupportsCascadeDeletesupportsCaseInsensitiveLikesupportsCircularCascadeDeleteConstraintssupportsExistsInSelectsupportsExpectedLobUsagePatternsupportsIfExistsAfterAlterTablesupportsIfExistsAfterConstraintNamesupportsIfExistsBeforeConstraintNamesupportsJdbcConnectionLobCreationsupportsLimitOffsetsupportsNationalizedTypessupportsNoColumnsInsertsupportsNonQueryWithCTEsupportsNotNullUniquesupportsNoWaitsupportsOuterJoinForUpdatesupportsParametersInInsertSelectsupportsPartitionBysupportsResultSetPositionQueryMethodsOnForwardOnlyCursorsupportsRowValueConstructorSyntaxsupportsRowValueConstructorSyntaxInInListsupportsRowValueConstructorSyntaxInSetsupportsSelectAliasInGroupByClausesupportsSkipLockedsupportsSubqueryOnMutatingTablesupportsSubselectAsInPredicateLHSsupportsTableChecksupportsTupleCountssupportsTuplesInSubqueriessupportsUnboundedLobLocatorMaterializationsupportsUniquesupportsUniqueConstraintInCreateAlterTablesupportsValuesListsupportsVariableLimittoStringtransformSelectStringuseFollowOnLockinguseFollowOnLockinguseInputStreamToInsertBlobuseMaxForLimit