Top Description Fields Constructors Methods
org.hibernate.dialect

public Class CockroachDB192Dialect

extends Dialect
Class Inheritance
Known Direct Subclasses
org.hibernate.dialect.CockroachDB201Dialect
Imports
java.sql.DatabaseMetaData, .SQLException, .Types, java.util.Iterator, .Map, org.hibernate.JDBCException, .LockMode, .LockOptions, .NullPrecedence, .PessimisticLockException, org.hibernate.boot.model.TypeContributions, org.hibernate.cfg.Environment, org.hibernate.dialect.function.NoArgSQLFunction, .PositionSubstringFunction, .SQLFunctionTemplate, .StandardSQLFunction, .VarArgsSQLFunction, org.hibernate.dialect.identity.CockroachDB1920IdentityColumnSupport, .IdentityColumnSupport, org.hibernate.dialect.pagination.AbstractLimitHandler, .LimitHandler, .LimitHelper, org.hibernate.engine.jdbc.env.spi.IdentifierCaseStrategy, .IdentifierHelper, .IdentifierHelperBuilder, .NameQualifierSupport, org.hibernate.engine.spi.RowSelection, org.hibernate.exception.LockAcquisitionException, org.hibernate.exception.spi.SQLExceptionConversionDelegate, .TemplatedViolatedConstraintNameExtracter, .ViolatedConstraintNameExtracter, org.hibernate.hql.spi.id.MultiTableBulkIdStrategy, org.hibernate.hql.spi.id.inline.InlineIdsInClauseBulkIdStrategy, org.hibernate.internal.util.JdbcExceptionHelper, org.hibernate.service.ServiceRegistry, org.hibernate.type.PostgresUUIDType, .StandardBasicTypes, org.hibernate.type.descriptor.sql.SqlTypeDescriptor, .VarbinaryTypeDescriptor, .VarcharTypeDescriptor

An SQL dialect for CockroachDB 19.2 and later. This is the first dialect for CockroachDB. It is largely adapted from the PostgreSQL dialects, with changes where appropriate.

Field Summary

Modifier and TypeField and Description
private static final ViolatedConstraintNameExtracter
EXTRACTER

Hides org.hibernate.dialect.Dialect.EXTRACTER.

Constraint-name extractor for CockroachDB constraint violation exceptions.
private static final AbstractLimitHandler
Inherited from org.hibernate.dialect.Dialect:
CLOSED_QUOTEDEFAULT_BATCH_SIZELEGACY_LOB_MERGE_STRATEGYNEW_LOCATOR_LOB_MERGE_STRATEGYNO_BATCHQUOTESTANDARD_DEFAULT_BATCH_LOAD_SIZING_STRATEGYSTREAM_XFER_LOB_MERGE_STRATEGYTWO_SINGLE_QUOTES_REPLACEMENT

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
bindLimitParametersInReverseOrder()

Overrides org.hibernate.dialect.Dialect.bindLimitParametersInReverseOrder.

ANSI SQL defines the LIMIT clause to be in the form LIMIT offset, limit.
public IdentifierHelper
buildIdentifierHelper(IdentifierHelperBuilder
A semi-configured IdentifierHelper builder.
builder
,
DatabaseMetaData
Access to the metadata returned from the driver if needed and if available.

Warning

may be null

dbMetaData
)

Overrides org.hibernate.dialect.Dialect.buildIdentifierHelper.

Build the IdentifierHelper indicated by this Dialect for handling identifier conversions.
public SQLExceptionConversionDelegate
buildSQLExceptionConversionDelegate()

Overrides org.hibernate.dialect.Dialect.buildSQLExceptionConversionDelegate.

Build an instance of a SQLExceptionConversionDelegate for interpreting dialect-specific error or SQLState codes.
public boolean
canCreateSchema()

Overrides org.hibernate.dialect.Dialect.canCreateSchema.

Does this dialect support schema creation?
public void
contributeTypes(TypeContributions
Callback to contribute the types
typeContributions
,
ServiceRegistry
The service registry
serviceRegistry
)

Overrides org.hibernate.dialect.Dialect.contributeTypes.

Allows the Dialect to contribute additional types
public boolean
doesReadCommittedCauseWritersToBlockReaders()

