Package org.hibernate.dialect
Class AbstractHANADialect
- java.lang.Object
-
- org.hibernate.dialect.Dialect
-
- org.hibernate.dialect.AbstractHANADialect
-
- All Implemented Interfaces:
ConversionContext
- Direct Known Subclasses:
HANAColumnStoreDialect
,HANARowStoreDialect
public abstract class AbstractHANADialect extends Dialect
An abstract base class for SAP HANA dialects.For more information on interacting with the SAP HANA database, refer to the SAP HANA SQL and System Views Reference and the SAP HANA Client Interface Programming Reference.
Note: This dialect is configured to create foreign keys with
on update cascade
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AbstractHANADialect.HANABlobTypeDescriptor
-
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 AbstractHANADialect()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
bindLimitParametersInReverseOrder()
ANSI SQL defines the LIMIT clause to be in the form LIMIT offset, limit.IdentifierHelper
buildIdentifierHelper(IdentifierHelperBuilder builder, java.sql.DatabaseMetaData dbMetaData)
Build the IdentifierHelper indicated by this Dialect for handling identifier conversions.SQLExceptionConversionDelegate
buildSQLExceptionConversionDelegate()
Build an instance of aSQLExceptionConversionDelegate
for interpreting dialect-specific error or SQLState codes.void
contributeTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry)
Allows the Dialect to contribute additional typesScrollMode
defaultScrollMode()
Certain dialects support a subset of ScrollModes.boolean
dropConstraints()
Do we need to drop constraints before dropping tables in this dialect?boolean
forUpdateOfColumns()
Is FOR UPDATE OF syntax supported?java.lang.String
getAddColumnString()
The syntax used to add a column to a table (optional).java.lang.String
getAddColumnSuffixString()
The syntax for the suffix used to add a column to a table (optional).SqlTypeDescriptor
getBlobTypeDescriptor()
CallableStatementSupport
getCallableStatementSupport()
java.lang.String
getCascadeConstraintsString()
Completely optional cascading drop clausejava.lang.String
getColumnComment(java.lang.String comment)
Get the comment into a form supported for column definition.java.lang.String
getCreateSequenceString(java.lang.String sequenceName)
Typically dialects which support sequences can create a sequence with a single command.protected java.lang.String
getCreateSequenceString(java.lang.String sequenceName, int initialValue, int incrementSize)
Overloaded form ofDialect.getCreateSequenceString(String)
, additionally taking the initial value and increment size to be applied to the sequence definition.java.lang.String
getCurrentSchemaCommand()
Get the SQL command used to retrieve the current schema name.java.lang.String
getCurrentTimestampSelectString()
Retrieve the command used to retrieve the current timestamp from the database.java.lang.String
getDropSequenceString(java.lang.String sequenceName)
Typically dialects which support sequences can drop a sequence with a single command.java.lang.String
getForUpdateNowaitString()
Retrieves the FOR UPDATE NOWAIT syntax specific to this dialect.java.lang.String
getForUpdateNowaitString(java.lang.String aliases)
Get the FOR UPDATE OF column_list NOWAIT fragment appropriate for this dialect given the aliases of the columns to be write locked.java.lang.String
getForUpdateString(java.lang.String aliases)
Get the FOR UPDATE OF column_list fragment appropriate for this dialect given the aliases of the columns to be write locked.java.lang.String
getForUpdateString(java.lang.String aliases, LockOptions lockOptions)
Get the FOR UPDATE OF column_list fragment appropriate for this dialect given the aliases of the columns to be write locked.IdentityColumnSupport
getIdentityColumnSupport()
Get the appropriateIdentityColumnSupport
LimitHandler
getLimitHandler()
Returns the delegate managing LIMIT clause.java.lang.String
getLimitString(java.lang.String sql, boolean hasOffset)
Apply s limit clause to the query.int
getMaxAliasLength()
What is the maximum length Hibernate can use for generated aliases?NameQualifierSupport
getNameQualifierSupport()
By default interpret this based on DatabaseMetaData.java.lang.String
getNotExpression(java.lang.String expression)
Negate an expressionjava.lang.String
getQueryHintString(java.lang.String query, java.util.List<java.lang.String> hints)
Apply a hint to the query.java.lang.String
getQuerySequencesString()
Get the select command used retrieve the names of all sequences.java.lang.String
getReadLockString(int timeout)
Get the string to append to SELECT statements to acquire READ locks for this dialect.java.lang.String
getReadLockString(java.lang.String aliases, int timeout)
Get the string to append to SELECT statements to acquire READ locks for this dialect given the aliases of the columns to be read locked.java.lang.String
getSelectGUIDString()
Get the command used to select a GUID from the underlying database.java.lang.String
getSelectSequenceNextValString(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.String
getSequenceNextValString(java.lang.String sequenceName)
Generate the appropriate select statement to to retrieve the next value of a sequence.protected SqlTypeDescriptor
getSqlTypeDescriptorOverride(int sqlCode)
Returns theSqlTypeDescriptor
that should be used to handle the given JDBC type code.java.lang.String
getTableComment(java.lang.String comment)
Get the comment into a form supported for table definition.Exporter<Table>
getTableExporter()
java.lang.String
getWriteLockString(int timeout)
Get the string to append to SELECT statements to acquire WRITE locks for this dialect.java.lang.String
getWriteLockString(java.lang.String aliases, int timeout)
Get the string to append to SELECT statements to acquire WRITE locks for this dialect given the aliases of the columns to be write locked.boolean
isCurrentTimestampSelectStringCallable()
Should the value returned byDialect.getCurrentTimestampSelectString()
be treated as callable.protected void
registerHanaKeywords()
int
registerResultSetOutParameter(java.sql.CallableStatement statement, int position)
Registers a parameter (either OUT, or the new REF_CURSOR param type available in Java 8) capable of returningResultSet
*by position*.int
registerResultSetOutParameter(java.sql.CallableStatement statement, java.lang.String name)
Registers a parameter (either OUT, or the new REF_CURSOR param type available in Java 8) capable of returningResultSet
*by name*.boolean
supportsColumnCheck()
HANA currently does not support check constraints.boolean
supportsCommentOn()
Does this dialect/database support commenting on tables, columns, etc?boolean
supportsCurrentTimestampSelection()
Does this dialect support a way to retrieve the database's current timestamp value?boolean
supportsEmptyInList()
Does this dialect support empty IN lists?boolean
supportsExistsInSelect()
Does the dialect support an exists statement in the select clause?boolean
supportsExpectedLobUsagePattern()
Expected LOB usage pattern is such that I can perform an insert via prepared statement with a parameter binding for a LOB value without crazy casting to JDBC driver implementation-specific classes...boolean
supportsLimit()
Does this dialect support some form of limiting query results via a SQL clause?boolean
supportsNoWait()
Does this dialect/database support NO_WAIT timeout.boolean
supportsPartitionBy()
Does the underlying database support partition byboolean
supportsPooledSequences()
Does this dialect support "pooled" sequences.boolean
supportsRowValueConstructorSyntax()
Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax; sometimes called tuple syntax.boolean
supportsRowValueConstructorSyntaxInInList()
If the dialect supportsrow values
, does it offer such support in IN lists as well?boolean
supportsSequences()
Does this dialect support sequences?boolean
supportsTableCheck()
Does this dialect support table-level check constraints?boolean
supportsTupleDistinctCounts()
Does this dialect support `count(distinct a,b)`?boolean
supportsUnboundedLobLocatorMaterialization()
Is it supported to materialize a LOB locator outside the transaction in which it was created?boolean
supportsUnionAll()
Does this dialect support UNION ALL, which is generally a faster variant of UNION?java.lang.String
toBooleanValueString(boolean bool)
The SQL literal value to which this database maps boolean values.-
Methods inherited from class org.hibernate.dialect.Dialect
addSqlHintOrComment, appendLockHint, appendLockHint, applyLocksToSql, areStringComparisonsCaseInsensitive, augmentRecognizedTableTypes, bindLimitParametersFirst, buildSQLExceptionConverter, canCreateCatalog, canCreateSchema, cast, cast, cast, closeQuote, convertToFirstRowValue, createCaseFragment, createOuterJoinFragment, doesReadCommittedCauseWritersToBlockReaders, doesRepeatableReadCauseReadersToBlockWriters, escapeComment, escapeLiteral, forceLimitUsage, forceLobAsLastValue, getAddForeignKeyConstraintString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAddUniqueConstraintString, getAlterTableString, getAuxiliaryDatabaseObjectExporter, getCaseInsensitiveLike, getCastTypeName, getColumnAliasExtractor, getCreateCatalogCommand, getCreateMultisetTableString, getCreateSchemaCommand, getCreateSequenceStrings, getCreateSequenceStrings, getCreateTableString, getCrossJoinSeparator, getCurrentTimestampSQLFunctionName, getDefaultBatchLoadSizingStrategy, getDefaultMultiTableBulkIdStrategy, getDefaultProperties, getDialect, getDialect, getDropCatalogCommand, getDropForeignKeyString, getDropSchemaCommand, getDropSequenceStrings, getDropTableString, getForeignKeyExporter, getForUpdateSkipLockedString, getForUpdateSkipLockedString, getForUpdateString, getForUpdateString, getForUpdateString, getFunctions, getHibernateTypeName, getHibernateTypeName, getIndexExporter, getInExpressionCountLimit, getKeywords, getLimitString, getLobMergeStrategy, getLockingStrategy, getLowercaseFunction, getNativeIdentifierGeneratorClass, getNativeIdentifierGeneratorStrategy, getNoColumnsInsertString, getNullColumnString, getQueryHintString, getResultSet, getResultSet, getResultSet, getSchemaNameResolver, getSelectClauseNullString, getSequenceExporter, getSequenceInformationExtractor, getTableTypeString, getTypeName, getTypeName, getUniqueDelegate, getUniqueKeyExporter, getViolatedConstraintNameExtracter, hasAlterTable, hasSelfReferentialForeignKeyBug, inlineLiteral, isJdbcLogWarningsEnabledByDefault, isLegacyLimitHandlerBehaviorEnabled, isLockTimeoutParameterized, isTypeNameRegistered, openQuote, prependComment, qualifyIndexName, quote, registerColumnType, registerColumnType, registerFunction, registerHibernateType, registerHibernateType, registerKeyword, remapSqlTypeDescriptor, renderOrderByElement, replaceResultVariableInOrderByClauseWithPosition, requiresCastingOfParametersInSelectClause, requiresParensForTupleDistinctCounts, supportsBindAsCallableArgument, supportsCascadeDelete, supportsCaseInsensitiveLike, supportsCircularCascadeDeleteConstraints, supportsIfExistsAfterAlterTable, supportsIfExistsAfterConstraintName, supportsIfExistsAfterTableName, supportsIfExistsBeforeConstraintName, supportsIfExistsBeforeTableName, supportsLimitOffset, supportsLobValueChangePropogation, supportsLockTimeouts, supportsNamedParameters, supportsNationalizedTypes, supportsNonQueryWithCTE, supportsNotNullUnique, supportsOuterJoinForUpdate, supportsParametersInInsertSelect, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsSkipLocked, supportsSubqueryOnMutatingTable, supportsSubselectAsInPredicateLHS, supportsTupleCounts, supportsTuplesInSubqueries, supportsUnique, supportsUniqueConstraintInCreateAlterTable, supportsValuesList, supportsVariableLimit, toString, transformSelectString, useFollowOnLocking, useFollowOnLocking, useInputStreamToInsertBlob, useMaxForLimit
-
-
-
-
Method Detail
-
bindLimitParametersInReverseOrder
public boolean bindLimitParametersInReverseOrder()
Description copied from class:Dialect
ANSI SQL defines the LIMIT clause to be in the form LIMIT offset, limit. Does this dialect require us to bind the parameters in reverse order?- Overrides:
bindLimitParametersInReverseOrder
in classDialect
- Returns:
- true if the correct order is limit, offset
-
buildSQLExceptionConversionDelegate
public SQLExceptionConversionDelegate buildSQLExceptionConversionDelegate()
Description copied from class:Dialect
Build an instance of aSQLExceptionConversionDelegate
for interpreting dialect-specific error or SQLState codes. WhenDialect.buildSQLExceptionConverter()
returns null, the defaultSQLExceptionConverter
is used to interpret SQLState and error codes. If this method is overridden to return a non-null value, the defaultSQLExceptionConverter
will use the returnedSQLExceptionConversionDelegate
in addition to the following standard delegates:- a "static" delegate based on the JDBC 4 defined SQLException hierarchy;
- a delegate that interprets SQLState codes for either X/Open or SQL-2003 codes, depending on java.sql.DatabaseMetaData#getSQLStateType
- Overrides:
buildSQLExceptionConversionDelegate
in classDialect
- Returns:
- The SQLExceptionConversionDelegate for this dialect
-
forUpdateOfColumns
public boolean forUpdateOfColumns()
Description copied from class:Dialect
Is FOR UPDATE OF syntax supported?- Overrides:
forUpdateOfColumns
in classDialect
- Returns:
- True if the database supports FOR UPDATE OF syntax; false otherwise.
-
getAddColumnString
public java.lang.String getAddColumnString()
Description copied from class:Dialect
The syntax used to add a column to a table (optional).- Overrides:
getAddColumnString
in classDialect
- Returns:
- The "add column" fragment.
-
getAddColumnSuffixString
public java.lang.String getAddColumnSuffixString()
Description copied from class:Dialect
The syntax for the suffix used to add a column to a table (optional).- Overrides:
getAddColumnSuffixString
in classDialect
- Returns:
- The suffix "add column" fragment.
-
getCascadeConstraintsString
public java.lang.String getCascadeConstraintsString()
Description copied from class:Dialect
Completely optional cascading drop clause- Overrides:
getCascadeConstraintsString
in classDialect
- Returns:
- String
-
getCreateSequenceString
public java.lang.String getCreateSequenceString(java.lang.String sequenceName)
Description copied from class:Dialect
Typically 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:
getCreateSequenceString
in classDialect
- Parameters:
sequenceName
- The name of the sequence- Returns:
- The sequence creation command
-
getCreateSequenceString
protected java.lang.String getCreateSequenceString(java.lang.String sequenceName, int initialValue, int incrementSize) throws MappingException
Description copied from class:Dialect
Overloaded form ofDialect.getCreateSequenceString(String)
, additionally taking the initial value and increment size to be applied to the sequence definition. The default definition is to suffixDialect.getCreateSequenceString(String)
with the string: " start with {initialValue} increment by {incrementSize}" where {initialValue} and {incrementSize} are replacement placeholders. Generally dialects should only need to override this method if different key phrases are used to apply the allocation information.- Overrides:
getCreateSequenceString
in classDialect
- Parameters:
sequenceName
- The name of the sequenceinitialValue
- The initial value to apply to 'create sequence' statementincrementSize
- The increment value to apply to 'create sequence' statement- Returns:
- The sequence creation command
- Throws:
MappingException
- If sequences are not supported.
-
getCurrentTimestampSelectString
public java.lang.String getCurrentTimestampSelectString()
Description copied from class:Dialect
Retrieve the command used to retrieve the current timestamp from the database.- Overrides:
getCurrentTimestampSelectString
in classDialect
- Returns:
- The command.
-
getDropSequenceString
public java.lang.String getDropSequenceString(java.lang.String sequenceName)
Description copied from class:Dialect
Typically 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:
getDropSequenceString
in classDialect
- Parameters:
sequenceName
- The name of the sequence- Returns:
- The sequence drop commands
-
getForUpdateString
public java.lang.String getForUpdateString(java.lang.String aliases)
Description copied from class:Dialect
Get the FOR UPDATE OF column_list fragment appropriate for this dialect given the aliases of the columns to be write locked.- Overrides:
getForUpdateString
in classDialect
- Parameters:
aliases
- The columns to be write locked.- Returns:
- The appropriate FOR UPDATE OF column_list clause string.
-
getForUpdateString
public java.lang.String getForUpdateString(java.lang.String aliases, LockOptions lockOptions)
Description copied from class:Dialect
Get the FOR UPDATE OF column_list fragment appropriate for this dialect given the aliases of the columns to be write locked.- Overrides:
getForUpdateString
in classDialect
- Parameters:
aliases
- The columns to be write locked.lockOptions
- the lock options to apply- Returns:
- The appropriate FOR UPDATE OF column_list clause string.
-
getForUpdateNowaitString
public java.lang.String getForUpdateNowaitString()
Description copied from class:Dialect
Retrieves the FOR UPDATE NOWAIT syntax specific to this dialect.- Overrides:
getForUpdateNowaitString
in classDialect
- Returns:
- The appropriate FOR UPDATE NOWAIT clause string.
-
getLimitString
public java.lang.String getLimitString(java.lang.String sql, boolean hasOffset)
Description copied from class:Dialect
Apply s limit clause to the query. Typically dialects utilizevariable
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 andDialect.getLimitString(String, int, int)
.- Overrides:
getLimitString
in classDialect
- Parameters:
sql
- The query to which to apply the limit.hasOffset
- Is the query requesting an offset?- Returns:
- the modified SQL
-
getNotExpression
public java.lang.String getNotExpression(java.lang.String expression)
Description copied from class:Dialect
Negate an expression- Overrides:
getNotExpression
in classDialect
- Parameters:
expression
- The expression to negate- Returns:
- The negated expression
-
getQuerySequencesString
public java.lang.String getQuerySequencesString()
Description copied from class:Dialect
Get the select command used retrieve the names of all sequences.- Overrides:
getQuerySequencesString
in classDialect
- Returns:
- The select command; or null if sequences are not supported.
- See Also:
SchemaUpdate
-
getSelectSequenceNextValString
public java.lang.String getSelectSequenceNextValString(java.lang.String sequenceName)
Description copied from class:Dialect
Generate 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:
getSelectSequenceNextValString
in 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:Dialect
Generate the appropriate select statement to to retrieve the next value of a sequence. This should be a "stand alone" select statement.- Overrides:
getSequenceNextValString
in classDialect
- Parameters:
sequenceName
- the name of the sequence- Returns:
- String The "nextval" select string.
-
getSqlTypeDescriptorOverride
protected SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode)
Description copied from class:Dialect
Returns theSqlTypeDescriptor
that should be used to handle the given JDBC type code. Returnsnull
if there is no override.- Overrides:
getSqlTypeDescriptorOverride
in classDialect
- Parameters:
sqlCode
- ATypes
constant indicating the SQL column type- Returns:
- The
SqlTypeDescriptor
to use as an override, ornull
if there is no override.
-
isCurrentTimestampSelectStringCallable
public boolean isCurrentTimestampSelectStringCallable()
Description copied from class:Dialect
Should the value returned byDialect.getCurrentTimestampSelectString()
be treated as callable. Typically this indicates that JDBC escape syntax is being used...- Overrides:
isCurrentTimestampSelectStringCallable
in classDialect
- Returns:
- True if the
Dialect.getCurrentTimestampSelectString()
return is callable; false otherwise.
-
registerHanaKeywords
protected void registerHanaKeywords()
-
defaultScrollMode
public ScrollMode defaultScrollMode()
Description copied from class:Dialect
Certain dialects support a subset of ScrollModes. Provide a default to be used by Criteria and Query.- Overrides:
defaultScrollMode
in classDialect
- Returns:
- ScrollMode
-
supportsColumnCheck
public boolean supportsColumnCheck()
HANA currently does not support check constraints.- Overrides:
supportsColumnCheck
in classDialect
- Returns:
- True if column-level CHECK constraints are supported; false otherwise.
-
supportsCurrentTimestampSelection
public boolean supportsCurrentTimestampSelection()
Description copied from class:Dialect
Does this dialect support a way to retrieve the database's current timestamp value?- Overrides:
supportsCurrentTimestampSelection
in classDialect
- Returns:
- True if the current timestamp can be retrieved; false otherwise.
-
supportsEmptyInList
public boolean supportsEmptyInList()
Description copied from class:Dialect
Does this dialect support empty IN lists? For example, is [where XYZ in ()] a supported construct?- Overrides:
supportsEmptyInList
in classDialect
- Returns:
- True if empty in lists are supported; false otherwise.
-
supportsExistsInSelect
public boolean supportsExistsInSelect()
Description copied from class:Dialect
Does the dialect support an exists statement in the select clause?- Overrides:
supportsExistsInSelect
in classDialect
- Returns:
- True if exists checks are allowed in the select clause; false otherwise.
-
supportsExpectedLobUsagePattern
public boolean supportsExpectedLobUsagePattern()
Description copied from class:Dialect
Expected LOB usage pattern is such that I can perform an insert via prepared statement with a parameter binding for a LOB value without crazy casting to JDBC driver implementation-specific classes... Part of the trickiness here is the fact that this is largely driver dependent. For example, Oracle (which is notoriously bad with LOB support in their drivers historically) actually does a pretty good job with LOB support as of the 10.2.x versions of their drivers...- Overrides:
supportsExpectedLobUsagePattern
in classDialect
- Returns:
- True if normal LOB usage patterns can be used with this driver; false if driver-specific hookiness needs to be applied.
-
supportsUnboundedLobLocatorMaterialization
public boolean supportsUnboundedLobLocatorMaterialization()
Description copied from class:Dialect
Is it supported to materialize a LOB locator outside the transaction in which it was created? Again, part of the trickiness here is the fact that this is largely driver dependent. NOTE: all database I have tested whichDialect.supportsExpectedLobUsagePattern()
also support the ability to materialize a LOB outside the owning transaction...- Overrides:
supportsUnboundedLobLocatorMaterialization
in classDialect
- Returns:
- True if unbounded materialization is supported; false otherwise.
-
supportsLimit
public boolean supportsLimit()
Description copied from class:Dialect
Does this dialect support some form of limiting query results via a SQL clause?- Overrides:
supportsLimit
in classDialect
- Returns:
- True if this dialect supports some form of LIMIT.
-
supportsPooledSequences
public boolean supportsPooledSequences()
Description copied from class:Dialect
Does this dialect support "pooled" sequences. Not aware of a better name for this. Essentially can we specify the initial and increment values?- Overrides:
supportsPooledSequences
in classDialect
- Returns:
- True if such "pooled" sequences are supported; false otherwise.
- See Also:
Dialect.getCreateSequenceStrings(String, int, int)
,Dialect.getCreateSequenceString(String, int, int)
-
supportsSequences
public boolean supportsSequences()
Description copied from class:Dialect
Does this dialect support sequences?- Overrides:
supportsSequences
in classDialect
- Returns:
- True if sequences supported; false otherwise.
-
supportsTableCheck
public boolean supportsTableCheck()
Description copied from class:Dialect
Does this dialect support table-level check constraints?- Overrides:
supportsTableCheck
in classDialect
- Returns:
- True if table-level CHECK constraints are supported; false otherwise.
-
supportsTupleDistinctCounts
public boolean supportsTupleDistinctCounts()
Description copied from class:Dialect
Does this dialect support `count(distinct a,b)`?- Overrides:
supportsTupleDistinctCounts
in classDialect
- Returns:
- True if the database supports counting distinct tuples; false otherwise.
-
supportsUnionAll
public boolean supportsUnionAll()
Description copied from class:Dialect
Does this dialect support UNION ALL, which is generally a faster variant of UNION?- Overrides:
supportsUnionAll
in classDialect
- Returns:
- True if UNION ALL is supported; false otherwise.
-
dropConstraints
public boolean dropConstraints()
Description copied from class:Dialect
Do we need to drop constraints before dropping tables in this dialect?- Overrides:
dropConstraints
in classDialect
- Returns:
- True if constraints must be dropped prior to dropping the table; false otherwise.
-
supportsRowValueConstructorSyntax
public boolean supportsRowValueConstructorSyntax()
Description copied from class:Dialect
Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax; sometimes called tuple syntax. Basically, does it support syntax like "... where (FIRST_NAME, LAST_NAME) = ('Steve', 'Ebersole') ...".- Overrides:
supportsRowValueConstructorSyntax
in classDialect
- Returns:
- True if this SQL dialect is known to support "row value constructor" syntax; false otherwise.
-
supportsRowValueConstructorSyntaxInInList
public boolean supportsRowValueConstructorSyntaxInInList()
Description copied from class:Dialect
If the dialect supportsrow values
, does it offer such support in IN lists as well? For example, "... where (FIRST_NAME, LAST_NAME) IN ( (?, ?), (?, ?) ) ..."- Overrides:
supportsRowValueConstructorSyntaxInInList
in classDialect
- Returns:
- True if this SQL dialect is known to support "row value constructor" syntax in the IN list; false otherwise.
-
getMaxAliasLength
public int getMaxAliasLength()
Description copied from class:Dialect
What is the maximum length Hibernate can use for generated aliases? The maximum here should account for the fact that Hibernate often needs to append "uniqueing" information to the end of generated aliases. That "uniqueing" information will be added to the end of a identifier generated to the length specified here; so be sure to leave some room (generally speaking 5 positions will suffice).- Overrides:
getMaxAliasLength
in classDialect
- Returns:
- The maximum length.
-
getLimitHandler
public LimitHandler getLimitHandler()
Description copied from class:Dialect
Returns the delegate managing LIMIT clause.- Overrides:
getLimitHandler
in classDialect
- Returns:
- LIMIT clause delegate.
-
getSelectGUIDString
public java.lang.String getSelectGUIDString()
Description copied from class:Dialect
Get the command used to select a GUID from the underlying database. Optional operation.- Overrides:
getSelectGUIDString
in classDialect
- Returns:
- The appropriate command.
-
getNameQualifierSupport
public NameQualifierSupport getNameQualifierSupport()
Description copied from class:Dialect
By default interpret this based on DatabaseMetaData.- Overrides:
getNameQualifierSupport
in classDialect
- Returns:
-
buildIdentifierHelper
public IdentifierHelper buildIdentifierHelper(IdentifierHelperBuilder builder, java.sql.DatabaseMetaData dbMetaData) throws java.sql.SQLException
Description copied from class:Dialect
Build the IdentifierHelper indicated by this Dialect for handling identifier conversions. Returningnull
is allowed and indicates that Hibernate should fallback to building a "standard" helper. In the fallback path, any changes made to the IdentifierHelperBuilder during this call will still be incorporated into the built IdentifierHelper. The incoming builder will have the following set:IdentifierHelperBuilder.isGloballyQuoteIdentifiers()
IdentifierHelperBuilder.getUnquotedCaseStrategy()
- initialized to UPPERIdentifierHelperBuilder.getQuotedCaseStrategy()
- initialized to MIXED
- Call
IdentifierHelperBuilder.applyIdentifierCasing(DatabaseMetaData)
- Call
IdentifierHelperBuilder.applyReservedWords(DatabaseMetaData)
- Applies
AnsiSqlKeywords.sql2003()
as reserved words - Applies the {#link #sqlKeywords} collected here as reserved words
- Applies the Dialect's NameQualifierSupport, if it defines one
- Overrides:
buildIdentifierHelper
in classDialect
- Parameters:
builder
- A semi-configured IdentifierHelper builder.dbMetaData
- Access to the metadata returned from the driver if needed and if available. WARNING: may benull
- Returns:
- The IdentifierHelper instance to use, or
null
to indicate Hibernate should use its fallback path - Throws:
java.sql.SQLException
- Accessing the DatabaseMetaData can throw it. Just re-throw and Hibernate will handle.- See Also:
Dialect.getNameQualifierSupport()
-
getCurrentSchemaCommand
public java.lang.String getCurrentSchemaCommand()
Description copied from class:Dialect
Get 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- Overrides:
getCurrentSchemaCommand
in classDialect
- Returns:
- The current schema retrieval SQL
-
getForUpdateNowaitString
public java.lang.String getForUpdateNowaitString(java.lang.String aliases)
Description copied from class:Dialect
Get the FOR UPDATE OF column_list NOWAIT fragment appropriate for this dialect given the aliases of the columns to be write locked.- Overrides:
getForUpdateNowaitString
in classDialect
- Parameters:
aliases
- The columns to be write locked.- Returns:
- The appropriate FOR UPDATE OF colunm_list NOWAIT clause string.
-
getReadLockString
public java.lang.String getReadLockString(int timeout)
Description copied from class:Dialect
Get the string to append to SELECT statements to acquire READ locks for this dialect. Location of the of the returned string is treated the same as getForUpdateString.- Overrides:
getReadLockString
in classDialect
- Parameters:
timeout
- in milliseconds, -1 for indefinite wait and 0 for no wait.- Returns:
- The appropriate LOCK clause string.
-
getReadLockString
public java.lang.String getReadLockString(java.lang.String aliases, int timeout)
Description copied from class:Dialect
Get the string to append to SELECT statements to acquire READ locks for this dialect given the aliases of the columns to be read locked. Location of the of the returned string is treated the same as getForUpdateString.- Overrides:
getReadLockString
in classDialect
- Parameters:
aliases
- The columns to be read locked.timeout
- in milliseconds, -1 for indefinite wait and 0 for no wait.- Returns:
- The appropriate LOCK clause string.
-
getWriteLockString
public java.lang.String getWriteLockString(int timeout)
Description copied from class:Dialect
Get the string to append to SELECT statements to acquire WRITE locks for this dialect. Location of the of the returned string is treated the same as getForUpdateString.- Overrides:
getWriteLockString
in classDialect
- Parameters:
timeout
- in milliseconds, -1 for indefinite wait and 0 for no wait.- Returns:
- The appropriate LOCK clause string.
-
getWriteLockString
public java.lang.String getWriteLockString(java.lang.String aliases, int timeout)
Description copied from class:Dialect
Get the string to append to SELECT statements to acquire WRITE locks for this dialect given the aliases of the columns to be write locked. Location of the of the returned string is treated the same as getForUpdateString.- Overrides:
getWriteLockString
in classDialect
- Parameters:
aliases
- The columns to be read locked.timeout
- in milliseconds, -1 for indefinite wait and 0 for no wait.- Returns:
- The appropriate LOCK clause string.
-
getQueryHintString
public java.lang.String getQueryHintString(java.lang.String query, java.util.List<java.lang.String> hints)
Description copied from class:Dialect
Apply 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:
getQueryHintString
in classDialect
- Parameters:
query
- The query to which to apply the hint.hints
- The hints to apply- Returns:
- The modified SQL
-
getTableComment
public java.lang.String getTableComment(java.lang.String comment)
Description copied from class:Dialect
Get the comment into a form supported for table definition.- Overrides:
getTableComment
in classDialect
- Parameters:
comment
- The comment to apply- Returns:
- The comment fragment
-
getColumnComment
public java.lang.String getColumnComment(java.lang.String comment)
Description copied from class:Dialect
Get the comment into a form supported for column definition.- Overrides:
getColumnComment
in classDialect
- Parameters:
comment
- The comment to apply- Returns:
- The comment fragment
-
supportsCommentOn
public boolean supportsCommentOn()
Description copied from class:Dialect
Does this dialect/database support commenting on tables, columns, etc?- Overrides:
supportsCommentOn
in classDialect
- Returns:
true
if commenting is supported
-
supportsPartitionBy
public boolean supportsPartitionBy()
Description copied from class:Dialect
Does the underlying database support partition by- Overrides:
supportsPartitionBy
in classDialect
- Returns:
- boolean
-
contributeTypes
public void contributeTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry)
Description copied from class:Dialect
Allows the Dialect to contribute additional types- Overrides:
contributeTypes
in classDialect
- Parameters:
typeContributions
- Callback to contribute the typesserviceRegistry
- The service registry
-
getBlobTypeDescriptor
public SqlTypeDescriptor getBlobTypeDescriptor()
-
toBooleanValueString
public java.lang.String toBooleanValueString(boolean bool)
Description copied from class:Dialect
The SQL literal value to which this database maps boolean values.- Overrides:
toBooleanValueString
in classDialect
- Parameters:
bool
- The boolean value- Returns:
- The appropriate SQL literal.
-
getIdentityColumnSupport
public IdentityColumnSupport getIdentityColumnSupport()
Description copied from class:Dialect
Get the appropriateIdentityColumnSupport
- Overrides:
getIdentityColumnSupport
in classDialect
- Returns:
- the IdentityColumnSupport
-
getTableExporter
public Exporter<Table> getTableExporter()
- Overrides:
getTableExporter
in classDialect
-
getCallableStatementSupport
public CallableStatementSupport getCallableStatementSupport()
- Overrides:
getCallableStatementSupport
in classDialect
-
registerResultSetOutParameter
public int registerResultSetOutParameter(java.sql.CallableStatement statement, int position) throws java.sql.SQLException
Description copied from class:Dialect
Registers 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:
registerResultSetOutParameter
in classDialect
- Parameters:
statement
- The callable statement.position
- 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.
-
registerResultSetOutParameter
public int registerResultSetOutParameter(java.sql.CallableStatement statement, java.lang.String name) throws java.sql.SQLException
Description copied from class:Dialect
Registers a parameter (either OUT, or the new REF_CURSOR param type available in Java 8) capable of returningResultSet
*by name*. Pre-Java 8, registering such ResultSet-returning parameters varied greatly across database and drivers; hence its inclusion as part of the Dialect contract.- Overrides:
registerResultSetOutParameter
in classDialect
- Parameters:
statement
- The callable statement.name
- The parameter name (for drivers which support named parameters).- Returns:
- The number of (contiguous) bind positions used.
- Throws:
java.sql.SQLException
- Indicates problems registering the param.
-
supportsNoWait
public boolean supportsNoWait()
Description copied from class:Dialect
Does this dialect/database support NO_WAIT timeout.- Overrides:
supportsNoWait
in classDialect
- Returns:
true
if NO_WAIT is supported
-
-