类 SQLServerDialect
- java.lang.Object
-
- org.hibernate.dialect.Dialect
-
- org.hibernate.dialect.SQLServerDialect
-
- 所有已实现的接口:
ConversionContext
- 直接已知子类:
SQLServer2005Dialect
public class SQLServerDialect extends Dialect
A dialect for Microsoft SQL Server 2000- 作者:
- Gavin King
-
-
构造器概要
构造器 构造器 说明 SQLServerDialect()Constructs a SQLServerDialect
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 StringappendLockHint(LockOptions lockOptions, String tableName)Some dialects support an alternative means to SELECT FOR UPDATE, whereby a "lock hint" is appended to the table name in the from clause.StringapplyLocksToSql(String sql, LockOptions aliasedLockOptions, Map<String,String[]> keyColumnNames)Modifies the given SQL by applying the appropriate updates for the specified lock modes and key columns.booleanareStringComparisonsCaseInsensitive()Are string comparisons implicitly case insensitive.charcloseQuote()The character specific to this dialect used to close a quoted identifier.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?StringgetAddColumnString()The syntax used to add a column to a table (optional).StringgetCurrentSchemaCommand()Get the SQL command used to retrieve the current schema name.StringgetCurrentTimestampSelectString()The current_timestamp is more accurate, but only known to be supported in SQL Server 7.0 and later and Sybase not known to support it at allprotected LimitHandlergetDefaultLimitHandler()MultiTableBulkIdStrategygetDefaultMultiTableBulkIdStrategy()StringgetForUpdateString()Get the string to append to SELECT statements to acquire locks for this dialect.IdentityColumnSupportgetIdentityColumnSupport()Get the appropriateIdentityColumnSupportintgetInExpressionCountLimit()Return the limit that the underlying database places on the number of elements in anINpredicate.LimitHandlergetLimitHandler()Returns the delegate managing LIMIT clause.StringgetLimitString(String querySelect, int offset, int limit)Given a limit and an offset, apply the limit clause to the query.StringgetNoColumnsInsertString()The fragment used to insert a row without specifying any column values.StringgetNullColumnString()The keyword used to specify a nullable column.ResultSetgetResultSet(CallableStatement ps)Given a callable statement previously processed byDialect.registerResultSetOutParameter(java.sql.CallableStatement, int), extract theResultSetfrom the OUT parameter.StringgetSelectGUIDString()Get the command used to select a GUID from the underlying database.protected SqlTypeDescriptorgetSqlTypeDescriptorOverride(int sqlCode)Returns theSqlTypeDescriptorthat should be used to handle the given JDBC type code.booleanisCurrentTimestampSelectStringCallable()Should the value returned byDialect.getCurrentTimestampSelectString()be treated as callable.charopenQuote()The character specific to this dialect used to begin a quoted identifier.booleanqualifyIndexName()Do we need to qualify index names with the schema name?intregisterResultSetOutParameter(CallableStatement statement, int col)Registers a parameter (either OUT, or the new REF_CURSOR param type available in Java 8) capable of returningResultSet*by position*.booleansupportsCircularCascadeDeleteConstraints()Does this dialect support definition of cascade delete constraints which can cause circular chains?booleansupportsCurrentTimestampSelection()Does this dialect support a way to retrieve the database's current timestamp value?booleansupportsEmptyInList()Does this dialect support empty IN lists?booleansupportsExistsInSelect()Does the dialect support an exists statement in the select clause?booleansupportsLimit()Does this dialect support some form of limiting query results via a SQL clause?booleansupportsLimitOffset()Does this dialect's LIMIT support (if any) additionally support specifying an offset?booleansupportsLobValueChangePropogation()Does the dialect support propagating changes to LOB values back to the database?booleansupportsPartitionBy()Does the underlying database support partition bybooleansupportsResultSetPositionQueryMethodsOnForwardOnlyCursor()Does this dialect support asking the result set its positioning information on forward only cursors.booleansupportsTupleDistinctCounts()Does this dialect support `count(distinct a,b)`?booleansupportsTuplesInSubqueries()Does this dialect support tuples in subqueries?booleansupportsUnionAll()Does this dialect support UNION ALL, which is generally a faster variant of UNION?booleansupportsVariableLimit()Does this dialect support bind variables (i.e., prepared statement parameters) for its limit/offset?booleanuseMaxForLimit()Does the LIMIT clause take a "maximum" row number instead of a total number of returned rows?-
从类继承的方法 org.hibernate.dialect.Dialect
addSqlHintOrComment, appendLockHint, augmentRecognizedTableTypes, bindLimitParametersFirst, bindLimitParametersInReverseOrder, buildIdentifierHelper, buildSQLExceptionConversionDelegate, buildSQLExceptionConverter, canCreateCatalog, canCreateSchema, cast, cast, cast, contributeTypes, convertToFirstRowValue, createCaseFragment, createOuterJoinFragment, defaultScrollMode, dropConstraints, escapeLiteral, forceLimitUsage, forceLobAsLastValue, forUpdateOfColumns, getAddColumnSuffixString, getAddForeignKeyConstraintString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAddUniqueConstraintString, getAlterTableString, getAuxiliaryDatabaseObjectExporter, getCallableStatementSupport, getCascadeConstraintsString, getCaseInsensitiveLike, getCastTypeName, getColumnAliasExtractor, getColumnComment, getCreateCatalogCommand, getCreateMultisetTableString, getCreateSchemaCommand, getCreateSequenceString, getCreateSequenceString, getCreateSequenceStrings, getCreateSequenceStrings, getCreateTableString, getCrossJoinSeparator, getCurrentTimestampSQLFunctionName, getDefaultBatchLoadSizingStrategy, getDefaultProperties, getDialect, getDialect, getDropCatalogCommand, getDropForeignKeyString, getDropSchemaCommand, getDropSequenceString, getDropSequenceStrings, getDropTableString, getForeignKeyExporter, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateSkipLockedString, getForUpdateSkipLockedString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getFunctions, getHibernateTypeName, getHibernateTypeName, getIndexExporter, getKeywords, getLimitString, getLobMergeStrategy, getLockingStrategy, getLowercaseFunction, getMaxAliasLength, getNameQualifierSupport, getNativeIdentifierGeneratorClass, getNativeIdentifierGeneratorStrategy, getNotExpression, getQueryHintString, getQueryHintString, getQuerySequencesString, getReadLockString, getReadLockString, getResultSet, getResultSet, getSchemaNameResolver, getSelectClauseNullString, getSelectSequenceNextValString, getSequenceExporter, getSequenceInformationExtractor, getSequenceNextValString, getTableComment, getTableExporter, getTableTypeString, getTypeName, getTypeName, getUniqueDelegate, getUniqueKeyExporter, getViolatedConstraintNameExtracter, getWriteLockString, getWriteLockString, hasAlterTable, hasSelfReferentialForeignKeyBug, inlineLiteral, isJdbcLogWarningsEnabledByDefault, isLegacyLimitHandlerBehaviorEnabled, isLockTimeoutParameterized, isTypeNameRegistered, prependComment, quote, registerColumnType, registerColumnType, registerFunction, registerHibernateType, registerHibernateType, registerKeyword, registerResultSetOutParameter, remapSqlTypeDescriptor, renderOrderByElement, replaceResultVariableInOrderByClauseWithPosition, requiresCastingOfParametersInSelectClause, requiresParensForTupleDistinctCounts, supportsBindAsCallableArgument, supportsCascadeDelete, supportsCaseInsensitiveLike, supportsColumnCheck, supportsCommentOn, supportsExpectedLobUsagePattern, supportsIfExistsAfterAlterTable, supportsIfExistsAfterConstraintName, supportsIfExistsAfterTableName, supportsIfExistsBeforeConstraintName, supportsIfExistsBeforeTableName, supportsJdbcConnectionLobCreation, supportsLockTimeouts, supportsNamedParameters, supportsNationalizedTypes, supportsNoColumnsInsert, supportsNonQueryWithCTE, supportsNotNullUnique, supportsNoWait, supportsOuterJoinForUpdate, supportsParametersInInsertSelect, supportsPooledSequences, supportsRowValueConstructorSyntax, supportsRowValueConstructorSyntaxInInList, supportsSelectAliasInGroupByClause, supportsSequences, supportsSkipLocked, supportsSubqueryOnMutatingTable, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTupleCounts, supportsUnboundedLobLocatorMaterialization, supportsUnique, supportsUniqueConstraintInCreateAlterTable, supportsValuesList, toBooleanValueString, toString, transformSelectString, useFollowOnLocking, useFollowOnLocking, useInputStreamToInsertBlob
-
-
-
-
方法详细资料
-
getNoColumnsInsertString
public String getNoColumnsInsertString()
从类复制的说明:DialectThe fragment used to insert a row without specifying any column values. This is not possible on some databases.- 覆盖:
getNoColumnsInsertString在类中Dialect- 返回:
- The appropriate empty values clause.
-
getLimitString
public String getLimitString(String querySelect, int offset, int limit)
从类复制的说明:DialectGiven a limit and an offset, apply the limit clause to the query.- 覆盖:
getLimitString在类中Dialect- 参数:
querySelect- The query to which to apply the limit.offset- The offset of the limitlimit- The limit of the limit ;)- 返回:
- The modified query statement with the limit applied.
-
getLimitHandler
public LimitHandler getLimitHandler()
从类复制的说明:DialectReturns the delegate managing LIMIT clause.- 覆盖:
getLimitHandler在类中Dialect- 返回:
- LIMIT clause delegate.
-
getDefaultLimitHandler
protected LimitHandler getDefaultLimitHandler()
-
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.
-
useMaxForLimit
public boolean useMaxForLimit()
从类复制的说明:DialectDoes the LIMIT clause take a "maximum" row number instead of a total number of returned rows? This is easiest understood via an example. Consider you have a table with 20 rows, but you only want to retrieve rows number 11 through 20. Generally, a limit with offset would say that the offset = 11 and the limit = 10 (we only want 10 rows at a time); this is specifying the total number of returned rows. Some dialects require that we instead specify offset = 11 and limit = 20, where 20 is the "last" row we want relative to offset (i.e. total number of rows = 20 - 11 = 9) So essentially, is limit relative from offset? Or is limit absolute?- 覆盖:
useMaxForLimit在类中Dialect- 返回:
- True if limit is relative from offset; false otherwise.
-
supportsLimitOffset
public boolean supportsLimitOffset()
从类复制的说明:DialectDoes this dialect's LIMIT support (if any) additionally support specifying an offset?- 覆盖:
supportsLimitOffset在类中Dialect- 返回:
- True if the dialect supports an offset within the limit support.
-
supportsVariableLimit
public boolean supportsVariableLimit()
从类复制的说明:DialectDoes this dialect support bind variables (i.e., prepared statement parameters) for its limit/offset?- 覆盖:
supportsVariableLimit在类中Dialect- 返回:
- True if bind variables can be used; false otherwise.
-
closeQuote
public char closeQuote()
从类复制的说明:DialectThe character specific to this dialect used to close a quoted identifier.- 覆盖:
closeQuote在类中Dialect- 返回:
- The dialect's specific close quote character.
-
getCurrentSchemaCommand
public String getCurrentSchemaCommand()
从类复制的说明:DialectGet the SQL command used to retrieve the current schema name. Works in conjunction withDialect.getSchemaNameResolver(), unless the return from there does not need this information. E.g., a custom impl might make use of the Java 1.7 addition of theConnection.getSchema()method- 覆盖:
getCurrentSchemaCommand在类中Dialect- 返回:
- The current schema retrieval SQL
-
openQuote
public char openQuote()
从类复制的说明:DialectThe character specific to this dialect used to begin a quoted identifier.
-
appendLockHint
public String appendLockHint(LockOptions lockOptions, String tableName)
从类复制的说明:DialectSome dialects support an alternative means to SELECT FOR UPDATE, whereby a "lock hint" is appended to the table name in the from clause. contributed by Helge Schulz- 参数:
lockOptions- The lock options to applytableName- The name of the table to which to apply the lock hint.- 返回:
- The table with any required lock hints.
-
getCurrentTimestampSelectString
public String getCurrentTimestampSelectString()
The current_timestamp is more accurate, but only known to be supported in SQL Server 7.0 and later and Sybase not known to support it at all Retrieve the command used to retrieve the current timestamp from the database.- 返回:
- The command.
-
areStringComparisonsCaseInsensitive
public boolean areStringComparisonsCaseInsensitive()
从类复制的说明:DialectAre string comparisons implicitly case insensitive. In other words, does [where 'XYZ' = 'xyz'] resolve to true?- 覆盖:
areStringComparisonsCaseInsensitive在类中Dialect- 返回:
- True if comparisons are case insensitive.
-
supportsResultSetPositionQueryMethodsOnForwardOnlyCursor
public boolean supportsResultSetPositionQueryMethodsOnForwardOnlyCursor()
从类复制的说明:DialectDoes this dialect support asking the result set its positioning information on forward only cursors. Specifically, in the case of scrolling fetches, Hibernate needs to useResultSet.isAfterLast()andResultSet.isBeforeFirst(). Certain drivers do not allow access to these methods for forward only cursors. NOTE : this is highly driver dependent!- 覆盖:
supportsResultSetPositionQueryMethodsOnForwardOnlyCursor在类中Dialect- 返回:
- True if methods like
ResultSet.isAfterLast()andResultSet.isBeforeFirst()are supported for forward only cursors; false otherwise.
-
supportsCircularCascadeDeleteConstraints
public boolean supportsCircularCascadeDeleteConstraints()
从类复制的说明:DialectDoes this dialect support definition of cascade delete constraints which can cause circular chains?- 覆盖:
supportsCircularCascadeDeleteConstraints在类中Dialect- 返回:
- True if circular cascade delete constraints are supported; 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.
-
doesReadCommittedCauseWritersToBlockReaders
public boolean doesReadCommittedCauseWritersToBlockReaders()
从类复制的说明:DialectFor the underlying database, is READ_COMMITTED isolation implemented by forcing readers to wait for write locks to be released?- 返回:
- 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?- 返回:
- True if readers block writers to achieve REPEATABLE_READ; false otherwise.
-
getSqlTypeDescriptorOverride
protected SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode)
从类复制的说明:DialectReturns theSqlTypeDescriptorthat should be used to handle the given JDBC type code. Returnsnullif there is no override.- 覆盖:
getSqlTypeDescriptorOverride在类中Dialect- 参数:
sqlCode- ATypesconstant indicating the SQL column type- 返回:
- The
SqlTypeDescriptorto use as an override, ornullif there is no override.
-
getInExpressionCountLimit
public int getInExpressionCountLimit()
从类复制的说明:DialectReturn the limit that the underlying database places on the number of elements in anINpredicate. If the database defines no such limits, simply return zero or less-than-zero.- 覆盖:
getInExpressionCountLimit在类中Dialect- 返回:
- int The limit, or zero-or-less to indicate no limit.
-
getIdentityColumnSupport
public IdentityColumnSupport getIdentityColumnSupport()
从类复制的说明:DialectGet the appropriateIdentityColumnSupport- 返回:
- the IdentityColumnSupport
-
getAddColumnString
public String getAddColumnString()
从类复制的说明:DialectThe syntax used to add a column to a table (optional).- 覆盖:
getAddColumnString在类中Dialect- 返回:
- The "add column" fragment.
-
getNullColumnString
public String getNullColumnString()
从类复制的说明:DialectThe keyword used to specify a nullable column.- 覆盖:
getNullColumnString在类中Dialect- 返回:
- String
-
qualifyIndexName
public boolean qualifyIndexName()
从类复制的说明:DialectDo we need to qualify index names with the schema name?- 覆盖:
qualifyIndexName在类中Dialect- 返回:
- boolean
-
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.
-
applyLocksToSql
public String applyLocksToSql(String sql, LockOptions aliasedLockOptions, Map<String,String[]> keyColumnNames)
从类复制的说明:DialectModifies the given SQL by applying the appropriate updates for the specified lock modes and key columns. The behavior here is that of an ANSI SQL SELECT FOR UPDATE. This method is really intended to allow dialects which do not support SELECT FOR UPDATE to achieve this in their own fashion.- 覆盖:
applyLocksToSql在类中Dialect- 参数:
sql- the SQL string to modifyaliasedLockOptions- lock options indexed by aliased table names.keyColumnNames- a map of key columns indexed by aliased table names.- 返回:
- the modified SQL string.
-
registerResultSetOutParameter
public int registerResultSetOutParameter(CallableStatement statement, int col) throws SQLException
从类复制的说明:DialectRegisters a parameter (either OUT, or the new REF_CURSOR param type available in Java 8) capable of returningResultSet*by position*. Pre-Java 8, registering such ResultSet-returning parameters varied greatly across database and drivers; hence its inclusion as part of the Dialect contract.- 覆盖:
registerResultSetOutParameter在类中Dialect- 参数:
statement- The callable statement.col- The bind position at which to register the output param.- 返回:
- The number of (contiguous) bind positions used.
- 抛出:
SQLException- Indicates problems registering the param.
-
getResultSet
public ResultSet getResultSet(CallableStatement ps) throws SQLException
从类复制的说明:DialectGiven a callable statement previously processed byDialect.registerResultSetOutParameter(java.sql.CallableStatement, int), extract theResultSetfrom the OUT parameter.- 覆盖:
getResultSet在类中Dialect- 参数:
ps- The callable statement.- 返回:
- The extracted result set.
- 抛出:
SQLException- Indicates problems extracting the result set.
-
supportsCurrentTimestampSelection
public boolean supportsCurrentTimestampSelection()
从类复制的说明:DialectDoes 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.
-
getDefaultMultiTableBulkIdStrategy
public MultiTableBulkIdStrategy getDefaultMultiTableBulkIdStrategy()
-
getSelectGUIDString
public String getSelectGUIDString()
从类复制的说明:DialectGet the command used to select a GUID from the underlying database. Optional operation.- 覆盖:
getSelectGUIDString在类中Dialect- 返回:
- The appropriate command.
-
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.
-
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.
-
supportsExistsInSelect
public boolean supportsExistsInSelect()
从类复制的说明:DialectDoes the dialect support an exists statement in the select clause?- 覆盖:
supportsExistsInSelect在类中Dialect- 返回:
- True if exists checks are allowed in the select clause; false otherwise.
-
supportsTupleDistinctCounts
public boolean supportsTupleDistinctCounts()
从类复制的说明:DialectDoes this dialect support `count(distinct a,b)`?- 覆盖:
supportsTupleDistinctCounts在类中Dialect- 返回:
- True if the database supports counting distinct tuples; false otherwise.
-
supportsTuplesInSubqueries
public boolean supportsTuplesInSubqueries()
从类复制的说明:DialectDoes this dialect support tuples in subqueries? Ex: delete from Table1 where (col1, col2) in (select col1, col2 from Table2)- 覆盖:
supportsTuplesInSubqueries在类中Dialect- 返回:
- boolean
-
supportsPartitionBy
public boolean supportsPartitionBy()
从类复制的说明:DialectDoes the underlying database support partition by- 覆盖:
supportsPartitionBy在类中Dialect- 返回:
- boolean
-
-