Overrides org.hibernate.dialect.Dialect.doesReadCommittedCauseWritersToBlockReaders.

For the underlying database, is READ_COMMITTED isolation implemented by forcing readers to wait for write locks to be released?
public boolean
dropConstraints()

Overrides org.hibernate.dialect.Dialect.dropConstraints.

Do we need to drop constraints before dropping tables in this dialect?
public String
getAddColumnString()

Overrides org.hibernate.dialect.Dialect.getAddColumnString.

The syntax used to add a column to a table (optional).
public String
getCascadeConstraintsString()

Overrides org.hibernate.dialect.Dialect.getCascadeConstraintsString.

Completely optional cascading drop clause
public String
getCaseInsensitiveLike()

Overrides org.hibernate.dialect.Dialect.getCaseInsensitiveLike.

The name of the SQL function that can do case insensitive like comparison.
public String
getCreateSequenceString(String
The name of the sequence
sequenceName
)

Overrides org.hibernate.dialect.Dialect.getCreateSequenceString.

Typically dialects which support sequences can create a sequence with a single command.
protected String
getCreateSequenceString(String
The name of the sequence
sequenceName
,
int
The initial value to apply to 'create sequence' statement
initialValue
,
int
The increment value to apply to 'create sequence' statement
incrementSize
)

Overrides org.hibernate.dialect.Dialect.getCreateSequenceString.

Overloaded form of getCreateSequenceString(String), additionally taking the initial value and increment size to be applied to the sequence definition.
public String
getCurrentTimestampSelectString()

Overrides org.hibernate.dialect.Dialect.getCurrentTimestampSelectString.

Retrieve the command used to retrieve the current timestamp from the database.
public MultiTableBulkIdStrategy
public String
getDropSequenceString(String
The name of the sequence
sequenceName
)

Overrides org.hibernate.dialect.Dialect.getDropSequenceString.

Typically dialects which support sequences can drop a sequence with a single command.
public String
getForUpdateNowaitString()

Overrides org.hibernate.dialect.Dialect.getForUpdateNowaitString.

Retrieves the FOR UPDATE NOWAIT syntax specific to this dialect.
public String
getForUpdateNowaitString(String
The columns to be write locked.
aliases
)

Overrides org.hibernate.dialect.Dialect.getForUpdateNowaitString.

Get the FOR UPDATE OF column_list NOWAIT fragment appropriate for this dialect given the aliases of the columns to be write locked.
public String
getForUpdateSkipLockedString()

Overrides org.hibernate.dialect.Dialect.getForUpdateSkipLockedString.

Retrieves the FOR UPDATE SKIP LOCKED syntax specific to this dialect.
public String
getForUpdateSkipLockedString(String
The columns to be write locked.
aliases
)

Overrides org.hibernate.dialect.Dialect.getForUpdateSkipLockedString.

Get the FOR UPDATE OF column_list SKIP LOCKED fragment appropriate for this dialect given the aliases of the columns to be write locked.
public String
getForUpdateString(String
The columns to be write locked.
aliases
)

Overrides org.hibernate.dialect.Dialect.getForUpdateString.

Get the FOR UPDATE OF column_list fragment appropriate for this dialect given the aliases of the columns to be write locked.
public String
getForUpdateString(String
The columns to be write locked.
aliases
,
LockOptions
the lock options to apply
lockOptions
)

Overrides org.hibernate.dialect.Dialect.getForUpdateString.

Get the FOR UPDATE OF column_list fragment appropriate for this dialect given the aliases of the columns to be write locked.
public String
getForUpdateString()

Overrides org.hibernate.dialect.Dialect.getForUpdateString.

Get the string to append to SELECT statements to acquire locks for this dialect.
public IdentityColumnSupport
public LimitHandler
getLimitHandler()

Overrides org.hibernate.dialect.Dialect.getLimitHandler.

Returns the delegate managing LIMIT clause.
public String
getLimitString(String
The query to which to apply the limit.
sql
,
boolean
Is the query requesting an offset?
hasOffset
)

Overrides org.hibernate.dialect.Dialect.getLimitString.

Apply a limit clause to the query.
public NameQualifierSupport
getNameQualifierSupport()

Overrides org.hibernate.dialect.Dialect.getNameQualifierSupport.

