|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hibernate.dialect.Dialect
org.hibernate.dialect.HSQLDialect
public class HSQLDialect
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.0 Should work with Hibernate 3.2 and later
| Nested Class Summary | |
|---|---|
static class |
HSQLDialect.ReadUncommittedLockingStrategy
|
| Field Summary |
|---|
| Fields inherited from class org.hibernate.dialect.Dialect |
|---|
CLOSED_QUOTE, DEFAULT_BATCH_SIZE, NO_BATCH, QUOTE |
| Constructor Summary | |
|---|---|
HSQLDialect()
|
|
| Method Summary | |
|---|---|
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 (data is cleared). |
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 behaviour 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 propogating 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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public HSQLDialect()
| Method Detail |
|---|
public String getAddColumnString()
Dialect
getAddColumnString in class Dialectpublic boolean supportsIdentityColumns()
Dialect
supportsIdentityColumns in class Dialectpublic String getIdentityColumnString()
Dialect
getIdentityColumnString in class Dialectpublic String getIdentitySelectString()
Dialect
getIdentitySelectString in class Dialectpublic String getIdentityInsertString()
Dialect
getIdentityInsertString in class Dialectpublic boolean supportsLockTimeouts()
Dialect
supportsLockTimeouts in class Dialectpublic String getForUpdateString()
Dialect
getForUpdateString in class Dialectpublic boolean supportsUnique()
Dialect
supportsUnique in class Dialectpublic boolean supportsLimit()
Dialect
supportsLimit in class Dialect
public String getLimitString(String sql,
boolean hasOffset)
Dialectvariable
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 Dialectsql - The query to which to apply the limit.hasOffset - Is the query requesting an offset?
public boolean bindLimitParametersFirst()
Dialect
bindLimitParametersFirst in class Dialectpublic boolean supportsIfExistsAfterTableName()
supportsIfExistsAfterTableName in class Dialectpublic boolean supportsColumnCheck()
Dialect
supportsColumnCheck in class Dialectpublic boolean supportsSequences()
Dialect
supportsSequences in class Dialectpublic boolean supportsPooledSequences()
Dialect
supportsPooledSequences in class DialectDialect.getCreateSequenceStrings(String, int, int),
Dialect.getCreateSequenceString(String, int, int)protected String getCreateSequenceString(String sequenceName)
DialectDialect.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 DialectsequenceName - The name of the sequence
protected String getDropSequenceString(String sequenceName)
DialectDialect.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 DialectsequenceName - The name of the sequence
public String getSelectSequenceNextValString(String sequenceName)
DialectDialect.getSequenceNextValString(String) in that this
should return an expression usable within another statement.
getSelectSequenceNextValString in class DialectsequenceName - the name of the sequence
public String getSequenceNextValString(String sequenceName)
Dialect
getSequenceNextValString in class DialectsequenceName - the name of the sequence
public String getQuerySequencesString()
Dialect
getQuerySequencesString in class DialectSchemaUpdatepublic ViolatedConstraintNameExtracter getViolatedConstraintNameExtracter()
getViolatedConstraintNameExtracter in class Dialectpublic String getSelectClauseNullString(int sqlType)
DialectTypes 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 DialectsqlType - The Types type code.
public boolean supportsUnionAll()
Dialect
supportsUnionAll in class Dialectpublic boolean supportsTemporaryTables()
supportsTemporaryTables in class Dialectpublic String generateTemporaryTableName(String baseTableName)
generateTemporaryTableName in class DialectbaseTableName - The table name from which to base the temp table name.
public String getCreateTemporaryTableString()
getCreateTemporaryTableString in class Dialectpublic String getCreateTemporaryTablePostfix()
getCreateTemporaryTablePostfix in class Dialectpublic String getDropTemporaryTableString()
getDropTemporaryTableString in class Dialectpublic 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 Dialectpublic boolean dropTemporaryTableAfterUse()
dropTemporaryTableAfterUse in class Dialectpublic boolean supportsCurrentTimestampSelection()
supportsCurrentTimestampSelection in class Dialectpublic boolean isCurrentTimestampSelectStringCallable()
getCurrentTimestampSelectString()
be treated as callable. Typically this indicates that JDBC escape
syntax is being used...
isCurrentTimestampSelectStringCallable in class DialectgetCurrentTimestampSelectString() return
is callable; false otherwise.public String getCurrentTimestampSelectString()
getCurrentTimestampSelectString in class Dialectpublic String getCurrentTimestampSQLFunctionName()
getCurrentTimestampSQLFunctionName in class Dialect
public LockingStrategy getLockingStrategy(Lockable lockable,
LockMode lockMode)
getLockingStrategy in class Dialectlockable - The persister for the entity to be locked.lockMode - The type of lock to be acquired.
public boolean supportsCommentOn()
supportsCommentOn in class Dialectpublic boolean supportsEmptyInList()
Dialect
supportsEmptyInList in class Dialectpublic boolean requiresCastingOfParametersInSelectClause()
requiresCastingOfParametersInSelectClause in class Dialectpublic boolean doesReadCommittedCauseWritersToBlockReaders()
doesReadCommittedCauseWritersToBlockReaders in class Dialectpublic boolean doesRepeatableReadCauseReadersToBlockWriters()
doesRepeatableReadCauseReadersToBlockWriters in class Dialectpublic boolean supportsLobValueChangePropogation()
DialectBlob.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 Dialectpublic String toBooleanValueString(boolean bool)
Dialect
toBooleanValueString in class Dialectbool - The boolean value
public boolean supportsTupleDistinctCounts()
Dialect
supportsTupleDistinctCounts in class Dialect
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||