Top Description Inners Fields Constructors Methods
org.hibernate.dialect

public Class SpannerDialect

extends Dialect
Class Inheritance
Imports
java.util.Date, .Map, org.hibernate.LockMode, .LockOptions, .StaleObjectStateException, org.hibernate.boot.Metadata, org.hibernate.boot.model.FunctionContributions, org.hibernate.boot.model.relational.Exportable, .Sequence, .SqlStringGenerationContext, org.hibernate.dialect.function.CommonFunctionFactory, .FormatFunction, org.hibernate.dialect.lock.LockingStrategy, .LockingStrategyException, org.hibernate.dialect.pagination.LimitHandler, .LimitOffsetLimitHandler, org.hibernate.dialect.unique.UniqueDelegate, org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo, org.hibernate.engine.jdbc.env.spi.SchemaNameResolver, org.hibernate.engine.spi.SessionFactoryImplementor, org.hibernate.event.spi.EventSource, org.hibernate.internal.util.collections.ArrayHelper, org.hibernate.mapping.Column, .Constraint, .ForeignKey, .Table, .UniqueKey, org.hibernate.persister.entity.Lockable, org.hibernate.query.SemanticException, org.hibernate.query.sqm.IntervalType, .TemporalUnit, org.hibernate.sql.ast.SqlAstTranslator, .SqlAstTranslatorFactory, org.hibernate.sql.ast.spi.SqlAppender, .StandardSqlAstTranslatorFactory, org.hibernate.sql.ast.tree.Statement, org.hibernate.sql.exec.spi.JdbcOperation, org.hibernate.tool.schema.spi.Exporter, org.hibernate.type.BasicType, .BasicTypeRegistry, .StandardBasicTypes, jakarta.persistence.TemporalType

A SQL dialect for Cloud Spanner.
Authors
Mike Eltsufin, Chengyuan Zhao, Daniel Zou, Dmitry Solomakha

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
SpannerDialect.DoNothingLockingStrategy

A locking strategy for the Cloud Spanner dialect that does nothing.

pack-priv static class
SpannerDialect.DoNothingUniqueDelegate

A no-op delegate for generating Unique-Constraints.

pack-priv static class
SpannerDialect.EmptyExporter<T extends Exportable>

A no-op Exporter which is responsible for returning empty Create and Drop SQL strings.

Field Summary

Modifier and TypeField and Description
private static final LockingStrategy
private static final SpannerDialect.EmptyExporter<T extends Exportable>
private static final UniqueDelegate
private final Exporter<Table>
Inherited from org.hibernate.dialect.Dialect:
CLOSED_QUOTELEGACY_LOB_MERGE_STRATEGYLOG_BASE2OF10NEW_LOCATOR_LOB_MERGE_STRATEGYQUOTESTANDARD_MULTI_KEY_LOAD_SIZING_STRATEGYSTREAM_XFER_LOB_MERGE_STRATEGY

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public void
appendBooleanValueString(SqlAppender
The SqlAppender to append the literal expression to
appender
,
boolean
The boolean value
bool
)

Overrides org.hibernate.dialect.Dialect.appendBooleanValueString.

Append the SQL literal expression representing the given boolean value to the given SqlAppender.
public void
appendDatetimeFormat(SqlAppender appender, String format)

Overrides org.hibernate.dialect.Dialect.appendDatetimeFormat.

Translate the given datetime format string from the pattern language defined by Java's java.time.format.DateTimeFormatter to whatever pattern language is understood by the native datetime formatting function for this database (often the to_char() function).
public String
applyLocksToSql(String
the SQL string to modify
sql
,
LockOptions
lock options indexed by aliased table names.
aliasedLockOptions
,
Map<String, String[]>
a map of key columns indexed by aliased table names.
keyColumnNames
)

Overrides org.hibernate.dialect.Dialect.applyLocksToSql.

Modifies the given SQL, applying the appropriate updates for the specified lock modes and key columns.
public boolean
canCreateSchema()