By default interpret this based on DatabaseMetaData.
public String
getNativeIdentifierGeneratorStrategy()

Overrides org.hibernate.dialect.Dialect.getNativeIdentifierGeneratorStrategy.

Resolves the native generation strategy associated to this dialect.
public String
getNoColumnsInsertString()

Overrides org.hibernate.dialect.Dialect.getNoColumnsInsertString.

The fragment used to insert a row without specifying any column values.
public String
getQuerySequencesString()

Overrides org.hibernate.dialect.Dialect.getQuerySequencesString.

Get the select command used retrieve the names of all sequences.
public String
getReadLockString(int
in milliseconds, -1 for indefinite wait and 0 for no wait.
timeout
)

Overrides org.hibernate.dialect.Dialect.getReadLockString.

Get the string to append to SELECT statements to acquire READ locks for this dialect.
public String
getReadLockString(String
The columns to be read locked.
aliases
,
int
in milliseconds, -1 for indefinite wait and 0 for no wait.
timeout
)

Overrides org.hibernate.dialect.Dialect.getReadLockString.

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.
public String
getSelectClauseNullString(int
The Types type code.
sqlType
)

Overrides org.hibernate.dialect.Dialect.getSelectClauseNullString.

Given a Types type code, determine an appropriate null value to use in a select clause.
public String
getSelectSequenceNextValString(String
the name of the sequence
sequenceName
)

Overrides org.hibernate.dialect.Dialect.getSelectSequenceNextValString.

Generate the select expression fragment that will retrieve the next value of a sequence as part of another (typically DML) statement.
public String
getSequenceNextValString(String
the name of the sequence
sequenceName
)

Overrides org.hibernate.dialect.Dialect.getSequenceNextValString.

Generate the appropriate select statement to to retrieve the next value of a sequence.
public SqlTypeDescriptor
getSqlTypeDescriptorOverride(int
A Types constant indicating the SQL column type
sqlCode
)

Overrides org.hibernate.dialect.Dialect.getSqlTypeDescriptorOverride.

Returns the SqlTypeDescriptor that should be used to handle the given JDBC type code.
public ViolatedConstraintNameExtracter
public String
getWriteLockString(int
in milliseconds, -1 for indefinite wait and 0 for no wait.
timeout
)

Overrides org.hibernate.dialect.Dialect.getWriteLockString.

Get the string to append to SELECT statements to acquire WRITE locks for this dialect.
public String
getWriteLockString(String
The columns to be read locked.
aliases
,
int
in milliseconds, -1 for indefinite wait and 0 for no wait.
timeout
)

Overrides org.hibernate.dialect.Dialect.getWriteLockString.

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.
public boolean
public boolean
qualifyIndexName()

Overrides org.hibernate.dialect.Dialect.qualifyIndexName.

Do we need to qualify index names with the schema name?
public String
renderOrderByElement(String
The SQL order expression. In case of @OrderBy annotation user receives property placeholder (e.g. attribute name enclosed in '{' and '}' signs).
expression
,
String
Collation string in format collate IDENTIFIER, or null if expression has not been explicitly specified.
collation
,
String
Order direction. Possible values: asc, desc, or null if expression has not been explicitly specified.
order
,
NullPrecedence
Nulls precedence. Default value: NullPrecedence#NONE.
nulls
)

Overrides org.hibernate.dialect.Dialect.renderOrderByElement.

Renders an ordering fragment
public boolean
requiresParensForTupleDistinctCounts()

Overrides org.hibernate.dialect.Dialect.requiresParensForTupleDistinctCounts.

If supportsTupleDistinctCounts() is true, does the Dialect require the tuple to be wrapped with parens?
public boolean
supportsCaseInsensitiveLike()

Overrides org.hibernate.dialect.Dialect.supportsCaseInsensitiveLike.

Does this dialect support case insensitive LIKE restrictions?
public boolean
supportsCommentOn()

Overrides org.hibernate.dialect.Dialect.supportsCommentOn.

Does this dialect/database support commenting on tables, columns, etc?
public boolean
supportsCurrentTimestampSelection()

Overrides org.hibernate.dialect.Dialect.supportsCurrentTimestampSelection.

Does this dialect support a way to retrieve the database's current timestamp value?
public boolean
supportsEmptyInList()

