Package org.hibernate.dialect
Class CockroachDB192Dialect
- java.lang.Object
-
- org.hibernate.dialect.Dialect
-
- org.hibernate.dialect.CockroachDB192Dialect
-
- All Implemented Interfaces:
ConversionContext
- Direct Known Subclasses:
CockroachDB201Dialect
public class CockroachDB192Dialect extends Dialect
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
-
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, TWO_SINGLE_QUOTES_REPLACEMENT
-
-
Constructor Summary
Constructors Constructor Description CockroachDB192Dialect()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanbindLimitParametersInReverseOrder()ANSI SQL defines the LIMIT clause to be in the form LIMIT offset, limit.IdentifierHelperbuildIdentifierHelper(IdentifierHelperBuilder builder, java.sql.DatabaseMetaData dbMetaData)Build the IdentifierHelper indicated by this Dialect for handling identifier conversions.SQLExceptionConversionDelegatebuildSQLExceptionConversionDelegate()Build an instance of aSQLExceptionConversionDelegatefor interpreting dialect-specific error or SQLState codes.booleancanCreateSchema()Does this dialect support schema creation?voidcontributeTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry)Allows the Dialect to contribute additional typesbooleandoesReadCommittedCauseWritersToBlockReaders()For the underlying database, is READ_COMMITTED isolation implemented by forcing readers to wait for write locks to be released?booleandropConstraints()Do we need to drop constraints before dropping tables in this dialect?java.lang.StringgetAddColumnString()The syntax used to add a column to a table (optional).java.lang.StringgetCascadeConstraintsString()Completely optional cascading drop clausejava.lang.StringgetCaseInsensitiveLike()The name of the SQL function that can do case insensitive like comparison.java.lang.StringgetCreateSequenceString(java.lang.String sequenceName)Typically dialects which support sequences can create a sequence with a single command.protected java.lang.StringgetCreateSequenceString(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.StringgetCurrentTimestampSelectString()Retrieve the command used to retrieve the current timestamp from the database.MultiTableBulkIdStrategygetDefaultMultiTableBulkIdStrategy()java.lang.StringgetDropSequenceString(java.lang.String sequenceName)Typically dialects which support sequences can drop a sequence with a single command.java.lang.StringgetForUpdateNowaitString()Retrieves the FOR UPDATE NOWAIT syntax specific to this dialect.java.lang.StringgetForUpdateNowaitString(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.StringgetForUpdateSkipLockedString()Retrieves the FOR UPDATE SKIP LOCKED syntax specific to this dialect.java.lang.StringgetForUpdateSkipLockedString(java.lang.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.java.lang.StringgetForUpdateString()Get the string to append to SELECT statements to acquire locks for this dialect.java.lang.StringgetForUpdateString(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.StringgetForUpdateString(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.IdentityColumnSupportgetIdentityColumnSupport()Get the appropriateIdentityColumnSupportLimitHandlergetLimitHandler()Returns the delegate managing LIMIT clause.java.lang.StringgetLimitString(java.lang.String sql, boolean hasOffset)Apply a limit clause to the query.NameQualifierSupportgetNameQualifierSupport()By default interpret this based on DatabaseMetaData.java.lang.StringgetNativeIdentifierGeneratorStrategy()Resolves the native generation strategy associated to this dialect.java.lang.StringgetNoColumnsInsertString()The fragment used to insert a row without specifying any column values.java.lang.StringgetQuerySequencesString()Get the select command used retrieve the names of all sequences.java.lang.StringgetReadLockString(int timeout)Get the string to append to SELECT statements to acquire READ locks for this dialect.java.lang.StringgetReadLockString(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.StringgetSelectClauseNullString(int sqlType)Given aTypestype code, determine an appropriate null value to use in a select clause.java.lang.StringgetSelectSequenceNextValString(java.lang.String sequenceName)Generate the select expression fragment that will retrieve the next value of a sequence as part of another (typically DML) statement.java.lang.StringgetSequenceNextValString(java.lang.String sequenceName)Generate the appropriate select statement to to retrieve the next value of a sequence.SqlTypeDescriptorgetSqlTypeDescriptorOverride(int sqlCode)Returns theSqlTypeDescriptorthat should be used to handle the given JDBC type code.ViolatedConstraintNameExtractergetViolatedConstraintNameExtracter()java.lang.StringgetWriteLockString(int timeout)Get the string to append to SELECT statements to acquire WRITE locks for this dialect.java.lang.StringgetWriteLockString(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.booleanisCurrentTimestampSelectStringCallable()Should the value returned byDialect.getCurrentTimestampSelectString()be treated as callable.booleanqualifyIndexName()Do we need to qualify index names with the schema name?java.lang.StringrenderOrderByElement(java.lang.String expression, java.lang.String collation, java.lang.String order, NullPrecedence nulls)Renders an ordering fragmentbooleanrequiresParensForTupleDistinctCounts()IfDialect.supportsTupleDistinctCounts()is true, does the Dialect require the tuple to be wrapped with parens?booleansupportsCaseInsensitiveLike()Does this dialect support case insensitive LIKE restrictions?booleansupportsCommentOn()Does this dialect/database support commenting on tables, columns, etc?booleansupportsCurrentTimestampSelection()Does this dialect support a way to retrieve the database's current timestamp value?booleansupportsEmptyInList()Does this dialect support empty IN lists?booleansupportsExpectedLobUsagePattern()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...booleansupportsIfExistsAfterAlterTable()For an "alter table", can the phrase "if exists" be applied?booleansupportsIfExistsBeforeTableName()For dropping a table, can the phrase "if exists" be applied before the table name?booleansupportsJdbcConnectionLobCreation(java.sql.DatabaseMetaData databaseMetaData)Check whether the JDBCConnectionsupports creating LOBs viaConnection.createBlob(),Connection.createNClob()orConnection.createClob().booleansupportsLimit()Does this dialect support some form of limiting query results via a SQL clause?booleansupportsLobValueChangePropogation()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...booleansupportsLockTimeouts()Informational metadata about whether this dialect is known to support specifying timeouts for requested lock acquisitions.booleansupportsNationalizedTypes()Does this dialect supports Nationalized TypesbooleansupportsNonQueryWithCTE()Does this dialect/database support non-query statements (e.g.booleansupportsNoWait()Does this dialect/database support NO_WAIT timeout.booleansupportsOuterJoinForUpdate()Does this dialect support FOR UPDATE in conjunction with outer joined rows?booleansupportsPartitionBy()Does the underlying database support partition bybooleansupportsPooledSequences()Does this dialect support "pooled" sequences.booleansupportsRowValueConstructorSyntax()Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax; sometimes called tuple syntax.booleansupportsRowValueConstructorSyntaxInInList()If the dialect supportsrow values, does it offer such support in IN lists as well?booleansupportsSelectAliasInGroupByClause()booleansupportsSequences()Does this dialect support sequences?booleansupportsSkipLocked()Does this dialect/database support SKIP_LOCKED timeout.booleansupportsUnboundedLobLocatorMaterialization()Is it supported to materialize a LOB locator outside the transaction in which it was created?booleansupportsUnionAll()Does this dialect support UNION ALL, which is generally a faster variant of UNION?booleansupportsValuesList()Does this dialect/database support VALUES list (e.g.java.lang.StringtoBooleanValueString(boolean bool)The SQL literal value to which this database maps boolean values.booleanuseInputStreamToInsertBlob()Should LOBs (both BLOB and CLOB) be bound using stream operations (i.e.-
Methods inherited from class org.hibernate.dialect.Dialect
addSqlHintOrComment, appendLockHint, appendLockHint, applyLocksToSql, areStringComparisonsCaseInsensitive, augmentPhysicalTableTypes, augmentRecognizedTableTypes, bindLimitParametersFirst, 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, 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, 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, useMaxForLimit
-
-
-
-
Method Detail
-
getSqlTypeDescriptorOverride
public SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode)
Description copied from class:DialectReturns theSqlTypeDescriptorthat should be used to handle the given JDBC type code. Returnsnullif there is no override.- Overrides:
getSqlTypeDescriptorOverridein classDialect- Parameters:
sqlCode- ATypesconstant indicating the SQL column type- Returns:
- The
SqlTypeDescriptorto use as an override, ornullif there is no override.
-
getAddColumnString
public java.lang.String getAddColumnString()
Description copied from class:DialectThe syntax used to add a column to a table (optional).- Overrides:
getAddColumnStringin classDialect- Returns:
- The "add column" fragment.
-
getSequenceNextValString
public java.lang.String getSequenceNextValString(java.lang.String sequenceName)
Description copied from class:DialectGenerate the appropriate select statement to to retrieve the next value of a sequence. This should be a "stand alone" select statement.- Overrides:
getSequenceNextValStringin classDialect- Parameters:
sequenceName- the name of the sequence- Returns:
- String The "nextval" select string.
-
getSelectSequenceNextValString
public java.lang.String getSelectSequenceNextValString(java.lang.String sequenceName)
Description copied from class:DialectGenerate the select expression fragment that will retrieve the next value of a sequence as part of another (typically DML) statement. This differs fromDialect.getSequenceNextValString(String)in that this should return an expression usable within another statement.- Overrides:
getSelectSequenceNextValStringin classDialect- Parameters:
sequenceName- the name of the sequence- Returns:
- The "nextval" fragment.
-
getCreateSequenceString
public java.lang.String getCreateSequenceString(java.lang.String sequenceName)
Description copied from class:DialectTypically dialects which support sequences can create a sequence with a single command. This is convenience form ofDialect.getCreateSequenceStrings(java.lang.String)to help facilitate that. Dialects which support sequences and can create a sequence in a single command need *only* override this method. Dialects which support sequences but require multiple commands to create a sequence should instead overrideDialect.getCreateSequenceStrings(java.lang.String).- Overrides:
getCreateSequenceStringin classDialect- Parameters:
sequenceName- The name of the sequence- Returns:
- The sequence creation command
-
getCascadeConstraintsString
public java.lang.String getCascadeConstraintsString()
Description copied from class:DialectCompletely optional cascading drop clause- Overrides:
getCascadeConstraintsStringin classDialect- Returns:
- String
-
dropConstraints
public boolean dropConstraints()
Description copied from class:DialectDo we need to drop constraints before dropping tables in this dialect?- Overrides:
dropConstraintsin classDialect- Returns:
- True if constraints must be dropped prior to dropping the table; false otherwise.
-
supportsSequences
public boolean supportsSequences()
Description copied from class:DialectDoes this dialect support sequences?- Overrides:
supportsSequencesin classDialect- Returns:
- True if sequences supported; false otherwise.
-
getQuerySequencesString
public java.lang.String getQuerySequencesString()
Description copied from class:DialectGet the select command used retrieve the names of all sequences.- Overrides:
getQuerySequencesStringin classDialect- Returns:
- The select command; or null if sequences are not supported.
- See Also:
SchemaUpdate
-
getLimitHandler
public LimitHandler getLimitHandler()
Description copied from class:DialectReturns the delegate managing LIMIT clause.- Overrides:
getLimitHandlerin classDialect- Returns:
- LIMIT clause delegate.
-
supportsLimit
public boolean supportsLimit()
Description copied from class:DialectDoes this dialect support some form of limiting query results via a SQL clause?- Overrides:
supportsLimitin classDialect- Returns:
- True if this dialect supports some form of LIMIT.
-
getLimitString
public java.lang.String getLimitString(java.lang.String sql, boolean hasOffset)Description copied from class:DialectApply a limit clause to the query. Typically dialects utilizevariablelimit 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 andDialect.getLimitString(String, int, int).- Overrides:
getLimitStringin classDialect- Parameters:
sql- The query to which to apply the limit.hasOffset- Is the query requesting an offset?- Returns:
- the modified SQL
-
bindLimitParametersInReverseOrder
public boolean bindLimitParametersInReverseOrder()
Description copied from class:DialectANSI 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:
bindLimitParametersInReverseOrderin classDialect- Returns:
- true if the correct order is limit, offset
-
renderOrderByElement
public java.lang.String renderOrderByElement(java.lang.String expression, java.lang.String collation, java.lang.String order, NullPrecedence nulls)Description copied from class:DialectRenders an ordering fragment- Overrides:
renderOrderByElementin classDialect- Parameters:
expression- The SQL order expression. In case of@OrderByannotation user receives property placeholder (e.g. attribute name enclosed in '{' and '}' signs).collation- Collation string in formatcollate IDENTIFIER, ornullif expression has not been explicitly specified.order- Order direction. Possible values:asc,desc, ornullif expression has not been explicitly specified.nulls- Nulls precedence. Default value:NullPrecedence.NONE.- Returns:
- Renders single element of
ORDER BYclause.
-
getForUpdateString
public java.lang.String getForUpdateString(java.lang.String aliases)
Description copied from class:DialectGet the FOR UPDATE OF column_list fragment appropriate for this dialect given the aliases of the columns to be write locked.- Overrides:
getForUpdateStringin 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:DialectGet the FOR UPDATE OF column_list fragment appropriate for this dialect given the aliases of the columns to be write locked.- Overrides:
getForUpdateStringin 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.
-
getNoColumnsInsertString
public java.lang.String getNoColumnsInsertString()
Description copied from class:DialectThe fragment used to insert a row without specifying any column values. This is not possible on some databases.- Overrides:
getNoColumnsInsertStringin classDialect- Returns:
- The appropriate empty values clause.
-
getCaseInsensitiveLike
public java.lang.String getCaseInsensitiveLike()
Description copied from class:DialectThe name of the SQL function that can do case insensitive like comparison.- Overrides:
getCaseInsensitiveLikein classDialect- Returns:
- The dialect-specific "case insensitive" like function.
-
supportsCaseInsensitiveLike
public boolean supportsCaseInsensitiveLike()
Description copied from class:DialectDoes this dialect support case insensitive LIKE restrictions?- Overrides:
supportsCaseInsensitiveLikein classDialect- Returns:
trueif the underlying database supports case insensitive like comparison,falseotherwise. The default isfalse.
-
getNativeIdentifierGeneratorStrategy
public java.lang.String getNativeIdentifierGeneratorStrategy()
Description copied from class:DialectResolves the native generation strategy associated to this dialect. Comes into play whenever the user specifies the native generator.- Overrides:
getNativeIdentifierGeneratorStrategyin classDialect- Returns:
- The native generator strategy.
-
supportsOuterJoinForUpdate
public boolean supportsOuterJoinForUpdate()
Description copied from class:DialectDoes this dialect support FOR UPDATE in conjunction with outer joined rows?- Overrides:
supportsOuterJoinForUpdatein classDialect- Returns:
- True if outer joined rows can be locked via FOR UPDATE.
-
useInputStreamToInsertBlob
public boolean useInputStreamToInsertBlob()
Description copied from class:DialectShould LOBs (both BLOB and CLOB) be bound using stream operations (i.e.PreparedStatement.setBinaryStream(int, java.io.InputStream, int)).- Overrides:
useInputStreamToInsertBlobin classDialect- Returns:
- True if BLOBs and CLOBs should be bound using stream operations.
-
supportsUnionAll
public boolean supportsUnionAll()
Description copied from class:DialectDoes this dialect support UNION ALL, which is generally a faster variant of UNION?- Overrides:
supportsUnionAllin classDialect- Returns:
- True if UNION ALL is supported; false otherwise.
-
getSelectClauseNullString
public java.lang.String getSelectClauseNullString(int sqlType)
Description copied from class:DialectGiven aTypestype 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.- Overrides:
getSelectClauseNullStringin classDialect- Parameters:
sqlType- TheTypestype code.- Returns:
- The appropriate select clause value fragment.
-
supportsCommentOn
public boolean supportsCommentOn()
Description copied from class:DialectDoes this dialect/database support commenting on tables, columns, etc?- Overrides:
supportsCommentOnin classDialect- Returns:
trueif commenting is supported
-
supportsCurrentTimestampSelection
public boolean supportsCurrentTimestampSelection()
Description copied from class:DialectDoes this dialect support a way to retrieve the database's current timestamp value?- Overrides:
supportsCurrentTimestampSelectionin classDialect- Returns:
- True if the current timestamp can be retrieved; false otherwise.
-
isCurrentTimestampSelectStringCallable
public boolean isCurrentTimestampSelectStringCallable()
Description copied from class:DialectShould the value returned byDialect.getCurrentTimestampSelectString()be treated as callable. Typically this indicates that JDBC escape syntax is being used...- Overrides:
isCurrentTimestampSelectStringCallablein classDialect- Returns:
- True if the
Dialect.getCurrentTimestampSelectString()return is callable; false otherwise.
-
getCurrentTimestampSelectString
public java.lang.String getCurrentTimestampSelectString()
Description copied from class:DialectRetrieve the command used to retrieve the current timestamp from the database.- Overrides:
getCurrentTimestampSelectStringin classDialect- Returns:
- The command.
-
requiresParensForTupleDistinctCounts
public boolean requiresParensForTupleDistinctCounts()
Description copied from class:DialectIfDialect.supportsTupleDistinctCounts()is true, does the Dialect require the tuple to be wrapped with parens?- Overrides:
requiresParensForTupleDistinctCountsin classDialect- Returns:
- boolean
-
toBooleanValueString
public java.lang.String toBooleanValueString(boolean bool)
Description copied from class:DialectThe SQL literal value to which this database maps boolean values.- Overrides:
toBooleanValueStringin classDialect- Parameters:
bool- The boolean value- Returns:
- The appropriate SQL literal.
-
getViolatedConstraintNameExtracter
public ViolatedConstraintNameExtracter getViolatedConstraintNameExtracter()
- Specified by:
getViolatedConstraintNameExtracterin interfaceConversionContext- Overrides:
getViolatedConstraintNameExtracterin classDialect
-
buildSQLExceptionConversionDelegate
public SQLExceptionConversionDelegate buildSQLExceptionConversionDelegate()
Description copied from class:DialectBuild an instance of aSQLExceptionConversionDelegatefor interpreting dialect-specific error or SQLState codes. WhenDialect.buildSQLExceptionConverter()returns null, the defaultSQLExceptionConverteris used to interpret SQLState and error codes. If this method is overridden to return a non-null value, the defaultSQLExceptionConverterwill use the returnedSQLExceptionConversionDelegatein 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:
buildSQLExceptionConversionDelegatein classDialect- Returns:
- The SQLExceptionConversionDelegate for this dialect
-
supportsPooledSequences
public boolean supportsPooledSequences()
Description copied from class:DialectDoes this dialect support "pooled" sequences. Not aware of a better name for this. Essentially can we specify the initial and increment values?- Overrides:
supportsPooledSequencesin classDialect- Returns:
- True if such "pooled" sequences are supported; false otherwise.
- See Also:
Dialect.getCreateSequenceStrings(String, int, int),Dialect.getCreateSequenceString(String, int, int)
-
getCreateSequenceString
protected java.lang.String getCreateSequenceString(java.lang.String sequenceName, int initialValue, int incrementSize)Description copied from class:DialectOverloaded 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:
getCreateSequenceStringin 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
-
supportsEmptyInList
public boolean supportsEmptyInList()
Description copied from class:DialectDoes this dialect support empty IN lists? For example, is [where XYZ in ()] a supported construct?- Overrides:
supportsEmptyInListin classDialect- Returns:
- True if empty in lists are supported; false otherwise.
-
supportsExpectedLobUsagePattern
public boolean supportsExpectedLobUsagePattern()
Description copied from class:DialectExpected 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:
supportsExpectedLobUsagePatternin classDialect- Returns:
- True if normal LOB usage patterns can be used with this driver; false if driver-specific hookiness needs to be applied.
-
supportsLobValueChangePropogation
public boolean supportsLobValueChangePropogation()
Description copied from class:DialectDoes 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... For BLOBs, the internal value might be changed by:Blob.setBinaryStream(long),Blob.setBytes(long, byte[]),Blob.setBytes(long, byte[], int, int), orBlob.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), orClob.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 notDialect.supportsExpectedLobUsagePattern().- Overrides:
supportsLobValueChangePropogationin classDialect- Returns:
- True if the changes are propagated back to the database; false otherwise.
-
supportsUnboundedLobLocatorMaterialization
public boolean supportsUnboundedLobLocatorMaterialization()
Description copied from class:DialectIs 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:
supportsUnboundedLobLocatorMaterializationin classDialect- Returns:
- True if unbounded materialization is supported; false otherwise.
-
supportsRowValueConstructorSyntax
public boolean supportsRowValueConstructorSyntax()
Description copied from class:DialectIs 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:
supportsRowValueConstructorSyntaxin classDialect- Returns:
- True if this SQL dialect is known to support "row value constructor" syntax; false otherwise.
-
qualifyIndexName
public boolean qualifyIndexName()
Description copied from class:DialectDo we need to qualify index names with the schema name?- Overrides:
qualifyIndexNamein classDialect- Returns:
- boolean
-
supportsNationalizedTypes
public boolean supportsNationalizedTypes()
Description copied from class:DialectDoes this dialect supports Nationalized Types- Overrides:
supportsNationalizedTypesin classDialect- Returns:
- boolean
-
supportsJdbcConnectionLobCreation
public boolean supportsJdbcConnectionLobCreation(java.sql.DatabaseMetaData databaseMetaData)
Description copied from class:DialectCheck whether the JDBCConnectionsupports creating LOBs viaConnection.createBlob(),Connection.createNClob()orConnection.createClob().- Overrides:
supportsJdbcConnectionLobCreationin classDialect- Parameters:
databaseMetaData- JDBCDatabaseMetaDatawhich can be used if LOB creation is supported only starting from a given Driver version- Returns:
trueif LOBs can be created via the JDBC Connection.
-
supportsSelectAliasInGroupByClause
public boolean supportsSelectAliasInGroupByClause()
- Overrides:
supportsSelectAliasInGroupByClausein classDialect
-
supportsIfExistsBeforeTableName
public boolean supportsIfExistsBeforeTableName()
Description copied from class:DialectFor dropping a table, can the phrase "if exists" be applied before the table name? NOTE : Only one or the other (or neither) of this andDialect.supportsIfExistsAfterTableName()should return true- Overrides:
supportsIfExistsBeforeTableNamein classDialect- Returns:
trueif the "if exists" can be applied before the table name
-
contributeTypes
public void contributeTypes(TypeContributions typeContributions, ServiceRegistry serviceRegistry)
Description copied from class:DialectAllows the Dialect to contribute additional types- Overrides:
contributeTypesin classDialect- Parameters:
typeContributions- Callback to contribute the typesserviceRegistry- The service registry
-
getDropSequenceString
public java.lang.String getDropSequenceString(java.lang.String sequenceName)
Description copied from class:DialectTypically dialects which support sequences can drop a sequence with a single command. This is convenience form ofDialect.getDropSequenceStrings(java.lang.String)to help facilitate that. Dialects which support sequences and can drop a sequence in a single command need *only* override this method. Dialects which support sequences but require multiple commands to drop a sequence should instead overrideDialect.getDropSequenceStrings(java.lang.String).- Overrides:
getDropSequenceStringin classDialect- Parameters:
sequenceName- The name of the sequence- Returns:
- The sequence drop commands
-
supportsValuesList
public boolean supportsValuesList()
Description copied from class:DialectDoes this dialect/database support VALUES list (e.g. VALUES (1), (2), (3) )- Overrides:
supportsValuesListin classDialect- Returns:
trueif VALUES list are supported
-
supportsRowValueConstructorSyntaxInInList
public boolean supportsRowValueConstructorSyntaxInInList()
Description copied from class:DialectIf the dialect supportsrow values, does it offer such support in IN lists as well? For example, "... where (FIRST_NAME, LAST_NAME) IN ( (?, ?), (?, ?) ) ..."- Overrides:
supportsRowValueConstructorSyntaxInInListin classDialect- Returns:
- True if this SQL dialect is known to support "row value constructor" syntax in the IN list; false otherwise.
-
supportsPartitionBy
public boolean supportsPartitionBy()
Description copied from class:DialectDoes the underlying database support partition by- Overrides:
supportsPartitionByin classDialect- Returns:
- boolean
-
supportsNonQueryWithCTE
public boolean supportsNonQueryWithCTE()
Description copied from class:DialectDoes this dialect/database support non-query statements (e.g. INSERT, UPDATE, DELETE) with CTE (Common Table Expressions)?- Overrides:
supportsNonQueryWithCTEin classDialect- Returns:
trueif non-query statements are supported with CTE
-
supportsIfExistsAfterAlterTable
public boolean supportsIfExistsAfterAlterTable()
Description copied from class:DialectFor an "alter table", can the phrase "if exists" be applied?- Overrides:
supportsIfExistsAfterAlterTablein classDialect- Returns:
trueif the "if exists" can be applied after ALTER TABLE
-
getForUpdateString
public java.lang.String getForUpdateString()
Description copied from class:DialectGet the string to append to SELECT statements to acquire locks for this dialect.- Overrides:
getForUpdateStringin classDialect- Returns:
- The appropriate FOR UPDATE clause string.
-
getWriteLockString
public java.lang.String getWriteLockString(int timeout)
Description copied from class:DialectGet the string to append to SELECT statements to acquire WRITE locks for this dialect. Location of the returned string is treated the same as getForUpdateString.- Overrides:
getWriteLockStringin 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:DialectGet 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:
getWriteLockStringin 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.
-
getReadLockString
public java.lang.String getReadLockString(int timeout)
Description copied from class:DialectGet the string to append to SELECT statements to acquire READ locks for this dialect. Location of the returned string is treated the same as getForUpdateString.- Overrides:
getReadLockStringin 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:DialectGet 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 returned string is treated the same as getForUpdateString.- Overrides:
getReadLockStringin 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.
-
getForUpdateSkipLockedString
public java.lang.String getForUpdateSkipLockedString()
Description copied from class:DialectRetrieves the FOR UPDATE SKIP LOCKED syntax specific to this dialect.- Overrides:
getForUpdateSkipLockedStringin classDialect- Returns:
- The appropriate FOR UPDATE SKIP LOCKED clause string.
-
getForUpdateSkipLockedString
public java.lang.String getForUpdateSkipLockedString(java.lang.String aliases)
Description copied from class:DialectGet the FOR UPDATE OF column_list SKIP LOCKED fragment appropriate for this dialect given the aliases of the columns to be write locked.- Overrides:
getForUpdateSkipLockedStringin classDialect- Parameters:
aliases- The columns to be write locked.- Returns:
- The appropriate FOR UPDATE colunm_list SKIP LOCKED clause string.
-
getForUpdateNowaitString
public java.lang.String getForUpdateNowaitString()
Description copied from class:DialectRetrieves the FOR UPDATE NOWAIT syntax specific to this dialect.- Overrides:
getForUpdateNowaitStringin classDialect- Returns:
- The appropriate FOR UPDATE NOWAIT clause string.
-
getForUpdateNowaitString
public java.lang.String getForUpdateNowaitString(java.lang.String aliases)
Description copied from class:DialectGet the FOR UPDATE OF column_list NOWAIT fragment appropriate for this dialect given the aliases of the columns to be write locked.- Overrides:
getForUpdateNowaitStringin classDialect- Parameters:
aliases- The columns to be write locked.- Returns:
- The appropriate FOR UPDATE OF colunm_list NOWAIT clause string.
-
supportsLockTimeouts
public boolean supportsLockTimeouts()
Description copied from class:DialectInformational metadata about whether this dialect is known to support specifying timeouts for requested lock acquisitions.- Overrides:
supportsLockTimeoutsin classDialect- Returns:
- True is this dialect supports specifying lock timeouts.
-
supportsSkipLocked
public boolean supportsSkipLocked()
Description copied from class:DialectDoes this dialect/database support SKIP_LOCKED timeout.- Overrides:
supportsSkipLockedin classDialect- Returns:
trueif SKIP_LOCKED is supported
-
supportsNoWait
public boolean supportsNoWait()
Description copied from class:DialectDoes this dialect/database support NO_WAIT timeout.- Overrides:
supportsNoWaitin classDialect- Returns:
trueif NO_WAIT is supported
-
getIdentityColumnSupport
public IdentityColumnSupport getIdentityColumnSupport()
Description copied from class:DialectGet the appropriateIdentityColumnSupport- Overrides:
getIdentityColumnSupportin classDialect- Returns:
- the IdentityColumnSupport
-
getDefaultMultiTableBulkIdStrategy
public MultiTableBulkIdStrategy getDefaultMultiTableBulkIdStrategy()
- Overrides:
getDefaultMultiTableBulkIdStrategyin classDialect
-
doesReadCommittedCauseWritersToBlockReaders
public boolean doesReadCommittedCauseWritersToBlockReaders()
Description copied from class:DialectFor the underlying database, is READ_COMMITTED isolation implemented by forcing readers to wait for write locks to be released?- Overrides:
doesReadCommittedCauseWritersToBlockReadersin classDialect- Returns:
- True if writers block readers to achieve READ_COMMITTED; false otherwise.
-
canCreateSchema
public boolean canCreateSchema()
Description copied from class:DialectDoes this dialect support schema creation?- Overrides:
canCreateSchemain classDialect- Returns:
- True if the dialect supports schema creation; false otherwise.
-
getNameQualifierSupport
public NameQualifierSupport getNameQualifierSupport()
Description copied from class:DialectBy default interpret this based on DatabaseMetaData.- Overrides:
getNameQualifierSupportin classDialect- Returns:
- The NameQualifierSupport.
-
buildIdentifierHelper
public IdentifierHelper buildIdentifierHelper(IdentifierHelperBuilder builder, java.sql.DatabaseMetaData dbMetaData) throws java.sql.SQLException
Description copied from class:DialectBuild the IdentifierHelper indicated by this Dialect for handling identifier conversions. Returningnullis 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:
buildIdentifierHelperin 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
nullto 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()
-
-