Overrides org.hibernate.dialect.Dialect.canCreateSchema.

Does this dialect support creating and dropping schema?
protected String
castType(int
The JDBC type code representing the target type
sqlTypeCode
)

Overrides org.hibernate.dialect.Dialect.castType.

The SQL type to use in cast( ...
public char
closeQuote()

Overrides org.hibernate.dialect.Dialect.closeQuote.

The character specific to this dialect used to close a quoted identifier.
protected String
columnType(int
a SQL type code
sqlTypeCode
)

Overrides org.hibernate.dialect.Dialect.columnType.

The database column type name for a given JDBC type code defined in Types or SqlTypes.
public static Replacer
public boolean
dropConstraints()

Overrides org.hibernate.dialect.Dialect.dropConstraints.

Do we need to drop constraints before dropping tables in this dialect?
public String
getAddForeignKeyConstraintString(String
The foreign key constraint name
constraintName
,
String[]
The names of the columns comprising the foreign key
foreignKey
,
String
The table referenced by the foreign key
referencedTable
,
String[]
The explicit columns in the referencedTable referenced by this foreign key.
primaryKey
,
boolean
if false, constraint should be explicit about which column names the constraint refers to
referencesPrimaryKey
)

Overrides org.hibernate.dialect.Dialect.getAddForeignKeyConstraintString.

The syntax used to add a foreign key constraint to a table, with the referenced key columns explicitly specified.
public String
getAddForeignKeyConstraintString(String
The foreign key constraint name
constraintName
,
String
The whole definition of the foreign key as a fragment
foreignKeyDefinition
)

Overrides org.hibernate.dialect.Dialect.getAddForeignKeyConstraintString.

The syntax used to add a foreign key constraint to a table, given the definition of the foreign key as a string.
public String
getAddPrimaryKeyConstraintString(String
The name of the PK constraint.
constraintName
)

Overrides org.hibernate.dialect.Dialect.getAddPrimaryKeyConstraintString.

The syntax used to add a primary key constraint to a table.
public String
getArrayTypeName(String javaElementTypeName, String elementTypeName, Integer maxLength)

Overrides org.hibernate.dialect.Dialect.getArrayTypeName.

The SQL type name for the array type with elements of the given type name.
public String[]
getCreateSchemaCommand(String
The name of the schema to be created.
schemaName
)

Overrides org.hibernate.dialect.Dialect.getCreateSchemaCommand.

Get the SQL command used to create the named schema.
public String
getCurrentSchemaCommand()

Overrides org.hibernate.dialect.Dialect.getCurrentSchemaCommand.

Get the SQL command used to retrieve the current schema name.
public String
getCurrentTimestampSelectString()

Overrides org.hibernate.dialect.Dialect.getCurrentTimestampSelectString.

The command used to retrieve the current timestamp from the database.
public String
getDropForeignKeyString()

Overrides org.hibernate.dialect.Dialect.getDropForeignKeyString.

The subcommand of the alter table command used to drop a foreign key constraint, usually drop constraint.
public String[]
getDropSchemaCommand(String
The name of the schema to be dropped.
schemaName
)

Overrides org.hibernate.dialect.Dialect.getDropSchemaCommand.

Get the SQL command used to drop the named schema.
public Exporter<ForeignKey>
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(LockOptions
contains the lock mode to apply.
lockOptions
)

Overrides org.hibernate.dialect.Dialect.getForUpdateString.

Given a set of LockOptions (lock level, timeout), determine the appropriate for update fragment to use to obtain the lock.
public String
getForUpdateString()

Overrides org.hibernate.dialect.Dialect.getForUpdateString.

Get the string to append to SELECT statements to acquire pessimistic UPGRADE locks for this dialect.
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 locked.
aliases
,
LockOptions
the lock options to apply
lockOptions
)

Overrides org.hibernate.dialect.Dialect.getForUpdateString.