Overrides org.hibernate.dialect.Dialect.supportsEmptyInList.

Does this dialect support empty IN lists?
public boolean
supportsExpectedLobUsagePattern()

Overrides org.hibernate.dialect.Dialect.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...
public boolean
supportsIfExistsAfterAlterTable()

Overrides org.hibernate.dialect.Dialect.supportsIfExistsAfterAlterTable.

For an "alter table", can the phrase "if exists" be applied?
public boolean
supportsIfExistsBeforeTableName()

Overrides org.hibernate.dialect.Dialect.supportsIfExistsBeforeTableName.

For dropping a table, can the phrase "if exists" be applied before the table name?
public boolean
supportsJdbcConnectionLobCreation(DatabaseMetaData
JDBC DatabaseMetaData which can be used if LOB creation is supported only starting from a given Driver version
databaseMetaData
)

Overrides org.hibernate.dialect.Dialect.supportsJdbcConnectionLobCreation.

Check whether the JDBC Connection supports creating LOBs via Connection#createBlob(), Connection#createNClob() or Connection#createClob().
public boolean
supportsLimit()

Overrides org.hibernate.dialect.Dialect.supportsLimit.

Does this dialect support some form of limiting query results via a SQL clause?
public boolean
supportsLobValueChangePropogation()

Overrides org.hibernate.dialect.Dialect.supportsLobValueChangePropogation.

Does the dialect support propagating changes to LOB values back to the database?
public boolean
supportsLockTimeouts()

Overrides org.hibernate.dialect.Dialect.supportsLockTimeouts.

Informational metadata about whether this dialect is known to support specifying timeouts for requested lock acquisitions.
public boolean
supportsNationalizedTypes()

Overrides org.hibernate.dialect.Dialect.supportsNationalizedTypes.

Does this dialect supports Nationalized Types
public boolean
supportsNonQueryWithCTE()

Overrides org.hibernate.dialect.Dialect.supportsNonQueryWithCTE.

Does this dialect/database support non-query statements (e.g. INSERT, UPDATE, DELETE) with CTE (Common Table Expressions)?
public boolean
supportsNoWait()

Overrides org.hibernate.dialect.Dialect.supportsNoWait.

Does this dialect/database support NO_WAIT timeout.
public boolean
supportsOuterJoinForUpdate()

Overrides org.hibernate.dialect.Dialect.supportsOuterJoinForUpdate.

Does this dialect support FOR UPDATE in conjunction with outer joined rows?
public boolean
supportsPartitionBy()

Overrides org.hibernate.dialect.Dialect.supportsPartitionBy.

Does the underlying database support partition by
public boolean
supportsPooledSequences()

Overrides org.hibernate.dialect.Dialect.supportsPooledSequences.

Does this dialect support "pooled" sequences.
public boolean
supportsRowValueConstructorSyntax()

Overrides org.hibernate.dialect.Dialect.supportsRowValueConstructorSyntax.

Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax; sometimes called tuple syntax.
public boolean
supportsRowValueConstructorSyntaxInInList()

Overrides org.hibernate.dialect.Dialect.supportsRowValueConstructorSyntaxInInList.

If the dialect supports row values, does it offer such support in IN lists as well?
public boolean
public boolean
supportsSequences()

Overrides org.hibernate.dialect.Dialect.supportsSequences.

Does this dialect support sequences?
public boolean
supportsSkipLocked()

Overrides org.hibernate.dialect.Dialect.supportsSkipLocked.

Does this dialect/database support SKIP_LOCKED timeout.
public boolean
supportsUnboundedLobLocatorMaterialization()

Overrides org.hibernate.dialect.Dialect.supportsUnboundedLobLocatorMaterialization.

Is it supported to materialize a LOB locator outside the transaction in which it was created?
public boolean
supportsUnionAll()

Overrides org.hibernate.dialect.Dialect.supportsUnionAll.

Does this dialect support UNION ALL, which is generally a faster variant of UNION?
public boolean
supportsValuesList()

Overrides org.hibernate.dialect.Dialect.supportsValuesList.

Does this dialect/database support VALUES list (e.g. VALUES (1), (2), (3) )
public String
toBooleanValueString(boolean
The boolean value
bool
)

Overrides org.hibernate.dialect.Dialect.toBooleanValueString.

