public class CockroachDB192Dialect extends 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, TWO_SINGLE_QUOTES_REPLACEMENT| Constructor and Description |
|---|
CockroachDB192Dialect() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
bindLimitParametersInReverseOrder()
ANSI SQL defines the LIMIT clause to be in the form LIMIT offset, limit.
|
SQLExceptionConversionDelegate |
buildSQLExceptionConversionDelegate()
Build an instance of a
SQLExceptionConversionDelegate for
interpreting dialect-specific error or SQLState codes. |
boolean |
canCreateSchema()
Does this dialect support schema creation?
|
void |
contributeTypes(TypeContributions typeContributions,
ServiceRegistry serviceRegistry)
Allows the Dialect to contribute additional types
|
boolean |
doesReadCommittedCauseWritersToBlockReaders()
For the underlying database, is READ_COMMITTED isolation implemented by
forcing readers to wait for write locks to be released?
|
boolean |
dropConstraints()
Do we need to drop constraints before dropping tables in this dialect?
|
String |
getAddColumnString()
The syntax used to add a column to a table (optional).
|
String |
getCascadeConstraintsString()
Completely optional cascading drop clause
|
String |
getCaseInsensitiveLike()
The name of the SQL function that can do case insensitive like comparison.
|
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 |
getCurrentTimestampSelectString()
Retrieve the command used to retrieve the current timestamp from the
database.
|
MultiTableBulkIdStrategy |
getDefaultMultiTableBulkIdStrategy() |
String |
getDropSequenceString(String sequenceName)
Typically dialects which support sequences can drop a sequence
with a single command.
|
String |
getForUpdateNowaitString()
Retrieves the FOR UPDATE NOWAIT syntax specific to this dialect.
|
String |
getForUpdateNowaitString(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.
|
String |
getForUpdateSkipLockedString()
Retrieves the FOR UPDATE SKIP LOCKED syntax specific to this dialect.
|
String |
getForUpdateSkipLockedString(String aliases)
Get the FOR UPDATE OF column_list SKIP LOCKED fragment appropriate
for this dialect given the aliases of the columns to be write locked.
|
String |
getForUpdateString()
Get the string to append to SELECT statements to acquire locks
for this dialect.
|
String |
getForUpdateString(String aliases)
Get the FOR UPDATE OF column_list fragment appropriate for this
dialect given the aliases of the columns to be write locked.
|
String |
getForUpdateString(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 appropriate
IdentityColumnSupport |
LimitHandler |
getLimitHandler()
Returns the delegate managing LIMIT clause.
|
String |
getLimitString(String sql,
boolean hasOffset)
Apply a limit clause to the query.
|
String |
getNativeIdentifierGeneratorStrategy()
Resolves the native generation strategy associated to this dialect.
|
String |
getNoColumnsInsertString()
The fragment used to insert a row without specifying any column values.
|
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 |
getSelectClauseNullString(int sqlType)
Given a
Types type code, determine an appropriate
null value to use in a select clause. |
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.
|
SqlTypeDescriptor |
getSqlTypeDescriptorOverride(int sqlCode)
Returns the
SqlTypeDescriptor that should be used to handle the given JDBC type code. |
ViolatedConstraintNameExtracter |
getViolatedConstraintNameExtracter() |
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. |
boolean |
qualifyIndexName()
Do we need to qualify index names with the schema name?
|
boolean |
requiresParensForTupleDistinctCounts()
If
Dialect.supportsTupleDistinctCounts() is true, does the Dialect require the tuple to be wrapped with parens? |
boolean |
supportsCaseInsensitiveLike()
Does this dialect support case insensitive LIKE restrictions?
|
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?
For example, is [where XYZ in ()] a supported construct?
|
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 |
supportsIfExistsAfterAlterTable()
For an "alter table", can the phrase "if exists" be applied?
|
boolean |
supportsIfExistsBeforeTableName()
For dropping a table, can the phrase "if exists" be applied before the table name?
NOTE : Only one or the other (or neither) of this and
Dialect.supportsIfExistsAfterTableName() should return true |
boolean |
supportsJdbcConnectionLobCreation(DatabaseMetaData databaseMetaData)
Check whether the JDBC
Connection supports creating LOBs via Connection.createBlob(),
Connection.createNClob() or Connection.createClob(). |
boolean |
supportsLimit()
Does this dialect support some form of limiting query results
via a SQL clause?
|
boolean |
supportsLobValueChangePropogation()
Does 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...
|
boolean |
supportsLockTimeouts()
Informational metadata about whether this dialect is known to support
specifying timeouts for requested lock acquisitions.
|
boolean |
supportsNationalizedTypes()
Does this dialect supports Nationalized Types
|
boolean |
supportsNonQueryWithCTE()
Does this dialect/database support non-query statements (e.g.
|
boolean |
supportsNoWait()
Does this dialect/database support NO_WAIT timeout.
|
boolean |
supportsOuterJoinForUpdate()
Does this dialect support FOR UPDATE in conjunction with
outer joined rows?
|
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?
For example, "... |
boolean |
supportsSelectAliasInGroupByClause() |
boolean |
supportsSequences()
Does this dialect support sequences?
|
boolean |
supportsSkipLocked()
Does this dialect/database support SKIP_LOCKED timeout.
|
boolean |
supportsUnboundedLobLocatorMaterialization()
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.
|
boolean |
supportsUnionAll()
Does this dialect support UNION ALL, which is generally a faster
variant of UNION?
|
boolean |
supportsValuesList()
Does this dialect/database support VALUES list (e.g.
|
String |
toBooleanValueString(boolean bool)
The SQL literal value to which this database maps boolean values.
|
boolean |
useInputStreamToInsertBlob()
Should LOBs (both BLOB and CLOB) be bound using stream operations (i.e.
|
addSqlHintOrComment, appendLockHint, appendLockHint, applyLocksToSql, areStringComparisonsCaseInsensitive, augmentRecognizedTableTypes, bindLimitParametersFirst, buildIdentifierHelper, buildSQLExceptionConverter, canCreateCatalog, cast, cast, cast, closeQuote, convertToFirstRowValue, createCaseFragment, createOuterJoinFragment, defaultScrollMode, doesRepeatableReadCauseReadersToBlockWriters, equivalentTypes, escapeComment, escapeLiteral, forceLimitUsage, forceLobAsLastValue, forUpdateOfColumns, getAddColumnSuffixString, getAddForeignKeyConstraintString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAddUniqueConstraintString, getAlterTableString, getAuxiliaryDatabaseObjectExporter, getCallableStatementSupport, getCastTypeName, getColumnAliasExtractor, getColumnComment, getCreateCatalogCommand, getCreateMultisetTableString, getCreateSchemaCommand, getCreateSequenceStrings, getCreateSequenceStrings, getCreateTableString, getCreateTemporaryTableColumnAnnotation, getCrossJoinSeparator, getCurrentSchemaCommand, getCurrentTimestampSQLFunctionName, getDefaultBatchLoadSizingStrategy, getDefaultProperties, getDialect, getDialect, getDropCatalogCommand, getDropForeignKeyString, getDropSchemaCommand, getDropSequenceStrings, getDropTableString, getForeignKeyExporter, getForUpdateString, getForUpdateString, getFunctions, getHibernateTypeName, getHibernateTypeName, getIndexExporter, getInExpressionCountLimit, getKeywords, getLimitString, getLobMergeStrategy, getLockingStrategy, getLowercaseFunction, getMaxAliasLength, getNameQualifierSupport, getNativeIdentifierGeneratorClass, getNotExpression, getNullColumnString, getQueryHintString, getQueryHintString, getResultSet, getResultSet, getResultSet, getSchemaNameResolver, getSelectGUIDString, getSequenceExporter, getSequenceInformationExtractor, getTableComment, getTableExporter, getTableTypeString, getTypeName, getTypeName, getUniqueDelegate, getUniqueKeyExporter, hasAlterTable, hasSelfReferentialForeignKeyBug, inlineLiteral, isJdbcLogWarningsEnabledByDefault, isLegacyLimitHandlerBehaviorEnabled, isLockTimeoutParameterized, isTypeNameRegistered, openQuote, prependComment, quote, registerColumnType, registerColumnType, registerFunction, registerHibernateType, registerHibernateType, registerKeyword, registerResultSetOutParameter, registerResultSetOutParameter, remapSqlTypeDescriptor, renderOrderByElement, replaceResultVariableInOrderByClauseWithPosition, requiresCastingOfParametersInSelectClause, supportsBindAsCallableArgument, supportsCascadeDelete, supportsCircularCascadeDeleteConstraints, supportsColumnCheck, supportsExistsInSelect, supportsIfExistsAfterConstraintName, supportsIfExistsAfterTableName, supportsIfExistsBeforeConstraintName, supportsLimitOffset, supportsNamedParameters, supportsNoColumnsInsert, supportsNotNullUnique, supportsParametersInInsertSelect, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsRowValueConstructorSyntaxInSet, supportsSubqueryOnMutatingTable, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTupleCounts, supportsTupleDistinctCounts, supportsTuplesInSubqueries, supportsUnique, supportsUniqueConstraintInCreateAlterTable, supportsVariableLimit, toString, transformSelectString, useFollowOnLocking, useFollowOnLocking, useMaxForLimitpublic SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode)
DialectSqlTypeDescriptor that should be used to handle the given JDBC type code. Returns
null if there is no override.getSqlTypeDescriptorOverride in class DialectsqlCode - A Types constant indicating the SQL column typeSqlTypeDescriptor to use as an override, or null if there is no override.public String getAddColumnString()
DialectgetAddColumnString in class Dialectpublic String getSequenceNextValString(String sequenceName)
DialectgetSequenceNextValString in class DialectsequenceName - the name of the sequencepublic String getSelectSequenceNextValString(String sequenceName)
DialectDialect.getSequenceNextValString(String) in that this
should return an expression usable within another statement.getSelectSequenceNextValString in class DialectsequenceName - the name of the sequencepublic String getCreateSequenceString(String sequenceName)
DialectDialect.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 override Dialect.getCreateSequenceStrings(java.lang.String).getCreateSequenceString in class DialectsequenceName - The name of the sequencepublic String getCascadeConstraintsString()
DialectgetCascadeConstraintsString in class Dialectpublic boolean dropConstraints()
DialectdropConstraints in class Dialectpublic boolean supportsSequences()
DialectsupportsSequences in class Dialectpublic String getQuerySequencesString()
DialectgetQuerySequencesString in class DialectSchemaUpdatepublic LimitHandler getLimitHandler()
DialectgetLimitHandler in class Dialectpublic boolean supportsLimit()
DialectsupportsLimit in class Dialectpublic String getLimitString(String sql, boolean hasOffset)
Dialectvariable
limit clauses when they support limits. Thus, when building the
select command we do not actually need to know the limit or the offset
since we will just be using placeholders.
Here we do still pass along whether or not an offset was specified
so that dialects not supporting offsets can generate proper exceptions.
In general, dialects will override one or the other of this method and
Dialect.getLimitString(String, int, int).getLimitString in class Dialectsql - The query to which to apply the limit.hasOffset - Is the query requesting an offset?public boolean bindLimitParametersInReverseOrder()
DialectbindLimitParametersInReverseOrder in class Dialectpublic String getForUpdateString(String aliases)
DialectgetForUpdateString in class Dialectaliases - The columns to be write locked.public String getForUpdateString(String aliases, LockOptions lockOptions)
DialectgetForUpdateString in class Dialectaliases - The columns to be write locked.lockOptions - the lock options to applypublic String getNoColumnsInsertString()
DialectgetNoColumnsInsertString in class Dialectpublic String getCaseInsensitiveLike()
DialectgetCaseInsensitiveLike in class Dialectpublic boolean supportsCaseInsensitiveLike()
DialectsupportsCaseInsensitiveLike in class Dialecttrue if the underlying database supports case insensitive like comparison,
false otherwise. The default is false.public String getNativeIdentifierGeneratorStrategy()
DialectgetNativeIdentifierGeneratorStrategy in class Dialectpublic boolean supportsOuterJoinForUpdate()
DialectsupportsOuterJoinForUpdate in class Dialectpublic boolean useInputStreamToInsertBlob()
DialectPreparedStatement.setBinaryStream(int, java.io.InputStream, int)).useInputStreamToInsertBlob in class Dialectpublic boolean supportsUnionAll()
DialectsupportsUnionAll in class Dialectpublic String getSelectClauseNullString(int sqlType)
DialectTypes type code, determine an appropriate
null value to use in a select clause.
One thing to consider here is that certain databases might
require proper casting for the nulls here since the select here
will be part of a UNION/UNION ALL.getSelectClauseNullString in class DialectsqlType - The Types type code.public boolean supportsCommentOn()
DialectsupportsCommentOn in class Dialecttrue if commenting is supportedpublic boolean supportsCurrentTimestampSelection()
DialectsupportsCurrentTimestampSelection in class Dialectpublic boolean isCurrentTimestampSelectStringCallable()
DialectDialect.getCurrentTimestampSelectString()
be treated as callable. Typically this indicates that JDBC escape
syntax is being used...isCurrentTimestampSelectStringCallable in class DialectDialect.getCurrentTimestampSelectString() return
is callable; false otherwise.public String getCurrentTimestampSelectString()
DialectgetCurrentTimestampSelectString in class Dialectpublic boolean requiresParensForTupleDistinctCounts()
DialectDialect.supportsTupleDistinctCounts() is true, does the Dialect require the tuple to be wrapped with parens?requiresParensForTupleDistinctCounts in class Dialectpublic String toBooleanValueString(boolean bool)
DialecttoBooleanValueString in class Dialectbool - The boolean valuepublic ViolatedConstraintNameExtracter getViolatedConstraintNameExtracter()
getViolatedConstraintNameExtracter in interface ConversionContextgetViolatedConstraintNameExtracter in class Dialectpublic SQLExceptionConversionDelegate buildSQLExceptionConversionDelegate()
DialectSQLExceptionConversionDelegate for
interpreting dialect-specific error or SQLState codes.
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:
buildSQLExceptionConversionDelegate in class Dialectpublic boolean supportsPooledSequences()
DialectsupportsPooledSequences in class DialectDialect.getCreateSequenceStrings(String, int, int),
Dialect.getCreateSequenceString(String, int, int)protected String getCreateSequenceString(String sequenceName, int initialValue, int incrementSize)
DialectDialect.getCreateSequenceString(String), additionally
taking the initial value and increment size to be applied to the sequence
definition.
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 DialectsequenceName - The name of the sequenceinitialValue - The initial value to apply to 'create sequence' statementincrementSize - The increment value to apply to 'create sequence' statementpublic boolean supportsEmptyInList()
DialectsupportsEmptyInList in class Dialectpublic boolean supportsExpectedLobUsagePattern()
DialectsupportsExpectedLobUsagePattern in class Dialectpublic boolean supportsLobValueChangePropogation()
DialectBlob.setBinaryStream(long),
Blob.setBytes(long, byte[]),
Blob.setBytes(long, byte[], int, int),
or Blob.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),
or Clob.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 not Dialect.supportsExpectedLobUsagePattern().supportsLobValueChangePropogation in class Dialectpublic boolean supportsUnboundedLobLocatorMaterialization()
DialectDialect.supportsExpectedLobUsagePattern()
also support the ability to materialize a LOB outside the owning transaction...supportsUnboundedLobLocatorMaterialization in class Dialectpublic boolean supportsRowValueConstructorSyntax()
DialectsupportsRowValueConstructorSyntax in class Dialectpublic boolean qualifyIndexName()
DialectqualifyIndexName in class Dialectpublic boolean supportsNationalizedTypes()
DialectsupportsNationalizedTypes in class Dialectpublic boolean supportsJdbcConnectionLobCreation(DatabaseMetaData databaseMetaData)
DialectConnection supports creating LOBs via Connection.createBlob(),
Connection.createNClob() or Connection.createClob().supportsJdbcConnectionLobCreation in class DialectdatabaseMetaData - JDBC DatabaseMetaData which can be used if LOB creation is supported only starting from a given Driver versiontrue if LOBs can be created via the JDBC Connection.public boolean supportsSelectAliasInGroupByClause()
supportsSelectAliasInGroupByClause in class Dialectpublic boolean supportsIfExistsBeforeTableName()
DialectDialect.supportsIfExistsAfterTableName() should return truesupportsIfExistsBeforeTableName in class Dialecttrue if the "if exists" can be applied before the table namepublic void contributeTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry)
DialectcontributeTypes in class DialecttypeContributions - Callback to contribute the typesserviceRegistry - The service registrypublic String getDropSequenceString(String sequenceName)
DialectDialect.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 override Dialect.getDropSequenceStrings(java.lang.String).getDropSequenceString in class DialectsequenceName - The name of the sequencepublic boolean supportsValuesList()
DialectsupportsValuesList in class Dialecttrue if VALUES list are supportedpublic boolean supportsRowValueConstructorSyntaxInInList()
Dialectrow values,
does it offer such support in IN lists as well?
For example, "... where (FIRST_NAME, LAST_NAME) IN ( (?, ?), (?, ?) ) ..."supportsRowValueConstructorSyntaxInInList in class Dialectpublic boolean supportsPartitionBy()
DialectsupportsPartitionBy in class Dialectpublic boolean supportsNonQueryWithCTE()
DialectsupportsNonQueryWithCTE in class Dialecttrue if non-query statements are supported with CTEpublic boolean supportsIfExistsAfterAlterTable()
DialectsupportsIfExistsAfterAlterTable in class Dialecttrue if the "if exists" can be applied after ALTER TABLEpublic String getForUpdateString()
DialectgetForUpdateString in class Dialectpublic String getWriteLockString(int timeout)
DialectgetWriteLockString in class Dialecttimeout - in milliseconds, -1 for indefinite wait and 0 for no wait.public String getWriteLockString(String aliases, int timeout)
DialectgetWriteLockString in class Dialectaliases - The columns to be read locked.timeout - in milliseconds, -1 for indefinite wait and 0 for no wait.public String getReadLockString(int timeout)
DialectgetReadLockString in class Dialecttimeout - in milliseconds, -1 for indefinite wait and 0 for no wait.public String getReadLockString(String aliases, int timeout)
DialectgetReadLockString in class Dialectaliases - The columns to be read locked.timeout - in milliseconds, -1 for indefinite wait and 0 for no wait.public String getForUpdateSkipLockedString()
DialectgetForUpdateSkipLockedString in class Dialectpublic String getForUpdateSkipLockedString(String aliases)
DialectgetForUpdateSkipLockedString in class Dialectaliases - The columns to be write locked.public String getForUpdateNowaitString()
DialectgetForUpdateNowaitString in class Dialectpublic String getForUpdateNowaitString(String aliases)
DialectgetForUpdateNowaitString in class Dialectaliases - The columns to be write locked.public boolean supportsLockTimeouts()
DialectsupportsLockTimeouts in class Dialectpublic boolean supportsSkipLocked()
DialectsupportsSkipLocked in class Dialecttrue if SKIP_LOCKED is supportedpublic boolean supportsNoWait()
DialectsupportsNoWait in class Dialecttrue if NO_WAIT is supportedpublic IdentityColumnSupport getIdentityColumnSupport()
DialectIdentityColumnSupportgetIdentityColumnSupport in class Dialectpublic MultiTableBulkIdStrategy getDefaultMultiTableBulkIdStrategy()
getDefaultMultiTableBulkIdStrategy in class Dialectpublic boolean doesReadCommittedCauseWritersToBlockReaders()
DialectdoesReadCommittedCauseWritersToBlockReaders in class Dialectpublic boolean canCreateSchema()
DialectcanCreateSchema in class DialectCopyright © 2001-2022 Red Hat, Inc. All Rights Reserved.