Get the FOR UPDATE OF or FOR SHARE OF fragment appropriate for this dialect, given the aliases of the columns to be locked.
public LimitHandler
public LockingStrategy
getLockingStrategy(Lockable
The persister for the entity to be locked.
lockable
,
LockMode
The type of lock to be acquired.
lockMode
)

Overrides org.hibernate.dialect.Dialect.getLockingStrategy.

Deprecated as a consequence of Lockable being deprecated.
A LockingStrategy which is able to acquire a database-level lock with the specified level.
public int
getMaxVarbinaryLength()

Overrides org.hibernate.dialect.Dialect.getMaxVarbinaryLength.

The biggest size value that can be supplied as argument to a java.sql.Types#VARBINARY-like type.
public int
getMaxVarcharLength()

Overrides org.hibernate.dialect.Dialect.getMaxVarcharLength.

The biggest size value that can be supplied as argument to a java.sql.Types#VARCHAR-like type.
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 SchemaNameResolver
getSchemaNameResolver()

Overrides org.hibernate.dialect.Dialect.getSchemaNameResolver.

Get the strategy for determining the schema name from a JDBC Connection, usually DefaultSchemaNameResolver.
public Exporter<Sequence>
public SqlAstTranslatorFactory
public Exporter<Table>
public UniqueDelegate
public Exporter<Constraint>
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 pessimistic 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 void
initializeFunctionRegistry(FunctionContributions functionContributions)

Overrides org.hibernate.dialect.Dialect.initializeFunctionRegistry.

Initialize the given registry with any dialect-specific functions.
public boolean
public char
openQuote()

Overrides org.hibernate.dialect.Dialect.openQuote.

The character specific to this dialect used to begin a quoted identifier.
public boolean
qualifyIndexName()

Overrides org.hibernate.dialect.Dialect.qualifyIndexName.

Do we need to qualify index names with the schema name?
public boolean
supportsCascadeDelete()

Overrides org.hibernate.dialect.Dialect.supportsCascadeDelete.

Does this dialect support on delete actions in foreign key definitions?
public boolean
supportsCircularCascadeDeleteConstraints()

Overrides org.hibernate.dialect.Dialect.supportsCircularCascadeDeleteConstraints.

Does this dialect support definition of cascade delete constraints which can cause circular chains?
public boolean
supportsCurrentTimestampSelection()

Overrides org.hibernate.dialect.Dialect.supportsCurrentTimestampSelection.

Does this dialect support some way to retrieve the current timestamp value from the database?
public boolean
supportsLockTimeouts()

Overrides org.hibernate.dialect.Dialect.supportsLockTimeouts.

Does this dialect support specifying timeouts when requesting locks.
public boolean
supportsOffsetInSubquery()

Overrides org.hibernate.dialect.Dialect.supportsOffsetInSubquery.

Does this dialect support offset in subqueries?
public boolean
supportsOuterJoinForUpdate()

Overrides org.hibernate.dialect.Dialect.supportsOuterJoinForUpdate.

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

Overrides org.hibernate.dialect.Dialect.supportsStandardArrays.

Does this database have native support for ANSI SQL standard arrays which are expressed in terms of the element type name: integer array.
public String
timestampaddPattern(TemporalUnit
The unit to add to the temporal
unit
,
TemporalType
The type of the temporal
temporalType
,
IntervalType
The type of interval to add or null if it's not a native interval
intervalType
)

Overrides org.hibernate.dialect.Dialect.timestampaddPattern.

Obtain a pattern for the SQL equivalent to a timestampadd() function call.
public String
timestampdiffPattern(TemporalUnit
the first argument
unit
,
TemporalType
true if the first argument is a timestamp, false if a date
fromTemporalType
,
TemporalType
true if the second argument is
toTemporalType
)

Overrides org.hibernate.dialect.Dialect.timestampdiffPattern.

Obtain a pattern for the SQL equivalent to a timestampdiff() function call.
public String
translateExtractField(TemporalUnit unit)