The SQL literal value to which this database maps boolean values.
public boolean
useInputStreamToInsertBlob()

Overrides org.hibernate.dialect.Dialect.useInputStreamToInsertBlob.

Should LOBs (both BLOB and CLOB) be bound using stream operations (i.e. PreparedStatement#setBinaryStream).
Inherited from org.hibernate.dialect.Dialect:
addSqlHintOrCommentappendLockHintappendLockHintapplyLocksToSqlareStringComparisonsCaseInsensitiveaugmentPhysicalTableTypesaugmentRecognizedTableTypesbindLimitParametersFirstbuildSQLExceptionConvertercanCreateCatalogcastcastcastcloseQuoteconvertToFirstRowValuecreateCaseFragmentcreateOuterJoinFragmentdefaultScrollModedoesRepeatableReadCauseReadersToBlockWritersequivalentTypesescapeCommentescapeLiteralforceLimitUsageforceLobAsLastValueforUpdateOfColumnsgetAddColumnSuffixStringgetAddForeignKeyConstraintStringgetAddForeignKeyConstraintStringgetAddPrimaryKeyConstraintStringgetAddUniqueConstraintStringgetAlterTableStringgetAuxiliaryDatabaseObjectExportergetCallableStatementSupportgetCastTypeNamegetColumnAliasExtractorgetColumnCommentgetCreateCatalogCommandgetCreateMultisetTableStringgetCreateSchemaCommandgetCreateSequenceStringsgetCreateSequenceStringsgetCreateTableStringgetCreateTemporaryTableColumnAnnotationgetCrossJoinSeparatorgetCurrentSchemaCommandgetCurrentTimestampSQLFunctionNamegetDefaultBatchLoadSizingStrategygetDefaultPropertiesgetDialectgetDialectgetDropCatalogCommandgetDropForeignKeyStringgetDropSchemaCommandgetDropSequenceStringsgetDropTableStringgetForeignKeyExportergetForUpdateStringgetForUpdateStringgetFunctionsgetHibernateTypeNamegetHibernateTypeNamegetIndexExportergetInExpressionCountLimitgetKeywordsgetLimitStringgetLobMergeStrategygetLockingStrategygetLowercaseFunctiongetMaxAliasLengthgetNativeIdentifierGeneratorClassgetNotExpressiongetNullColumnStringgetQueryHintStringgetQueryHintStringgetResultSetgetResultSetgetResultSetgetSchemaNameResolvergetSelectGUIDStringgetSequenceExportergetSequenceInformationExtractorgetTableCommentgetTableExportergetTableTypeStringgetTypeNamegetTypeNamegetUniqueDelegategetUniqueKeyExporterhasAlterTablehasSelfReferentialForeignKeyBuginlineLiteralisJdbcLogWarningsEnabledByDefaultisLegacyLimitHandlerBehaviorEnabledisLockTimeoutParameterizedisTypeNameRegisteredopenQuoteprependCommentquoteregisterColumnTyperegisterColumnTyperegisterFunctionregisterHibernateTyperegisterHibernateTyperegisterKeywordregisterResultSetOutParameterregisterResultSetOutParameterremapSqlTypeDescriptorreplaceResultVariableInOrderByClauseWithPositionrequiresCastingOfParametersInSelectClausesupportsBindAsCallableArgumentsupportsCascadeDeletesupportsCircularCascadeDeleteConstraintssupportsColumnChecksupportsExistsInSelectsupportsIfExistsAfterConstraintNamesupportsIfExistsAfterTableNamesupportsIfExistsBeforeConstraintNamesupportsLimitOffsetsupportsNamedParameterssupportsNoColumnsInsertsupportsNotNullUniquesupportsParametersInInsertSelectsupportsResultSetPositionQueryMethodsOnForwardOnlyCursorsupportsRowValueConstructorSyntaxInSetsupportsSubqueryOnMutatingTablesupportsSubselectAsInPredicateLHSsupportsTableChecksupportsTupleCountssupportsTupleDistinctCountssupportsTuplesInSubqueriessupportsUniquesupportsUniqueConstraintInCreateAlterTablesupportsVariableLimittoStringtransformSelectStringuseFollowOnLockinguseFollowOnLockinguseMaxForLimit