public abstract class AbstractHANADialect extends Dialect
An abstract base class for HANA dialects. <br/> <a href="http://help.sap.com/hana/html/sqlmain.html">SAP HANA Reference</a> <br/> NOTE: This dialect is currently configured to create foreign keys with <code>on update cascade</code>.
Modifier and Type | Class and Description |
---|---|
static class |
AbstractHANADialect.HANABlobTypeDescriptor |
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 and Description |
---|
AbstractHANADialect() |
Modifier and Type | Method and Description |
---|---|
boolean |
bindLimitParametersInReverseOrder()
ANSI SQL defines the LIMIT clause to be in the form LIMIT offset, limit.
|
IdentifierHelper |
buildIdentifierHelper(IdentifierHelperBuilder builder,
DatabaseMetaData dbMetaData)
Build the IdentifierHelper indicated by this Dialect for handling identifier conversions.
|
SQLExceptionConversionDelegate |
buildSQLExceptionConversionDelegate()
Build an instance of a
SQLExceptionConversionDelegate for
interpreting dialect-specific error or SQLState codes. |
void |
contributeTypes(TypeContributions typeContributions,
ServiceRegistry serviceRegistry)
Allows the Dialect to contribute additional types
|
ScrollMode |
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 <tt>FOR UPDATE OF</tt> syntax supported?
|
String |
getAddColumnString()
The syntax used to add a column to a table (optional).
|
String |
getAddColumnSuffixString()
The syntax for the suffix used to add a column to a table (optional).
|
SqlTypeDescriptor |
getBlobTypeDescriptor() |
CallableStatementSupport |
getCallableStatementSupport() |
String |
getCascadeConstraintsString()
Completely optional cascading drop clause
|
String |
getColumnComment(String comment)
Get the comment into a form supported for column definition.
|
String |
getCreateSequenceString(String sequenceName)
Typically dialects which support sequences can create a sequence
with a single command.
|
protected String |
getCreateSequenceString(String sequenceName,
int initialValue,
int incrementSize)
Overloaded form of
Dialect.getCreateSequenceString(String) , additionally
taking the initial value and increment size to be applied to the sequence
definition. |
String |
getCurrentSchemaCommand()
Get the SQL command used to retrieve the current schema name.
|
String |
getCurrentTimestampSelectString()
Retrieve the command used to retrieve the current timestamp from the
database.
|
String |
getDropSequenceString(String sequenceName)
Typically dialects which support sequences can drop a sequence
with a single command.
|
String |
getForUpdateNowaitString()
Retrieves the <tt>FOR UPDATE NOWAIT</tt> syntax specific to this dialect.
|
String |
getForUpdateNowaitString(String aliases)
Get the <tt>FOR UPDATE OF column_list NOWAIT</tt> fragment appropriate
for this dialect given the aliases of the columns to be write locked.
|
String |
getForUpdateString(String aliases)
Get the <tt>FOR UPDATE OF column_list</tt> fragment appropriate for this
dialect given the aliases of the columns to be write locked.
|
String |
getForUpdateString(String aliases,
LockOptions lockOptions)
Get the <tt>FOR UPDATE OF column_list</tt> fragment appropriate for this
dialect given the aliases of the columns to be write locked.
|
IdentityColumnSupport |
getIdentityColumnSupport()
Get the appropriate
IdentityColumnSupport |
LimitHandler |
getLimitHandler()
Returns the delegate managing LIMIT clause.
|
String |
getLimitString(String sql,
boolean hasOffset)
Apply s limit clause to the query.
|
int |
getMaxAliasLength()
What is the maximum length Hibernate can use for generated aliases?
<p/>
The maximum here should account for the fact that Hibernate often needs to append "uniqueing" information
to the end of generated aliases.
|
NameQualifierSupport |
getNameQualifierSupport()
By default interpret this based on DatabaseMetaData.
|
String |
getNotExpression(String expression)
Negate an expression
|
String |
getQueryHintString(String query,
List<String> hints)
Apply a hint to the query.
|
String |
getQuerySequencesString()
Get the select command used retrieve the names of all sequences.
|
String |
getReadLockString(int timeout)
Get the string to append to SELECT statements to acquire READ locks
for this dialect.
|
String |
getReadLockString(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.
|
String |
getSelectGUIDString()
Get the command used to select a GUID from the underlying database.
|
String |
getSelectSequenceNextValString(String sequenceName)
Generate the select expression fragment that will retrieve the next
value of a sequence as part of another (typically DML) statement.
|
String |
getSequenceNextValString(String sequenceName)
Generate the appropriate select statement to to retrieve the next value
of a sequence.
|
protected SqlTypeDescriptor |
getSqlTypeDescriptorOverride(int sqlCode)
Returns the
SqlTypeDescriptor that should be used to handle the given JDBC type code. |
String |
getTableComment(String comment)
Get the comment into a form supported for table definition.
|
Exporter<Table> |
getTableExporter() |
String |
getWriteLockString(int timeout)
Get the string to append to SELECT statements to acquire WRITE locks
for this dialect.
|
String |
getWriteLockString(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 by
Dialect.getCurrentTimestampSelectString()
be treated as callable. |
protected void |
registerHanaKeywords() |
int |
registerResultSetOutParameter(CallableStatement statement,
int position)
Registers a parameter (either OUT, or the new REF_CURSOR param type available in Java 8) capable of
returning
ResultSet by position. |
int |
registerResultSetOutParameter(CallableStatement statement,
String name)
Registers a parameter (either OUT, or the new REF_CURSOR param type available in Java 8) capable of
returning
ResultSet by name. |
boolean |
supportsCircularCascadeDeleteConstraints()
Does this dialect support definition of cascade delete constraints
which can cause circular chains?
|
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?
<p/>
For example, is [where XYZ in ()] a supported construct?
|
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…
<p/>
Part of the trickiness here is the fact that this is largely
driver dependent.
|
boolean |
supportsLimit()
Does this dialect support some form of limiting query results
via a SQL clause?
|
boolean |
supportsPartitionBy()
Does the underlying database support partition by
|
boolean |
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 supports
row values ,
does it offer such support in IN lists as well?
<p/>
For example, "… where (FIRST_NAME, LAST_NAME) IN ( (?, ?), (?, ?) ) …" |
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?
<p/>
Again, part of the trickiness here is the fact that this is largely
driver dependent.
|
boolean |
supportsUnionAll()
Does this dialect support UNION ALL, which is generally a faster
variant of UNION?
|
String |
toBooleanValueString(boolean bool)
The SQL literal value to which this database maps boolean values.
|
addSqlHintOrComment, appendLockHint, appendLockHint, applyLocksToSql, areStringComparisonsCaseInsensitive, augmentRecognizedTableTypes, bindLimitParametersFirst, buildSQLExceptionConverter, canCreateCatalog, canCreateSchema, cast, cast, cast, closeQuote, convertToFirstRowValue, createCaseFragment, createOuterJoinFragment, doesReadCommittedCauseWritersToBlockReaders, doesRepeatableReadCauseReadersToBlockWriters, 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, 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
public boolean bindLimitParametersInReverseOrder()
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?
bindLimitParametersInReverseOrder
in class Dialect
public SQLExceptionConversionDelegate buildSQLExceptionConversionDelegate()
Dialect
Build an instance of a SQLExceptionConversionDelegate
for
interpreting dialect-specific error or SQLState codes.
<p/>
When Dialect.buildSQLExceptionConverter()
returns null, the default
SQLExceptionConverter
is used to interpret SQLState and
error codes. If this method is overridden to return a non-null value,
the default SQLExceptionConverter
will use the returned
SQLExceptionConversionDelegate
in addition to the following
standard delegates:
<ol>
<li>a "static" delegate based on the JDBC 4 defined SQLException hierarchy;</li>
<li>a delegate that interprets SQLState codes for either X/Open or SQL-2003 codes,
depending on java.sql.DatabaseMetaData#getSQLStateType</li>
</ol>
<p/>
It is strongly recommended that specific Dialect implementations override this
method, since interpretation of a SQL error is much more accurate when based on
the a vendor-specific ErrorCode rather than the SQLState.
<p/>
Specific Dialects may override to return whatever is most appropriate for that vendor.
buildSQLExceptionConversionDelegate
in class Dialect
public boolean forUpdateOfColumns()
Dialect
Is <tt>FOR UPDATE OF</tt> syntax supported?
forUpdateOfColumns
in class Dialect
public String getAddColumnString()
Dialect
The syntax used to add a column to a table (optional).
getAddColumnString
in class Dialect
public String getAddColumnSuffixString()
Dialect
The syntax for the suffix used to add a column to a table (optional).
getAddColumnSuffixString
in class Dialect
public String getCascadeConstraintsString()
Dialect
Completely optional cascading drop clause
getCascadeConstraintsString
in class Dialect
public String getCreateSequenceString(String sequenceName)
Dialect
Typically dialects which support sequences can create a sequence
with a single command. This is convenience form of
Dialect.getCreateSequenceStrings(java.lang.String)
to help facilitate that.
<p/>
Dialects which support sequences and can create a sequence in a
single command need only override this method. Dialects
which support sequences but require multiple commands to create
a sequence should instead override Dialect.getCreateSequenceStrings(java.lang.String)
.
getCreateSequenceString
in class Dialect
sequenceName
- The name of the sequenceprotected String getCreateSequenceString(String sequenceName, int initialValue, int incrementSize) throws MappingException
Dialect
Overloaded form of Dialect.getCreateSequenceString(String)
, additionally
taking the initial value and increment size to be applied to the sequence
definition.
</p>
The default definition is to suffix Dialect.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.
getCreateSequenceString
in class Dialect
sequenceName
- The name of the sequenceinitialValue
- The initial value to apply to 'create sequence' statementincrementSize
- The increment value to apply to 'create sequence' statementMappingException
- If sequences are not supported.public String getCurrentTimestampSelectString()
Dialect
Retrieve the command used to retrieve the current timestamp from the database.
getCurrentTimestampSelectString
in class Dialect
public String getDropSequenceString(String sequenceName)
Dialect
Typically dialects which support sequences can drop a sequence
with a single command. This is convenience form of
Dialect.getDropSequenceStrings(java.lang.String)
to help facilitate that.
<p/>
Dialects which support sequences and can drop a sequence in a
single command need only override this method. Dialects
which support sequences but require multiple commands to drop
a sequence should instead override Dialect.getDropSequenceStrings(java.lang.String)
.
getDropSequenceString
in class Dialect
sequenceName
- The name of the sequencepublic String getForUpdateString(String aliases)
Dialect
Get the <tt>FOR UPDATE OF column_list</tt> fragment appropriate for this dialect given the aliases of the columns to be write locked.
getForUpdateString
in class Dialect
aliases
- The columns to be write locked.public String getForUpdateString(String aliases, LockOptions lockOptions)
Dialect
Get the <tt>FOR UPDATE OF column_list</tt> fragment appropriate for this dialect given the aliases of the columns to be write locked.
getForUpdateString
in class Dialect
aliases
- The columns to be write locked.lockOptions
- the lock options to applypublic String getForUpdateNowaitString()
Dialect
Retrieves the <tt>FOR UPDATE NOWAIT</tt> syntax specific to this dialect.
getForUpdateNowaitString
in class Dialect
public String getLimitString(String sql, boolean hasOffset)
Dialect
Apply s limit clause to the query.
<p/>
Typically dialects utilize variable
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.
<p/>
Here we do still pass along whether or not an offset was specified
so that dialects not supporting offsets can generate proper exceptions.
In general, dialects will override one or the other of this method and
Dialect.getLimitString(String, int, int)
.
getLimitString
in class Dialect
sql
- The query to which to apply the limit.hasOffset
- Is the query requesting an offset?public String getNotExpression(String expression)
Dialect
Negate an expression
getNotExpression
in class Dialect
expression
- The expression to negatepublic String getQuerySequencesString()
Dialect
Get the select command used retrieve the names of all sequences.
getQuerySequencesString
in class Dialect
SchemaUpdate
public String getSelectSequenceNextValString(String sequenceName)
Dialect
Generate the select expression fragment that will retrieve the next
value of a sequence as part of another (typically DML) statement.
<p/>
This differs from Dialect.getSequenceNextValString(String)
in that this
should return an expression usable within another statement.
getSelectSequenceNextValString
in class Dialect
sequenceName
- the name of the sequencepublic String getSequenceNextValString(String sequenceName)
Dialect
Generate the appropriate select statement to to retrieve the next value of a sequence. <p/> This should be a "stand alone" select statement.
getSequenceNextValString
in class Dialect
sequenceName
- the name of the sequenceprotected SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode)
Dialect
Returns the SqlTypeDescriptor
that should be used to handle the given JDBC type code. Returns
null
if there is no override.
getSqlTypeDescriptorOverride
in class Dialect
sqlCode
- A Types
constant indicating the SQL column typeSqlTypeDescriptor
to use as an override, or null
if there is no override.public boolean isCurrentTimestampSelectStringCallable()
Dialect
Should the value returned by Dialect.getCurrentTimestampSelectString()
be treated as callable. Typically this indicates that JDBC escape
syntax is being used…
isCurrentTimestampSelectStringCallable
in class Dialect
Dialect.getCurrentTimestampSelectString()
return
is callable; false otherwise.protected void registerHanaKeywords()
public boolean supportsCircularCascadeDeleteConstraints()
Dialect
Does this dialect support definition of cascade delete constraints which can cause circular chains?
supportsCircularCascadeDeleteConstraints
in class Dialect
public ScrollMode defaultScrollMode()
Dialect
Certain dialects support a subset of ScrollModes. Provide a default to be used by Criteria and Query.
defaultScrollMode
in class Dialect
public boolean supportsColumnCheck()
HANA currently does not support check constraints.
supportsColumnCheck
in class Dialect
public boolean supportsCurrentTimestampSelection()
Dialect
Does this dialect support a way to retrieve the database’s current timestamp value?
supportsCurrentTimestampSelection
in class Dialect
public boolean supportsEmptyInList()
Dialect
Does this dialect support empty IN lists? <p/> For example, is [where XYZ in ()] a supported construct?
supportsEmptyInList
in class Dialect
public boolean supportsExistsInSelect()
Dialect
Does the dialect support an exists statement in the select clause?
supportsExistsInSelect
in class Dialect
public boolean supportsExpectedLobUsagePattern()
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… <p/> 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…
supportsExpectedLobUsagePattern
in class Dialect
public boolean supportsUnboundedLobLocatorMaterialization()
Dialect
Is it supported to materialize a LOB locator outside the transaction in
which it was created?
<p/>
Again, part of the trickiness here is the fact that this is largely
driver dependent.
<p/>
NOTE: all database I have tested which Dialect.supportsExpectedLobUsagePattern()
also support the ability to materialize a LOB outside the owning transaction…
supportsUnboundedLobLocatorMaterialization
in class Dialect
public boolean supportsLimit()
Dialect
Does this dialect support some form of limiting query results via a SQL clause?
supportsLimit
in class Dialect
public boolean supportsPooledSequences()
Dialect
Does this dialect support "pooled" sequences. Not aware of a better name for this. Essentially can we specify the initial and increment values?
supportsPooledSequences
in class Dialect
Dialect.getCreateSequenceStrings(String, int, int)
,
Dialect.getCreateSequenceString(String, int, int)
public boolean supportsSequences()
Dialect
Does this dialect support sequences?
supportsSequences
in class Dialect
public boolean supportsTableCheck()
Dialect
Does this dialect support table-level check constraints?
supportsTableCheck
in class Dialect
public boolean supportsTupleDistinctCounts()
Dialect
Does this dialect support count(distinct a,b)
?
supportsTupleDistinctCounts
in class Dialect
public boolean supportsUnionAll()
Dialect
Does this dialect support UNION ALL, which is generally a faster variant of UNION?
supportsUnionAll
in class Dialect
public boolean dropConstraints()
Dialect
Do we need to drop constraints before dropping tables in this dialect?
dropConstraints
in class Dialect
public boolean supportsRowValueConstructorSyntax()
Dialect
Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax; sometimes called tuple syntax. <p/> Basically, does it support syntax like "… where (FIRST_NAME, LAST_NAME) = ('Steve', 'Ebersole') …".
supportsRowValueConstructorSyntax
in class Dialect
public boolean supportsRowValueConstructorSyntaxInInList()
Dialect
If the dialect supports row values
,
does it offer such support in IN lists as well?
<p/>
For example, "… where (FIRST_NAME, LAST_NAME) IN ( (?, ?), (?, ?) ) …"
supportsRowValueConstructorSyntaxInInList
in class Dialect
public int getMaxAliasLength()
Dialect
What is the maximum length Hibernate can use for generated aliases? <p/> 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).
getMaxAliasLength
in class Dialect
public LimitHandler getLimitHandler()
Dialect
Returns the delegate managing LIMIT clause.
getLimitHandler
in class Dialect
public String getSelectGUIDString()
Dialect
Get the command used to select a GUID from the underlying database. <p/> Optional operation.
getSelectGUIDString
in class Dialect
public NameQualifierSupport getNameQualifierSupport()
Dialect
By default interpret this based on DatabaseMetaData.
getNameQualifierSupport
in class Dialect
public IdentifierHelper buildIdentifierHelper(IdentifierHelperBuilder builder, DatabaseMetaData dbMetaData) throws SQLException
Dialect
Build the IdentifierHelper indicated by this Dialect for handling identifier conversions.
Returning null
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.
<p/>
The incoming builder will have the following set:<ul>
<li>IdentifierHelperBuilder.isGloballyQuoteIdentifiers()
</li>
<li>IdentifierHelperBuilder.getUnquotedCaseStrategy()
- initialized to UPPER</li>
<li>IdentifierHelperBuilder.getQuotedCaseStrategy()
- initialized to MIXED</li>
</ul>
<p/>
By default Hibernate will do the following:<ul>
<li>Call IdentifierHelperBuilder.applyIdentifierCasing(DatabaseMetaData)
<li>Call IdentifierHelperBuilder.applyReservedWords(DatabaseMetaData)
<li>Applies AnsiSqlKeywords.sql2003()
as reserved words</li>
<li>Applies the {#link #sqlKeywords} collected here as reserved words</li>
<li>Applies the Dialect’s NameQualifierSupport, if it defines one</li>
</ul>
buildIdentifierHelper
in class Dialect
builder
- A semi-configured IdentifierHelper builder.dbMetaData
- Access to the metadata returned from the driver if needed and if available. WARNING: may be null
null
to indicate Hibernate should use its fallback pathSQLException
- Accessing the DatabaseMetaData can throw it. Just re-throw and Hibernate will handle.Dialect.getNameQualifierSupport()
public String getCurrentSchemaCommand()
Dialect
Get the SQL command used to retrieve the current schema name. Works in conjunction
with Dialect.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
the Connection.getSchema()
method
getCurrentSchemaCommand
in class Dialect
public String getForUpdateNowaitString(String aliases)
Dialect
Get the <tt>FOR UPDATE OF column_list NOWAIT</tt> fragment appropriate for this dialect given the aliases of the columns to be write locked.
getForUpdateNowaitString
in class Dialect
aliases
- The columns to be write locked.public String getReadLockString(int timeout)
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.
getReadLockString
in class Dialect
timeout
- in milliseconds, -1 for indefinite wait and 0 for no wait.public String getReadLockString(String aliases, int timeout)
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.
getReadLockString
in class Dialect
aliases
- The columns to be read locked.timeout
- in milliseconds, -1 for indefinite wait and 0 for no wait.public String getWriteLockString(int timeout)
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.
getWriteLockString
in class Dialect
timeout
- in milliseconds, -1 for indefinite wait and 0 for no wait.public String getWriteLockString(String aliases, int timeout)
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.
getWriteLockString
in class Dialect
aliases
- The columns to be read locked.timeout
- in milliseconds, -1 for indefinite wait and 0 for no wait.public String getQueryHintString(String query, List<String> hints)
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.
getQueryHintString
in class Dialect
query
- The query to which to apply the hint.hints
- The hints to applypublic String getTableComment(String comment)
Dialect
Get the comment into a form supported for table definition.
getTableComment
in class Dialect
comment
- The comment to applypublic String getColumnComment(String comment)
Dialect
Get the comment into a form supported for column definition.
getColumnComment
in class Dialect
comment
- The comment to applypublic boolean supportsCommentOn()
Dialect
Does this dialect/database support commenting on tables, columns, etc?
supportsCommentOn
in class Dialect
true
if commenting is supportedpublic boolean supportsPartitionBy()
Dialect
Does the underlying database support partition by
supportsPartitionBy
in class Dialect
public void contributeTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry)
Dialect
Allows the Dialect to contribute additional types
contributeTypes
in class Dialect
typeContributions
- Callback to contribute the typesserviceRegistry
- The service registrypublic SqlTypeDescriptor getBlobTypeDescriptor()
public String toBooleanValueString(boolean bool)
Dialect
The SQL literal value to which this database maps boolean values.
toBooleanValueString
in class Dialect
bool
- The boolean valuepublic IdentityColumnSupport getIdentityColumnSupport()
Dialect
Get the appropriate IdentityColumnSupport
getIdentityColumnSupport
in class Dialect
public Exporter<Table> getTableExporter()
getTableExporter
in class Dialect
public CallableStatementSupport getCallableStatementSupport()
getCallableStatementSupport
in class Dialect
public int registerResultSetOutParameter(CallableStatement statement, int position) throws SQLException
Dialect
Registers a parameter (either OUT, or the new REF_CURSOR param type available in Java 8) capable of
returning ResultSet
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
in class Dialect
statement
- The callable statement.position
- The bind position at which to register the output param.SQLException
- Indicates problems registering the param.public int registerResultSetOutParameter(CallableStatement statement, String name) throws SQLException
Dialect
Registers a parameter (either OUT, or the new REF_CURSOR param type available in Java 8) capable of
returning ResultSet
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.
registerResultSetOutParameter
in class Dialect
statement
- The callable statement.name
- The parameter name (for drivers which support named parameters).SQLException
- Indicates problems registering the param.Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.