Overrides org.hibernate.dialect.Dialect.translateExtractField.

Return the name used to identify the given field as an argument to the extract() function, or of this dialect's equivalent function.
Inherited from org.hibernate.dialect.Dialect:
addSqlHintOrCommentappendArrayLiteralappendBinaryLiteralappendDateTimeLiteralappendDateTimeLiteralappendDateTimeLiteralappendIntervalLiteralappendLiteralappendLockHintappendUUIDLiteralaugmentPhysicalTableTypesaugmentRecognizedTableTypesbuildIdentifierHelperbuildSQLExceptionConversionDelegatecanBatchTruncatecanCreateCatalogcanDisableConstraintscastPatterncheckVersioncontributecontributeFunctionscontributeTypescreateOptionalTableUpdateOperationcurrentDatecurrentLocalTimecurrentLocalTimestampcurrentTimecurrentTimestampcurrentTimestampWithTimeZonedefaultScrollModedoesReadCommittedCauseWritersToBlockReadersdoesRepeatableReadCauseReadersToBlockWritersequivalentTypesescapeCommentextractPatternforceLobAsLastValuegeneratedAsgetAddColumnStringgetAddColumnSuffixStringgetAggregateSupportgetAlterColumnTypeStringgetAlterTableStringgetAuxiliaryDatabaseObjectExportergetBatchLoadSizingStrategygetCallableStatementSupportgetCascadeConstraintsStringgetCaseInsensitiveLikegetCheckConditiongetCheckConditiongetCheckConditiongetCheckConditiongetColumnAliasExtractorgetColumnCommentgetCreateCatalogCommandgetCreateEnumTypeCommandgetCreateEnumTypeCommandgetCreateIndexStringgetCreateIndexTailgetCreateMultisetTableStringgetCreateTableStringgetCreateTemporaryTableColumnAnnotationgetCreateUserDefinedTypeExtensionsStringgetCreateUserDefinedTypeKindStringgetDefaultDecimalPrecisiongetDefaultIntervalSecondScalegetDefaultLobLengthgetDefaultNonContextualLobCreationgetDefaultPropertiesgetDefaultStatementBatchSizegetDefaultTimestampPrecisiongetDefaultUseGetGeneratedKeysgetDisableConstraintsStatementgetDisableConstraintStatementgetDmlTargetColumnQualifierSupportgetDoublePrecisiongetDropCatalogCommandgetDropEnumTypeCommandgetDropEnumTypeCommandgetDropTableStringgetDropUniqueKeyStringgetEnableConstraintsStatementgetEnableConstraintStatementgetEnumTypeDeclarationgetEnumTypeDeclarationgetFallbackSchemaManagementToolgetFallbackSqmInsertStrategygetFallbackSqmMutationStrategygetFloatPrecisiongetForUpdateStringgetFractionalSecondPrecisionInNanosgetFunctionalDependencyAnalysisSupportgetGroupBySelectItemReferenceStrategygetHqlTranslatorgetIdentityColumnSupportgetIndexExportergetInExpressionCountLimitgetKeywordsgetLobMergeStrategygetLockRowIdentifiergetLowercaseFunctiongetMaxAliasLengthgetMaxIdentifierLengthgetMaxNVarcharCapacitygetMaxNVarcharLengthgetMaxVarbinaryCapacitygetMaxVarcharCapacitygetMinimumSupportedVersiongetMultiKeyLoadSizingStrategygetNameQualifierSupportgetNationalizationSupportgetNativeIdentifierGeneratorStrategygetNativeParameterMarkerStrategygetNoColumnsInsertStringgetNullColumnStringgetNullColumnStringgetNullOrderinggetParameterCountLimitgetPreferredSqlTypeCodeForArraygetPreferredSqlTypeCodeForBooleangetQueryHintStringgetQueryHintStringgetQuerySequencesStringgetReadRowLockStrategygetResultSetgetResultSetgetResultSetgetRowIdColumnStringgetSelectClauseNullStringgetSelectGUIDStringgetSequenceInformationExtractorgetSequenceSupportgetSizeStrategygetSqmTranslatorFactorygetSupportedTemporaryTableKindgetTableCleanergetTableCommentgetTableMigratorgetTableTypeStringgetTemporaryTableAfterUseActiongetTemporaryTableBeforeUseActiongetTemporaryTableCreateCommandgetTemporaryTableCreateOptionsgetTemporaryTableDdlTransactionHandlinggetTemporaryTableDropCommandgetTemporaryTableExportergetTemporaryTableTruncateCommandgetTimeoutInSecondsgetTimeZoneSupportgetTruncateTableStatementgetTruncateTableStatementsgetUserDefinedTypeCommentgetUserDefinedTypeExportergetVersiongetViolatedConstraintNameExtractorgetWriteRowLockStrategyhasAlterTablehasDataTypeBeforeGeneratedAshasSelfReferentialForeignKeyBuginitDefaultPropertiesinlineLiteralisAnsiNullOnisEmptyStringTreatedAsNullisJdbcLogWarningsEnabledByDefaultisLobisLockTimeoutParameterizedordinalprependCommentquotequoteCollationregisterColumnTypesregisterDefaultKeywordsregisterKeywordregisterKeywordsregisterResultSetOutParameterregisterResultSetOutParameterrequiresCastForConcatenatingNonStringsrequiresFloatCastingOfIntegerDivisionrequiresParensForTupleCountsrequiresParensForTupleDistinctCountsresolveSqlTypeCoderesolveSqlTypeCoderesolveSqlTypeDescriptorresolveSqlTypeLengthrowIdrowIdSqlTypesupportsAlterColumnTypesupportsBatchUpdatessupportsBindAsCallableArgumentsupportsBitTypesupportsCaseInsensitiveLikesupportsColumnChecksupportsCommentOnsupportsDistinctFromPredicatesupportsExistsInSelectsupportsExpectedLobUsagePatternsupportsFetchClausesupportsFractionalTimestampArithmeticsupportsIfExistsAfterAlterTablesupportsIfExistsAfterConstraintNamesupportsIfExistsAfterTableNamesupportsIfExistsAfterTypeNamesupportsIfExistsBeforeConstraintNamesupportsIfExistsBeforeTableNamesupportsIfExistsBeforeTypeNamesupportsInsertReturningsupportsInsertReturningGeneratedKeyssupportsIsTruesupportsJdbcConnectionLobCreationsupportsLateralsupportsLobValueChangePropagationsupportsMaterializedLobAccesssupportsNamedParameterssupportsNoColumnsInsertsupportsNonQueryWithCTEsupportsNoWaitsupportsNullPrecedencesupportsOrderByInSubquerysupportsOrdinalSelectItemReferencesupportsParametersInInsertSelectsupportsPartitionBysupportsPredicateAsExpressionsupportsRecursiveCTEsupportsRefCursorssupportsResultSetPositionQueryMethodsOnForwardOnlyCursorsupportsSkipLockedsupportsStandardCurrentTimestampFunctionsupportsSubqueryInSelectsupportsSubqueryOnMutatingTablesupportsSubselectAsInPredicateLHSsupportsTableChecksupportsTemporalLiteralOffsetsupportsTemporaryTablePrimaryKeysupportsTemporaryTablessupportsTruncateWithCastsupportsTupleCountssupportsTupleDistinctCountssupportsUnboundedLobLocatorMaterializationsupportsUnionAllsupportsUnionInSubquerysupportsValuesListsupportsValuesListForInsertsupportsWaitsupportsWindowFunctionstoBooleanValueStringtoQuotedIdentifiertoStringtransformSelectStringtranslateDurationFieldtrimPatterntrimPatternuseArrayForMultiValuedParametersuseFollowOnLockinguseInputStreamToInsertBlobuseMaterializedLobWhenCapacityExceeded