Package org.hibernate.dialect
Class SQLServer2012Dialect
- java.lang.Object
-
- org.hibernate.dialect.Dialect
-
- org.hibernate.dialect.SQLServerDialect
-
- org.hibernate.dialect.SQLServer2005Dialect
-
- org.hibernate.dialect.SQLServer2008Dialect
-
- org.hibernate.dialect.SQLServer2012Dialect
-
- All Implemented Interfaces:
ConversionContext
public class SQLServer2012Dialect extends SQLServer2008Dialect
Microsoft SQL Server 2012 Dialect
-
-
Field Summary
-
Fields inherited from class org.hibernate.dialect.Dialect
CLOSED_QUOTE, DEFAULT_BATCH_SIZE, LEGACY_LOB_MERGE_STRATEGY, NEW_LOCATOR_LOB_MERGE_STRATEGY, NO_BATCH, QUOTE, STANDARD_DEFAULT_BATCH_LOAD_SIZING_STRATEGY, STREAM_XFER_LOB_MERGE_STRATEGY
-
-
Constructor Summary
Constructors Constructor Description SQLServer2012Dialect()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringapplyLocksToSql(java.lang.String sql, LockOptions aliasedLockOptions, java.util.Map<java.lang.String,java.lang.String[]> keyColumnNames)Modifies the given SQL by applying the appropriate updates for the specified lock modes and key columns.java.lang.StringgetAddColumnString()The syntax used to add a column to a table (optional).java.lang.StringgetCreateSequenceString(java.lang.String sequenceName)Typically dialects which support sequences can create a sequence with a single command.protected LimitHandlergetDefaultLimitHandler()MultiTableBulkIdStrategygetDefaultMultiTableBulkIdStrategy()java.lang.StringgetDropSequenceString(java.lang.String sequenceName)Typically dialects which support sequences can drop a sequence with a single command.java.lang.StringgetForUpdateString()Get the string to append to SELECT statements to acquire locks for this dialect.java.lang.StringgetNullColumnString()The keyword used to specify a nullable column.java.lang.StringgetQueryHintString(java.lang.String sql, java.lang.String hints)Apply a hint to the query.java.lang.StringgetQuerySequencesString()Get the select command used retrieve the names of all sequences.java.sql.ResultSetgetResultSet(java.sql.CallableStatement ps)Given a callable statement previously processed byDialect.registerResultSetOutParameter(java.sql.CallableStatement, int), extract theResultSetfrom the OUT parameter.java.lang.StringgetSelectGUIDString()Get the command used to select a GUID from the underlying database.java.lang.StringgetSelectSequenceNextValString(java.lang.String sequenceName)Generate the select expression fragment that will retrieve the next value of a sequence as part of another (typically DML) statement.java.lang.StringgetSequenceNextValString(java.lang.String sequenceName)Generate the appropriate select statement to to retrieve the next value of a sequence.booleanisCurrentTimestampSelectStringCallable()Should the value returned byDialect.getCurrentTimestampSelectString()be treated as callable.booleanqualifyIndexName()Do we need to qualify index names with the schema name?intregisterResultSetOutParameter(java.sql.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*.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?booleansupportsLimitOffset()Does this dialect's LIMIT support (if any) additionally support specifying an offset?booleansupportsPartitionBy()Does the underlying database support partition bybooleansupportsPooledSequences()Does this dialect support "pooled" sequences.booleansupportsSequences()Does this dialect support sequences?booleansupportsTupleDistinctCounts()Does this dialect support `count(distinct a,b)`?booleansupportsTuplesInSubqueries()Does this dialect support tuples in subqueries? Ex: delete from Table1 where (col1, col2) in (select col1, col2 from Table2)booleansupportsUnionAll()Does this dialect support UNION ALL, which is generally a faster variant of UNION?-
Methods inherited from class org.hibernate.dialect.SQLServer2008Dialect
renderOrderByElement, supportsValuesList
-
Methods inherited from class org.hibernate.dialect.SQLServer2005Dialect
appendLockHint, buildSQLExceptionConversionDelegate, supportsNonQueryWithCTE, supportsNoWait, supportsSkipLocked
-
Methods inherited from class org.hibernate.dialect.SQLServerDialect
areStringComparisonsCaseInsensitive, closeQuote, doesReadCommittedCauseWritersToBlockReaders, doesRepeatableReadCauseReadersToBlockWriters, getCurrentSchemaCommand, getCurrentTimestampSelectString, getIdentityColumnSupport, getInExpressionCountLimit, getLimitHandler, getLimitString, getNoColumnsInsertString, getSqlTypeDescriptorOverride, openQuote, supportsCircularCascadeDeleteConstraints, supportsLimit, supportsLobValueChangePropogation, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsVariableLimit, useMaxForLimit
-
Methods inherited from class org.hibernate.dialect.Dialect
addSqlHintOrComment, appendLockHint, augmentRecognizedTableTypes, bindLimitParametersFirst, bindLimitParametersInReverseOrder, buildIdentifierHelper, buildSQLExceptionConverter, canCreateCatalog, canCreateSchema, cast, cast, cast, contributeTypes, convertToFirstRowValue, createCaseFragment, createOuterJoinFragment, defaultScrollMode, dropConstraints, escapeComment, escapeLiteral, forceLimitUsage, forceLobAsLastValue, forUpdateOfColumns, getAddColumnSuffixString, getAddForeignKeyConstraintString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAddUniqueConstraintString, getAlterTableString, getAuxiliaryDatabaseObjectExporter, getCallableStatementSupport, getCascadeConstraintsString, getCaseInsensitiveLike, getCastTypeName, getColumnAliasExtractor, getColumnComment, getCreateCatalogCommand, getCreateMultisetTableString, getCreateSchemaCommand, getCreateSequenceString, getCreateSequenceStrings, getCreateSequenceStrings, getCreateTableString, getCrossJoinSeparator, getCurrentTimestampSQLFunctionName, getDefaultBatchLoadSizingStrategy, getDefaultProperties, getDialect, getDialect, getDropCatalogCommand, getDropForeignKeyString, getDropSchemaCommand, 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, getReadLockString, getReadLockString, getResultSet, getResultSet, getSchemaNameResolver, getSelectClauseNullString, getSequenceExporter, getSequenceInformationExtractor, 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, replaceResultVariableInOrderByClauseWithPosition, requiresCastingOfParametersInSelectClause, requiresParensForTupleDistinctCounts, supportsBindAsCallableArgument, supportsCascadeDelete, supportsCaseInsensitiveLike, supportsColumnCheck, supportsCommentOn, supportsExpectedLobUsagePattern, supportsIfExistsAfterAlterTable, supportsIfExistsAfterConstraintName, supportsIfExistsAfterTableName, supportsIfExistsBeforeConstraintName, supportsIfExistsBeforeTableName, supportsLockTimeouts, supportsNamedParameters, supportsNationalizedTypes, supportsNotNullUnique, supportsOuterJoinForUpdate, supportsParametersInInsertSelect, supportsRowValueConstructorSyntax, supportsRowValueConstructorSyntaxInInList, supportsSubqueryOnMutatingTable, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTupleCounts, supportsUnboundedLobLocatorMaterialization, supportsUnique, supportsUniqueConstraintInCreateAlterTable, toBooleanValueString, toString, transformSelectString, useFollowOnLocking, useFollowOnLocking, useInputStreamToInsertBlob
-
-
-
-
Method Detail
-
supportsSequences
public boolean supportsSequences()
Description copied from class:DialectDoes this dialect support sequences?- Overrides:
supportsSequencesin classDialect- Returns:
- True if sequences supported; false otherwise.
-
supportsPooledSequences
public boolean supportsPooledSequences()
Description copied from class:DialectDoes this dialect support "pooled" sequences. Not aware of a better name for this. Essentially can we specify the initial and increment values?- Overrides:
supportsPooledSequencesin classDialect- Returns:
- True if such "pooled" sequences are supported; false otherwise.
- See Also:
Dialect.getCreateSequenceStrings(String, int, int),Dialect.getCreateSequenceString(String, int, int)
-
getCreateSequenceString
public java.lang.String getCreateSequenceString(java.lang.String sequenceName)
Description copied from class:DialectTypically dialects which support sequences can create a sequence with a single command. This is convenience form ofDialect.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 overrideDialect.getCreateSequenceStrings(java.lang.String).- Overrides:
getCreateSequenceStringin classDialect- Parameters:
sequenceName- The name of the sequence- Returns:
- The sequence creation command
-
getDropSequenceString
public java.lang.String getDropSequenceString(java.lang.String sequenceName)
Description copied from class: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).- Overrides:
getDropSequenceStringin classDialect- Parameters:
sequenceName- The name of the sequence- Returns:
- The sequence drop commands
-
getSelectSequenceNextValString
public java.lang.String getSelectSequenceNextValString(java.lang.String sequenceName)
Description copied from class: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.- Overrides:
getSelectSequenceNextValStringin classDialect- Parameters:
sequenceName- the name of the sequence- Returns:
- The "nextval" fragment.
-
getSequenceNextValString
public java.lang.String getSequenceNextValString(java.lang.String sequenceName)
Description copied from class:DialectGenerate the appropriate select statement to to retrieve the next value of a sequence. This should be a "stand alone" select statement.- Overrides:
getSequenceNextValStringin classDialect- Parameters:
sequenceName- the name of the sequence- Returns:
- String The "nextval" select string.
-
getQuerySequencesString
public java.lang.String getQuerySequencesString()
Description copied from class:DialectGet the select command used retrieve the names of all sequences.- Overrides:
getQuerySequencesStringin classDialect- Returns:
- The select command; or null if sequences are not supported.
- See Also:
SchemaUpdate
-
getQueryHintString
public java.lang.String getQueryHintString(java.lang.String sql, java.lang.String hints)Description copied from class:DialectApply a hint to the query. The entire query is provided, allowing the Dialect full control over the placement and syntax of the hint. By default, ignore the hint and simply return the query.- Overrides:
getQueryHintStringin classDialect- Parameters:
sql- The query to which to apply the hint.hints- The hints to apply- Returns:
- The modified SQL
-
supportsLimitOffset
public boolean supportsLimitOffset()
Description copied from class:DialectDoes this dialect's LIMIT support (if any) additionally support specifying an offset?- Overrides:
supportsLimitOffsetin classSQLServerDialect- Returns:
- True if the dialect supports an offset within the limit support.
-
getDefaultLimitHandler
protected LimitHandler getDefaultLimitHandler()
- Overrides:
getDefaultLimitHandlerin classSQLServer2005Dialect
-
getAddColumnString
public java.lang.String getAddColumnString()
Description copied from class:DialectThe syntax used to add a column to a table (optional).- Overrides:
getAddColumnStringin classDialect- Returns:
- The "add column" fragment.
-
getNullColumnString
public java.lang.String getNullColumnString()
Description copied from class:DialectThe keyword used to specify a nullable column.- Overrides:
getNullColumnStringin classDialect- Returns:
- String
-
qualifyIndexName
public boolean qualifyIndexName()
Description copied from class:DialectDo we need to qualify index names with the schema name?- Overrides:
qualifyIndexNamein classDialect- Returns:
- boolean
-
getForUpdateString
public java.lang.String getForUpdateString()
Description copied from class:DialectGet the string to append to SELECT statements to acquire locks for this dialect.- Overrides:
getForUpdateStringin classDialect- Returns:
- The appropriate FOR UPDATE clause string.
-
applyLocksToSql
public java.lang.String applyLocksToSql(java.lang.String sql, LockOptions aliasedLockOptions, java.util.Map<java.lang.String,java.lang.String[]> keyColumnNames)Description copied from class: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.- Overrides:
applyLocksToSqlin classDialect- Parameters:
sql- the SQL string to modifyaliasedLockOptions- lock options indexed by aliased table names.keyColumnNames- a map of key columns indexed by aliased table names.- Returns:
- the modified SQL string.
-
registerResultSetOutParameter
public int registerResultSetOutParameter(java.sql.CallableStatement statement, int col) throws java.sql.SQLExceptionDescription copied from class: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.- Overrides:
registerResultSetOutParameterin classDialect- Parameters:
statement- The callable statement.col- The bind position at which to register the output param.- Returns:
- The number of (contiguous) bind positions used.
- Throws:
java.sql.SQLException- Indicates problems registering the param.
-
getResultSet
public java.sql.ResultSet getResultSet(java.sql.CallableStatement ps) throws java.sql.SQLExceptionDescription copied from class:DialectGiven a callable statement previously processed byDialect.registerResultSetOutParameter(java.sql.CallableStatement, int), extract theResultSetfrom the OUT parameter.- Overrides:
getResultSetin classDialect- Parameters:
ps- The callable statement.- Returns:
- The extracted result set.
- Throws:
java.sql.SQLException- Indicates problems extracting the result set.
-
supportsCurrentTimestampSelection
public boolean supportsCurrentTimestampSelection()
Description copied from class:DialectDoes this dialect support a way to retrieve the database's current timestamp value?- Overrides:
supportsCurrentTimestampSelectionin classDialect- Returns:
- True if the current timestamp can be retrieved; false otherwise.
-
isCurrentTimestampSelectStringCallable
public boolean isCurrentTimestampSelectStringCallable()
Description copied from class:DialectShould the value returned byDialect.getCurrentTimestampSelectString()be treated as callable. Typically this indicates that JDBC escape syntax is being used...- Overrides:
isCurrentTimestampSelectStringCallablein classDialect- Returns:
- True if the
Dialect.getCurrentTimestampSelectString()return is callable; false otherwise.
-
getDefaultMultiTableBulkIdStrategy
public MultiTableBulkIdStrategy getDefaultMultiTableBulkIdStrategy()
- Overrides:
getDefaultMultiTableBulkIdStrategyin classDialect
-
getSelectGUIDString
public java.lang.String getSelectGUIDString()
Description copied from class:DialectGet the command used to select a GUID from the underlying database. Optional operation.- Overrides:
getSelectGUIDStringin classDialect- Returns:
- The appropriate command.
-
supportsEmptyInList
public boolean supportsEmptyInList()
Description copied from class:DialectDoes this dialect support empty IN lists? For example, is [where XYZ in ()] a supported construct?- Overrides:
supportsEmptyInListin classDialect- Returns:
- True if empty in lists are supported; false otherwise.
-
supportsUnionAll
public boolean supportsUnionAll()
Description copied from class:DialectDoes this dialect support UNION ALL, which is generally a faster variant of UNION?- Overrides:
supportsUnionAllin classDialect- Returns:
- True if UNION ALL is supported; false otherwise.
-
supportsExistsInSelect
public boolean supportsExistsInSelect()
Description copied from class:DialectDoes the dialect support an exists statement in the select clause?- Overrides:
supportsExistsInSelectin classDialect- Returns:
- True if exists checks are allowed in the select clause; false otherwise.
-
supportsTupleDistinctCounts
public boolean supportsTupleDistinctCounts()
Description copied from class:DialectDoes this dialect support `count(distinct a,b)`?- Overrides:
supportsTupleDistinctCountsin classDialect- Returns:
- True if the database supports counting distinct tuples; false otherwise.
-
supportsTuplesInSubqueries
public boolean supportsTuplesInSubqueries()
Description copied from class:DialectDoes this dialect support tuples in subqueries? Ex: delete from Table1 where (col1, col2) in (select col1, col2 from Table2)- Overrides:
supportsTuplesInSubqueriesin classDialect- Returns:
- boolean
-
supportsPartitionBy
public boolean supportsPartitionBy()
Description copied from class:DialectDoes the underlying database support partition by- Overrides:
supportsPartitionByin classDialect- Returns:
- boolean
-
-