Class SingleStoreDialect

java.lang.Object
org.hibernate.dialect.Dialect
org.hibernate.community.dialect.SingleStoreDialect
All Implemented Interfaces:
org.hibernate.boot.model.FunctionContributor, org.hibernate.boot.model.TypeContributor, org.hibernate.exception.spi.ConversionContext

public class SingleStoreDialect extends org.hibernate.dialect.Dialect
An SQL dialect for SingleStore.

The following are some of the key aspects and limitations of SingleStore that may affect Hibernate functionality:

  • SingleStore supports two table types: COLUMNSTORE and ROWSTORE. Explicit table type can be configured by setting 'hibernate.dialect.singlestore.table_type' property. Refer to SingleStoreDialect.SingleStoreTableType for details.
  • SingleStore has a random order for SELECT queries, which may impact the predictability of query results.
  • SingleStore does not support foreign keys and referential integrity, which could affect the design of your database schema.
  • The SingleStore dialect ignores unique key constraints. See SingleStoreDialect.DoNothingUniqueDelegate for more information.
  • SingleStore does not support zoned timestamps, which might require adjustments to how you handle time-related data.
  • Updating primary keys in SingleStore is restricted because every primary key is also a unique key and shard key.
  • SingleStore does not support the ALL/ANY clause in SQL queries.
  • Sub-selects with references to outer table fields are not supported in SingleStore.
  • SingleStore does not support the 'FOR UPDATE' clause for table locking with distributed joins. It's disabled by default, can be enabled by setting 'hibernate.dialect.singlestore.for_update_lock_enabled' property SINGLE_STORE_FOR_UPDATE_LOCK_ENABLED.
  • The LIKE clause in SingleStore is case-insensitive, which might differ from other SQL implementations.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    The default table type in SingleStore is 'columnstore'.

    Nested classes/interfaces declared in class org.hibernate.dialect.Dialect

    org.hibernate.dialect.Dialect.SizeStrategy, org.hibernate.dialect.Dialect.SizeStrategyImpl
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Specifies SingleStore FOR UPDATE clause lock enable.
    static final String
    Specifies SingleStore explicit table type.

    Fields declared in class org.hibernate.dialect.Dialect

    CLOSED_QUOTE, FALSE_STRING_VALUES, LEGACY_LOB_MERGE_STRATEGY, LOG_BASE2OF10, NEW_LOCATOR_LOB_MERGE_STRATEGY, QUOTE, STANDARD_MULTI_KEY_LOAD_SIZING_STRATEGY, STREAM_XFER_LOB_MERGE_STRATEGY, TRUE_STRING_VALUES
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    SingleStoreDialect(org.hibernate.dialect.DatabaseVersion version, SingleStoreDialect.SingleStoreTableType explicitTableType, boolean isForUpdateLockingEnabled)
     
    SingleStoreDialect(org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo info)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.hibernate.engine.jdbc.env.spi.IdentifierHelper
    buildIdentifierHelper(org.hibernate.engine.jdbc.env.spi.IdentifierHelperBuilder builder, DatabaseMetaData metadata)
     
    static org.hibernate.dialect.Replacer
     
     
    org.hibernate.tool.schema.spi.Exporter<org.hibernate.mapping.ForeignKey>
    SingleStore does not support foreign keys and referential integrity
    org.hibernate.dialect.temptable.TemporaryTableStrategy
     
    int
    The biggest size value that can be supplied as argument
    org.hibernate.dialect.temptable.TemporaryTableKind
     
    org.hibernate.query.sqm.mutation.spi.AfterUseAction
     
    org.hibernate.query.sqm.mutation.spi.BeforeUseAction
     
     
     
    getWriteLockString(String aliases, int timeout)
     
    boolean
     
    boolean
    SingleStore doesn't support modifying column type on columnstore tables.
    boolean
    Feature 'Check constraints' is not supported by SingleStore.
    boolean
    Feature 'Check constraints' is not supported by SingleStore.

    Methods declared in class org.hibernate.dialect.Dialect

    addPartitionKeyToPrimaryKey, addSqlHintOrComment, addUseIndexQueryHint, appendArrayLiteral, appendBinaryLiteral, appendBooleanValueString, appendCheckConstraintOptions, appendDatetimeFormat, appendDateTimeLiteral, appendDateTimeLiteral, appendDateTimeLiteral, appendIntervalLiteral, appendIntervalLiteral, appendLiteral, appendLockHint, appendUUIDLiteral, applyLocksToSql, augmentPhysicalTableTypes, augmentRecognizedTableTypes, buildLockingClauseStrategy, buildOptimisticForceIncrementStrategy, buildOptimisticStrategy, buildPessimisticForceIncrementStrategy, buildPessimisticReadStrategy, buildPessimisticWriteStrategy, buildReadStrategy, buildSQLExceptionConversionDelegate, buildStringToBooleanCast, buildStringToBooleanCastDecode, buildStringToBooleanDecode, canBatchTruncate, canCreateCatalog, canCreateSchema, canDisableConstraints, castPattern, castType, checkVersion, closeQuote, columnType, contribute, contributeFunctions, contributeTypes, createOptionalTableUpdateOperation, currentDate, currentLocalTime, currentLocalTimestamp, currentTime, currentTimestamp, currentTimestampWithTimeZone, defaultScrollMode, determineDatabaseVersion, doesReadCommittedCauseWritersToBlockReaders, doesRepeatableReadCauseReadersToBlockWriters, doesRoundTemporalOnOverflow, dropConstraints, equivalentTypes, escapeComment, extractPattern, forceLobAsLastValue, generatedAs, getAddColumnString, getAddColumnSuffixString, getAddForeignKeyConstraintString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAggregateSupport, getAlterColumnTypeString, getAlterTableString, getArrayTypeName, getAuxiliaryDatabaseObjectExporter, getBatchLoadSizingStrategy, getBeforeDropStatement, getCallableStatementSupport, getCascadeConstraintsString, getCaseInsensitiveLike, getCatalogSeparator, getCheckCondition, getCheckCondition, getCheckCondition, getCheckCondition, getCheckCondition, getCheckCondition, getCheckConstraintString, getColumnAliasExtractor, getColumnComment, getCreateCatalogCommand, getCreateEnumTypeCommand, getCreateEnumTypeCommand, getCreateIndexString, getCreateIndexTail, getCreateMultisetTableString, getCreateSchemaCommand, getCreateTableString, getCreateTemporaryTableColumnAnnotation, getCreateUserDefinedTypeExtensionsString, getCreateUserDefinedTypeKindString, getCrossReferenceParentTableFilter, getCurrentSchemaCommand, getCurrentTimestampSelectString, getDefaultDecimalPrecision, getDefaultIntervalSecondScale, getDefaultLobLength, getDefaultNonContextualLobCreation, getDefaultOrdinalityColumnName, getDefaultProperties, getDefaultStatementBatchSize, getDefaultTimestampPrecision, getDefaultUseGetGeneratedKeys, getDisableConstraintsStatement, getDisableConstraintStatement, getDmlTargetColumnQualifierSupport, getDoublePrecision, getDropCatalogCommand, getDropEnumTypeCommand, getDropEnumTypeCommand, getDropForeignKeyString, getDropSchemaCommand, getDropTableString, getDropUniqueKeyString, getDual, getEnableConstraintsStatement, getEnableConstraintStatement, getEnumTypeDeclaration, getEnumTypeDeclaration, getFallbackSchemaManagementTool, getFallbackSqmInsertStrategy, getFallbackSqmMutationStrategy, getFloatPrecision, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateSkipLockedString, getForUpdateSkipLockedString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getFractionalSecondPrecisionInNanos, getFromDualForSelectOnly, getFunctionalDependencyAnalysisSupport, getGlobalTemporaryTableStrategy, getGroupBySelectItemReferenceStrategy, getHqlTranslator, getIdentityColumnSupport, getIndexExporter, getInExpressionCountLimit, getInformationExtractor, getKeywords, getLimitHandler, getLobMergeStrategy, getLockingClauseStrategy, getLockingStrategy, getLockingStrategy, getLockingSupport, getLockRowIdentifier, getLowercaseFunction, getMaxAliasLength, getMaxIdentifierLength, getMaxNVarcharCapacity, getMaxNVarcharLength, getMaxVarbinaryCapacity, getMaxVarcharCapacity, getMaxVarcharLength, getMinimumSupportedVersion, getMultiKeyLoadSizingStrategy, getNameQualifierSupport, getNationalizationSupport, getNativeIdentifierGeneratorStrategy, getNativeParameterMarkerStrategy, getNativeValueGenerationStrategy, getNoColumnsInsertString, getNullColumnString, getNullColumnString, getNullOrdering, getParameterCountLimit, getPersistentTemporaryTableStrategy, getPessimisticLockStyle, getPreferredSqlTypeCodeForArray, getPreferredSqlTypeCodeForBoolean, getQueryHintString, getQueryHintString, getQuerySequencesString, getReadLockString, getReadLockString, getReadLockString, getReadLockString, getReadRowLockStrategy, getResultSet, getResultSet, getResultSet, getRowIdColumnString, getSchemaNameResolver, getSelectClauseNullString, getSelectClauseNullString, getSelectGUIDString, getSequenceExporter, getSequenceInformationExtractor, getSequenceSupport, getSizeStrategy, getSqlAstTranslatorFactory, getSqmTranslatorFactory, getTableCleaner, getTableComment, getTableExporter, getTableMigrator, getTableTypeString, getTemporaryTableCreateOptions, getTemporaryTableDdlTransactionHandling, getTemporaryTableExporter, getTemporaryTableTruncateCommand, getTimeoutInSeconds, getTimeZoneSupport, getTruncateTableStatement, getTruncateTableStatements, getUniqueDelegate, getUniqueKeyExporter, getUserDefinedTypeComment, getUserDefinedTypeExporter, getVersion, getViolatedConstraintNameExtractor, getWriteLockString, getWriteLockString, getWriteLockString, getWriteRowLockStrategy, hasAlterTable, hasDataTypeBeforeGeneratedAs, hasSelfReferentialForeignKeyBug, initDefaultProperties, initializeFunctionRegistry, isCurrentTimestampSelectStringCallable, isEmptyStringTreatedAsNull, isJdbcLogWarningsEnabledByDefault, isLob, openQuote, ordinal, prependComment, qualifyIndexName, quote, quoteCollation, registerColumnTypes, registerDefaultKeywords, registerKeyword, registerKeywords, registerResultSetOutParameter, registerResultSetOutParameter, requiresCastForConcatenatingNonStrings, requiresColumnListInCreateView, requiresFloatCastingOfIntegerDivision, requiresParensForTupleCounts, requiresParensForTupleDistinctCounts, resolveSqlTypeCode, resolveSqlTypeCode, resolveSqlTypeDescriptor, resolveSqlTypeLength, rowId, rowIdSqlType, stripsTrailingSpacesFromChar, supportsArrayConstructor, supportsBatchUpdates, supportsBindAsCallableArgument, supportsBindingNullForSetObject, supportsBindingNullSqlTypeForSetNull, supportsBitType, supportsCascadeDelete, supportsCaseInsensitiveLike, supportsCircularCascadeDeleteConstraints, supportsCommentOn, supportsConflictClauseForInsertCTE, supportsCrossJoin, supportsCurrentTimestampSelection, supportsDistinctFromPredicate, supportsDuplicateSelectItemsInQueryGroup, supportsExistsInSelect, supportsExpectedLobUsagePattern, supportsFetchClause, supportsFilterClause, supportsForUpdate, supportsFractionalTimestampArithmetic, supportsFromClauseInUpdate, supportsIfExistsAfterAlterTable, supportsIfExistsAfterConstraintName, supportsIfExistsAfterTableName, supportsIfExistsAfterTypeName, supportsIfExistsBeforeConstraintName, supportsIfExistsBeforeTableName, supportsIfExistsBeforeTypeName, supportsInsertReturning, supportsInsertReturningGeneratedKeys, supportsInsertReturningRowId, supportsIntersect, supportsIsTrue, supportsJdbcConnectionLobCreation, supportsJoinInMutationStatementSubquery, supportsJoinsInDelete, supportsLateral, supportsLobValueChangePropagation, supportsLockTimeouts, supportsMaterializedLobAccess, supportsNamedColumnCheck, supportsNamedParameters, supportsNationalizedMethods, supportsNestedSubqueryCorrelation, supportsNestedWithClause, supportsNoColumnsInsert, supportsNonQueryWithCTE, supportsNoWait, supportsNullPrecedence, supportsOffsetInSubquery, supportsOrderByInSubquery, supportsOrdinalSelectItemReference, supportsOuterJoinForUpdate, supportsPartitionBy, supportsPredicateAsExpression, supportsRecursiveCTE, supportsRecursiveCycleClause, supportsRecursiveCycleUsingClause, supportsRecursiveSearchClause, supportsRefCursors, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsRowConstructor, supportsRowValueConstructorDistinctFromSyntax, supportsRowValueConstructorGtLtSyntax, supportsRowValueConstructorSyntax, supportsRowValueConstructorSyntaxInInList, supportsRowValueConstructorSyntaxInInSubQuery, supportsRowValueConstructorSyntaxInQuantifiedPredicates, supportsSimpleQueryGrouping, supportsSkipLocked, supportsStandardArrays, supportsStandardCurrentTimestampFunction, supportsSubqueryInSelect, supportsSubqueryOnMutatingTable, supportsSubselectAsInPredicateLHS, supportsTableOptions, supportsTemporalLiteralOffset, supportsTemporaryTablePrimaryKey, supportsTemporaryTables, supportsTruncateWithCast, supportsTupleCounts, supportsTupleDistinctCounts, supportsUnboundedLobLocatorMaterialization, supportsUnionAll, supportsUnionInSubquery, supportsUpdateReturning, supportsUserDefinedTypes, supportsValuesList, supportsValuesListForInsert, supportsWait, supportsWindowFunctions, supportsWithClause, supportsWithClauseInSubquery, timestampaddPattern, timestampdiffPattern, toBooleanValueString, toQuotedIdentifier, toString, transformSelectString, translateDurationField, translateExtractField, trimPattern, unquoteGetGeneratedKeys, useArrayForMultiValuedParameters, useConnectionToCreateLob, useCrossReferenceForeignKeys, useFollowOnLocking, useInputStreamToInsertBlob, useMaterializedLobWhenCapacityExceeded

    Methods declared in class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • SINGLE_STORE_TABLE_TYPE

      public static final String SINGLE_STORE_TABLE_TYPE
      Specifies SingleStore explicit table type.
      See Also:
      Default Value:
      null
    • SINGLE_STORE_FOR_UPDATE_LOCK_ENABLED

      public static final String SINGLE_STORE_FOR_UPDATE_LOCK_ENABLED
      Specifies SingleStore FOR UPDATE clause lock enable.
      See Also:
      Default Value:
      false
  • Constructor Details

    • SingleStoreDialect

      public SingleStoreDialect()
    • SingleStoreDialect

      public SingleStoreDialect(org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo info)
    • SingleStoreDialect

      public SingleStoreDialect(org.hibernate.dialect.DatabaseVersion version, SingleStoreDialect.SingleStoreTableType explicitTableType, boolean isForUpdateLockingEnabled)
  • Method Details

    • getMaxVarbinaryLength

      public int getMaxVarbinaryLength()
      The biggest size value that can be supplied as argument
      Overrides:
      getMaxVarbinaryLength in class org.hibernate.dialect.Dialect
    • supportsColumnCheck

      public boolean supportsColumnCheck()
      Feature 'Check constraints' is not supported by SingleStore.
      Overrides:
      supportsColumnCheck in class org.hibernate.dialect.Dialect
    • supportsTableCheck

      public boolean supportsTableCheck()
      Feature 'Check constraints' is not supported by SingleStore.
      Overrides:
      supportsTableCheck in class org.hibernate.dialect.Dialect
    • datetimeFormat

      public static org.hibernate.dialect.Replacer datetimeFormat(String format)
    • supportsAlterColumnType

      public boolean supportsAlterColumnType()
      SingleStore doesn't support modifying column type on columnstore tables. It only supports modifying column type on rowstore table.
      Overrides:
      supportsAlterColumnType in class org.hibernate.dialect.Dialect
    • getSupportedTemporaryTableKind

      public org.hibernate.dialect.temptable.TemporaryTableKind getSupportedTemporaryTableKind()
      Overrides:
      getSupportedTemporaryTableKind in class org.hibernate.dialect.Dialect
    • getLocalTemporaryTableStrategy

      public org.hibernate.dialect.temptable.TemporaryTableStrategy getLocalTemporaryTableStrategy()
      Overrides:
      getLocalTemporaryTableStrategy in class org.hibernate.dialect.Dialect
    • getTemporaryTableCreateCommand

      public String getTemporaryTableCreateCommand()
      Overrides:
      getTemporaryTableCreateCommand in class org.hibernate.dialect.Dialect
    • getTemporaryTableDropCommand

      public String getTemporaryTableDropCommand()
      Overrides:
      getTemporaryTableDropCommand in class org.hibernate.dialect.Dialect
    • getTemporaryTableAfterUseAction

      public org.hibernate.query.sqm.mutation.spi.AfterUseAction getTemporaryTableAfterUseAction()
      Overrides:
      getTemporaryTableAfterUseAction in class org.hibernate.dialect.Dialect
    • getTemporaryTableBeforeUseAction

      public org.hibernate.query.sqm.mutation.spi.BeforeUseAction getTemporaryTableBeforeUseAction()
      Overrides:
      getTemporaryTableBeforeUseAction in class org.hibernate.dialect.Dialect
    • buildIdentifierHelper

      public org.hibernate.engine.jdbc.env.spi.IdentifierHelper buildIdentifierHelper(org.hibernate.engine.jdbc.env.spi.IdentifierHelperBuilder builder, DatabaseMetaData metadata) throws SQLException
      Overrides:
      buildIdentifierHelper in class org.hibernate.dialect.Dialect
      Throws:
      SQLException
    • getWriteLockString

      public String getWriteLockString(String aliases, int timeout)
      Overrides:
      getWriteLockString in class org.hibernate.dialect.Dialect
    • getForeignKeyExporter

      public org.hibernate.tool.schema.spi.Exporter<org.hibernate.mapping.ForeignKey> getForeignKeyExporter()
      SingleStore does not support foreign keys and referential integrity
      Overrides:
      getForeignKeyExporter in class org.hibernate.dialect.Dialect
    • getExplicitTableType

      public SingleStoreDialect.SingleStoreTableType getExplicitTableType()
    • isForUpdateLockingEnabled

      public boolean isForUpdateLockingEnabled()