类 HSQLDialect
- java.lang.Object
-
- org.hibernate.dialect.Dialect
-
- org.hibernate.dialect.HSQLDialect
-
- 所有已实现的接口:
ConversionContext
public class HSQLDialect extends Dialect
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.- 作者:
- Christoph Sturm, Phillip Baird, Fred Toussi
-
-
构造器概要
构造器 构造器 说明 HSQLDialect()Constructs a HSQLDialect
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 booleanbindLimitParametersFirst()Does the LIMIT clause come at the start of the SELECT statement, rather than at the end?booleandoesReadCommittedCauseWritersToBlockReaders()For the underlying database, is READ_COMMITTED isolation implemented by forcing readers to wait for write locks to be released?booleandoesRepeatableReadCauseReadersToBlockWriters()For the underlying database, is REPEATABLE_READ isolation implemented by forcing writers to wait for read locks to be released?booleandropConstraints()Do we need to drop constraints before dropping tables in this dialect?StringgetAddColumnString()The syntax used to add a column to a table (optional).StringgetCascadeConstraintsString()Completely optional cascading drop clauseprotected StringgetCreateSequenceString(String sequenceName)HSQL will start with 0, by default.protected StringgetCreateSequenceString(String sequenceName, int initialValue, int incrementSize)Because of the overriddengetCreateSequenceString(String), we must also overridegetCreateSequenceString(String, int, int)to prevent 2 instances of "start with".StringgetCurrentTimestampSelectString()Retrieve the command used to retrieve the current timestamp from the database.StringgetCurrentTimestampSQLFunctionName()The name of the database-specific SQL function for retrieving the current timestamp.MultiTableBulkIdStrategygetDefaultMultiTableBulkIdStrategy()protected StringgetDropSequenceString(String sequenceName)Typically dialects which support sequences can drop a sequence with a single command.StringgetForUpdateString()Get the string to append to SELECT statements to acquire locks for this dialect.IdentityColumnSupportgetIdentityColumnSupport()Get the appropriateIdentityColumnSupportLimitHandlergetLimitHandler()Returns the delegate managing LIMIT clause.StringgetLimitString(String sql, boolean hasOffset)Apply a limit clause to the query.LockingStrategygetLockingStrategy(Lockable lockable, LockMode lockMode)For HSQLDB 2.0, this is a copy of the base class implementation.NameQualifierSupportgetNameQualifierSupport()By default interpret this based on DatabaseMetaData.StringgetQuerySequencesString()Get the select command used retrieve the names of all sequences.StringgetSelectClauseNullString(int sqlType)Given aTypestype code, determine an appropriate null value to use in a select clause.StringgetSelectSequenceNextValString(String sequenceName)Generate the select expression fragment that will retrieve the next value of a sequence as part of another (typically DML) statement.SequenceInformationExtractorgetSequenceInformationExtractor()StringgetSequenceNextValString(String sequenceName)Generate the appropriate select statement to to retrieve the next value of a sequence.ViolatedConstraintNameExtractergetViolatedConstraintNameExtracter()booleanisCurrentTimestampSelectStringCallable()Should the value returned byDialect.getCurrentTimestampSelectString()be treated as callable.booleanrequiresCastingOfParametersInSelectClause()Does this dialect require that parameters appearing in the SELECT clause be wrapped in cast() calls to tell the db parser the expected type.booleansupportsColumnCheck()Does this dialect support column-level check constraints?booleansupportsCommentOn()Does this dialect/database support commenting on tables, columns, etc?booleansupportsCurrentTimestampSelection()HSQLDB 1.8.x requires CALL CURRENT_TIMESTAMP but this should not be treated as a callable statement.booleansupportsEmptyInList()Does this dialect support empty IN lists?booleansupportsIfExistsAfterTableName()For dropping a table, can the phrase "if exists" be applied after the table name?booleansupportsIfExistsBeforeTableName()For dropping a table, can the phrase "if exists" be applied before the table name?booleansupportsLimit()Does this dialect support some form of limiting query results via a SQL clause?booleansupportsLobValueChangePropogation()Does the dialect support propagating changes to LOB values back to the database?booleansupportsLockTimeouts()Informational metadata about whether this dialect is known to support specifying timeouts for requested lock acquisitions.booleansupportsNamedParameters(DatabaseMetaData databaseMetaData)Override the DatabaseMetaData#supportsNamedParameters()booleansupportsPooledSequences()Does this dialect support "pooled" sequences.booleansupportsSequences()Does this dialect support sequences?booleansupportsTupleDistinctCounts()Does this dialect support `count(distinct a,b)`?booleansupportsUnionAll()Does this dialect support UNION ALL, which is generally a faster variant of UNION?StringtoBooleanValueString(boolean bool)The SQL literal value to which this database maps boolean values.-
从类继承的方法 org.hibernate.dialect.Dialect
addSqlHintOrComment, appendLockHint, appendLockHint, applyLocksToSql, areStringComparisonsCaseInsensitive, augmentRecognizedTableTypes, bindLimitParametersInReverseOrder, buildIdentifierHelper, buildSQLExceptionConversionDelegate, buildSQLExceptionConverter, canCreateCatalog, canCreateSchema, cast, cast, cast, closeQuote, contributeTypes, convertToFirstRowValue, createCaseFragment, createOuterJoinFragment, defaultScrollMode, escapeLiteral, forceLimitUsage, forceLobAsLastValue, forUpdateOfColumns, getAddColumnSuffixString, getAddForeignKeyConstraintString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAddUniqueConstraintString, getAlterTableString, getAuxiliaryDatabaseObjectExporter, getCallableStatementSupport, getCaseInsensitiveLike, getCastTypeName, getColumnAliasExtractor, getColumnComment, getCreateCatalogCommand, getCreateMultisetTableString, getCreateSchemaCommand, getCreateSequenceStrings, getCreateSequenceStrings, getCreateTableString, getCrossJoinSeparator, getCurrentSchemaCommand, 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, getLowercaseFunction, getMaxAliasLength, getNativeIdentifierGeneratorClass, getNativeIdentifierGeneratorStrategy, getNoColumnsInsertString, getNotExpression, getNullColumnString, getQueryHintString, getQueryHintString, getReadLockString, getReadLockString, getResultSet, getResultSet, getResultSet, getSchemaNameResolver, getSelectGUIDString, getSequenceExporter, getSqlTypeDescriptorOverride, getTableComment, getTableExporter, getTableTypeString, getTypeName, getTypeName, getUniqueDelegate, getUniqueKeyExporter, getWriteLockString, getWriteLockString, hasAlterTable, hasSelfReferentialForeignKeyBug, inlineLiteral, isJdbcLogWarningsEnabledByDefault, isLegacyLimitHandlerBehaviorEnabled, isLockTimeoutParameterized, isTypeNameRegistered, openQuote, prependComment, qualifyIndexName, quote, registerColumnType, registerColumnType, registerFunction, registerHibernateType, registerHibernateType, registerKeyword, registerResultSetOutParameter, registerResultSetOutParameter, remapSqlTypeDescriptor, renderOrderByElement, replaceResultVariableInOrderByClauseWithPosition, requiresParensForTupleDistinctCounts, supportsBindAsCallableArgument, supportsCascadeDelete, supportsCaseInsensitiveLike, supportsCircularCascadeDeleteConstraints, supportsExistsInSelect, supportsExpectedLobUsagePattern, supportsIfExistsAfterAlterTable, supportsIfExistsAfterConstraintName, supportsIfExistsBeforeConstraintName, supportsJdbcConnectionLobCreation, supportsLimitOffset, supportsNationalizedTypes, supportsNoColumnsInsert, supportsNonQueryWithCTE, supportsNotNullUnique, supportsNoWait, supportsOuterJoinForUpdate, supportsParametersInInsertSelect, supportsPartitionBy, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsRowValueConstructorSyntax, supportsRowValueConstructorSyntaxInInList, supportsSelectAliasInGroupByClause, supportsSkipLocked, supportsSubqueryOnMutatingTable, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTupleCounts, supportsTuplesInSubqueries, supportsUnboundedLobLocatorMaterialization, supportsUnique, supportsUniqueConstraintInCreateAlterTable, supportsValuesList, supportsVariableLimit, toString, transformSelectString, useFollowOnLocking, useFollowOnLocking, useInputStreamToInsertBlob, useMaxForLimit
-
-
-
-
方法详细资料
-
getAddColumnString
public String getAddColumnString()
从类复制的说明:DialectThe syntax used to add a column to a table (optional).- 覆盖:
getAddColumnString在类中Dialect- 返回:
- The "add column" fragment.
-
supportsLockTimeouts
public boolean supportsLockTimeouts()
从类复制的说明:DialectInformational metadata about whether this dialect is known to support specifying timeouts for requested lock acquisitions.- 覆盖:
supportsLockTimeouts在类中Dialect- 返回:
- True is this dialect supports specifying lock timeouts.
-
getForUpdateString
public String getForUpdateString()
从类复制的说明:DialectGet the string to append to SELECT statements to acquire locks for this dialect.- 覆盖:
getForUpdateString在类中Dialect- 返回:
- The appropriate FOR UPDATE clause string.
-
getLimitHandler
public LimitHandler getLimitHandler()
从类复制的说明:DialectReturns the delegate managing LIMIT clause.- 覆盖:
getLimitHandler在类中Dialect- 返回:
- LIMIT clause delegate.
-
supportsLimit
public boolean supportsLimit()
从类复制的说明:DialectDoes this dialect support some form of limiting query results via a SQL clause?- 覆盖:
supportsLimit在类中Dialect- 返回:
- True if this dialect supports some form of LIMIT.
-
getLimitString
public String getLimitString(String sql, boolean hasOffset)
从类复制的说明:DialectApply a limit clause to the query. Typically dialects utilizevariablelimit clauses when they support limits. Thus, when building the select command we do not actually need to know the limit or the offset 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 andDialect.getLimitString(String, int, int).- 覆盖:
getLimitString在类中Dialect- 参数:
sql- The query to which to apply the limit.hasOffset- Is the query requesting an offset?- 返回:
- the modified SQL
-
bindLimitParametersFirst
public boolean bindLimitParametersFirst()
从类复制的说明:DialectDoes the LIMIT clause come at the start of the SELECT statement, rather than at the end?- 覆盖:
bindLimitParametersFirst在类中Dialect- 返回:
- true if limit parameters should come before other parameters
-
supportsIfExistsAfterTableName
public boolean supportsIfExistsAfterTableName()
从类复制的说明:DialectFor dropping a table, can the phrase "if exists" be applied after the table name? NOTE : Only one or the other (or neither) of this andDialect.supportsIfExistsBeforeTableName()should return true- 覆盖:
supportsIfExistsAfterTableName在类中Dialect- 返回:
trueif the "if exists" can be applied after the table name
-
supportsIfExistsBeforeTableName
public boolean supportsIfExistsBeforeTableName()
从类复制的说明:DialectFor dropping a table, can the phrase "if exists" be applied before the table name? NOTE : Only one or the other (or neither) of this andDialect.supportsIfExistsAfterTableName()should return true- 覆盖:
supportsIfExistsBeforeTableName在类中Dialect- 返回:
trueif the "if exists" can be applied before the table name
-
supportsColumnCheck
public boolean supportsColumnCheck()
从类复制的说明:DialectDoes this dialect support column-level check constraints?- 覆盖:
supportsColumnCheck在类中Dialect- 返回:
- True if column-level CHECK constraints are supported; false otherwise.
-
supportsSequences
public boolean supportsSequences()
从类复制的说明:DialectDoes this dialect support sequences?- 覆盖:
supportsSequences在类中Dialect- 返回:
- True if sequences supported; false otherwise.
-
supportsPooledSequences
public boolean supportsPooledSequences()
从类复制的说明:DialectDoes this dialect support "pooled" sequences. Not aware of a better name for this. Essentially can we specify the initial and increment values?- 覆盖:
supportsPooledSequences在类中Dialect- 返回:
- True if such "pooled" sequences are supported; false otherwise.
- 另请参阅:
Dialect.getCreateSequenceStrings(String, int, int),Dialect.getCreateSequenceString(String, int, int)
-
getCreateSequenceString
protected String getCreateSequenceString(String sequenceName)
HSQL will start with 0, by default. In order for Hibernate to know that this not transient, manually start with 1.- 覆盖:
getCreateSequenceString在类中Dialect- 参数:
sequenceName- The name of the sequence- 返回:
- The sequence creation command
-
getCreateSequenceString
protected String getCreateSequenceString(String sequenceName, int initialValue, int incrementSize) throws MappingException
Because of the overriddengetCreateSequenceString(String), we must also overridegetCreateSequenceString(String, int, int)to prevent 2 instances of "start with".- 覆盖:
getCreateSequenceString在类中Dialect- 参数:
sequenceName- The name of the sequenceinitialValue- The initial value to apply to 'create sequence' statementincrementSize- The increment value to apply to 'create sequence' statement- 返回:
- The sequence creation command
- 抛出:
MappingException- If sequences are not supported.
-
getDropSequenceString
protected String getDropSequenceString(String sequenceName)
从类复制的说明:DialectTypically dialects which support sequences can drop a sequence with a single command. This is convenience form ofDialect.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 overrideDialect.getDropSequenceStrings(java.lang.String).- 覆盖:
getDropSequenceString在类中Dialect- 参数:
sequenceName- The name of the sequence- 返回:
- The sequence drop commands
-
getSelectSequenceNextValString
public String getSelectSequenceNextValString(String sequenceName)
从类复制的说明:DialectGenerate the select expression fragment that will retrieve the next value of a sequence as part of another (typically DML) statement. This differs fromDialect.getSequenceNextValString(String)in that this should return an expression usable within another statement.- 覆盖:
getSelectSequenceNextValString在类中Dialect- 参数:
sequenceName- the name of the sequence- 返回:
- The "nextval" fragment.
-
getSequenceNextValString
public String getSequenceNextValString(String sequenceName)
从类复制的说明:DialectGenerate the appropriate select statement to to retrieve the next value of a sequence. This should be a "stand alone" select statement.- 覆盖:
getSequenceNextValString在类中Dialect- 参数:
sequenceName- the name of the sequence- 返回:
- String The "nextval" select string.
-
getQuerySequencesString
public String getQuerySequencesString()
从类复制的说明:DialectGet the select command used retrieve the names of all sequences.- 覆盖:
getQuerySequencesString在类中Dialect- 返回:
- The select command; or null if sequences are not supported.
- 另请参阅:
SchemaUpdate
-
getSequenceInformationExtractor
public SequenceInformationExtractor getSequenceInformationExtractor()
-
getViolatedConstraintNameExtracter
public ViolatedConstraintNameExtracter getViolatedConstraintNameExtracter()
-
getSelectClauseNullString
public String getSelectClauseNullString(int sqlType)
从类复制的说明:DialectGiven aTypestype 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在类中Dialect- 参数:
sqlType- TheTypestype code.- 返回:
- The appropriate select clause value fragment.
-
supportsUnionAll
public boolean supportsUnionAll()
从类复制的说明:DialectDoes this dialect support UNION ALL, which is generally a faster variant of UNION?- 覆盖:
supportsUnionAll在类中Dialect- 返回:
- True if UNION ALL is supported; false otherwise.
-
getDefaultMultiTableBulkIdStrategy
public MultiTableBulkIdStrategy getDefaultMultiTableBulkIdStrategy()
-
supportsCurrentTimestampSelection
public boolean supportsCurrentTimestampSelection()
HSQLDB 1.8.x requires CALL CURRENT_TIMESTAMP but this should not be treated as a callable statement. It is equivalent to "select current_timestamp from dual" in some databases. HSQLDB 2.0 also supports VALUES CURRENT_TIMESTAMP Does this dialect support a way to retrieve the database's current timestamp value?- 覆盖:
supportsCurrentTimestampSelection在类中Dialect- 返回:
- True if the current timestamp can be retrieved; false otherwise.
-
isCurrentTimestampSelectStringCallable
public boolean isCurrentTimestampSelectStringCallable()
从类复制的说明:DialectShould the value returned byDialect.getCurrentTimestampSelectString()be treated as callable. Typically this indicates that JDBC escape syntax is being used...- 覆盖:
isCurrentTimestampSelectStringCallable在类中Dialect- 返回:
- True if the
Dialect.getCurrentTimestampSelectString()return is callable; false otherwise.
-
getCurrentTimestampSelectString
public String getCurrentTimestampSelectString()
从类复制的说明:DialectRetrieve the command used to retrieve the current timestamp from the database.- 覆盖:
getCurrentTimestampSelectString在类中Dialect- 返回:
- The command.
-
getCurrentTimestampSQLFunctionName
public String getCurrentTimestampSQLFunctionName()
从类复制的说明:DialectThe name of the database-specific SQL function for retrieving the current timestamp.- 覆盖:
getCurrentTimestampSQLFunctionName在类中Dialect- 返回:
- The function name.
-
getLockingStrategy
public LockingStrategy getLockingStrategy(Lockable lockable, LockMode lockMode)
For HSQLDB 2.0, this is a copy of the base class implementation. For HSQLDB 1.8, only READ_UNCOMMITTED is supported. Get a strategy instance which knows how to acquire a database-level lock of the specified mode for this dialect.- 覆盖:
getLockingStrategy在类中Dialect- 参数:
lockable- The persister for the entity to be locked.lockMode- The type of lock to be acquired.- 返回:
- The appropriate locking strategy.
-
supportsCommentOn
public boolean supportsCommentOn()
从类复制的说明:DialectDoes this dialect/database support commenting on tables, columns, etc?- 覆盖:
supportsCommentOn在类中Dialect- 返回:
trueif commenting is supported
-
supportsEmptyInList
public boolean supportsEmptyInList()
从类复制的说明:DialectDoes this dialect support empty IN lists? For example, is [where XYZ in ()] a supported construct?- 覆盖:
supportsEmptyInList在类中Dialect- 返回:
- True if empty in lists are supported; false otherwise.
-
requiresCastingOfParametersInSelectClause
public boolean requiresCastingOfParametersInSelectClause()
从类复制的说明:DialectDoes this dialect require that parameters appearing in the SELECT clause be wrapped in cast() calls to tell the db parser the expected type.- 覆盖:
requiresCastingOfParametersInSelectClause在类中Dialect- 返回:
- True if select clause parameter must be cast()ed
-
doesReadCommittedCauseWritersToBlockReaders
public boolean doesReadCommittedCauseWritersToBlockReaders()
从类复制的说明:DialectFor the underlying database, is READ_COMMITTED isolation implemented by forcing readers to wait for write locks to be released?- 覆盖:
doesReadCommittedCauseWritersToBlockReaders在类中Dialect- 返回:
- True if writers block readers to achieve READ_COMMITTED; false otherwise.
-
doesRepeatableReadCauseReadersToBlockWriters
public boolean doesRepeatableReadCauseReadersToBlockWriters()
从类复制的说明:DialectFor the underlying database, is REPEATABLE_READ isolation implemented by forcing writers to wait for read locks to be released?- 覆盖:
doesRepeatableReadCauseReadersToBlockWriters在类中Dialect- 返回:
- True if readers block writers to achieve REPEATABLE_READ; false otherwise.
-
supportsLobValueChangePropogation
public boolean supportsLobValueChangePropogation()
从类复制的说明: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().- 覆盖:
supportsLobValueChangePropogation在类中Dialect- 返回:
- True if the changes are propagated back to the database; false otherwise.
-
toBooleanValueString
public String toBooleanValueString(boolean bool)
从类复制的说明:DialectThe SQL literal value to which this database maps boolean values.- 覆盖:
toBooleanValueString在类中Dialect- 参数:
bool- The boolean value- 返回:
- The appropriate SQL literal.
-
supportsTupleDistinctCounts
public boolean supportsTupleDistinctCounts()
从类复制的说明:DialectDoes this dialect support `count(distinct a,b)`?- 覆盖:
supportsTupleDistinctCounts在类中Dialect- 返回:
- True if the database supports counting distinct tuples; false otherwise.
-
getIdentityColumnSupport
public IdentityColumnSupport getIdentityColumnSupport()
从类复制的说明:DialectGet the appropriateIdentityColumnSupport- 覆盖:
getIdentityColumnSupport在类中Dialect- 返回:
- the IdentityColumnSupport
-
getNameQualifierSupport
public NameQualifierSupport getNameQualifierSupport()
从类复制的说明:DialectBy default interpret this based on DatabaseMetaData.- 覆盖:
getNameQualifierSupport在类中Dialect- 返回:
- The NameQualifierSupport.
-
supportsNamedParameters
public boolean supportsNamedParameters(DatabaseMetaData databaseMetaData) throws SQLException
从类复制的说明:DialectOverride the DatabaseMetaData#supportsNamedParameters()- 覆盖:
supportsNamedParameters在类中Dialect- 返回:
- boolean
- 抛出:
SQLException- Accessing the DatabaseMetaData can throw it. Just re-throw and Hibernate will handle.
-
dropConstraints
public boolean dropConstraints()
从类复制的说明:DialectDo we need to drop constraints before dropping tables in this dialect?- 覆盖:
dropConstraints在类中Dialect- 返回:
- True if constraints must be dropped prior to dropping the table; false otherwise.
-
getCascadeConstraintsString
public String getCascadeConstraintsString()
从类复制的说明:DialectCompletely optional cascading drop clause- 覆盖:
getCascadeConstraintsString在类中Dialect- 返回:
- String
-
-