Class KeycloakH2Dialect

java.lang.Object
org.hibernate.dialect.Dialect
org.hibernate.dialect.H2Dialect
org.keycloak.connections.jpa.dialect.KeycloakH2Dialect
All Implemented Interfaces:
org.hibernate.boot.model.FunctionContributor, org.hibernate.boot.model.TypeContributor, org.hibernate.exception.spi.ConversionContext

public class KeycloakH2Dialect extends org.hibernate.dialect.H2Dialect
Fixes Hibernate's H2 dialect to correctly handle HQL insert ... on conflict ... do nothing by emitting a MERGE statement instead of a plain INSERT that silently drops the conflict clause.

See HHH-20826 for the upstream tracker.

  • Nested Class Summary

    Nested classes/interfaces inherited from class org.hibernate.dialect.H2Dialect

    org.hibernate.dialect.H2Dialect.OrdinalParameterMarkerStrategy

    Nested classes/interfaces inherited from class org.hibernate.dialect.Dialect

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

    Fields inherited from 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
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.hibernate.sql.ast.SqlAstTranslatorFactory
     

    Methods inherited from class org.hibernate.dialect.H2Dialect

    appendBooleanValueString, appendDatetimeFormat, appendDateTimeLiteral, appendDateTimeLiteral, appendDateTimeLiteral, augmentPhysicalTableTypes, buildSQLExceptionConversionDelegate, canDisableConstraints, castPattern, castType, columnType, contributeTypes, createOptionalTableUpdateOperation, currentTime, currentTimestamp, currentTimestampWithTimeZone, determineDatabaseVersion, doesReadCommittedCauseWritersToBlockReaders, dropConstraints, extractPattern, generatedAs, getAggregateSupport, getAlterColumnTypeString, getCascadeConstraintsString, getCaseInsensitiveLike, getCreateEnumTypeCommand, getCurrentTimestampSelectString, getDefaultNonContextualLobCreation, getDefaultOrdinalityColumnName, getDefaultStatementBatchSize, getDisableConstraintsStatement, getDmlTargetColumnQualifierSupport, getDropEnumTypeCommand, getDual, getEnableConstraintsStatement, getEnumTypeDeclaration, getFallbackSqmInsertStrategy, getFallbackSqmMutationStrategy, getForUpdateNowaitString, getForUpdateSkipLockedString, getForUpdateString, getFunctionalDependencyAnalysisSupport, getGlobalTemporaryTableStrategy, getGroupBySelectItemReferenceStrategy, getIdentityColumnSupport, getLimitHandler, getLocalTemporaryTableStrategy, getLockingSupport, getMaximumArraySize, getMaximumSeriesSize, getMaxVarcharLength, getMinimumSupportedVersion, getNativeParameterMarkerStrategy, getNullOrdering, getQueryHintString, getQuerySequencesString, getSequenceInformationExtractor, getSequenceSupport, getSupportedTemporaryTableKind, getTemporaryTableCreateOptions, getTimeZoneSupport, getUniqueDelegate, getViolatedConstraintNameExtractor, hasOddDstBehavior, initializeFunctionRegistry, isCurrentTimestampSelectStringCallable, isCurrentTimestampStable, narrowCastType, registerColumnTypes, registerResultSetOutParameter, requiresParensForTupleDistinctCounts, resolveSqlTypeCode, resolveSqlTypeCode, resolveSqlTypeDescriptor, rowId, rowIdSqlType, supportsAlterColumnType, supportsArrayConstructor, supportsBindingNullSqlTypeForSetNull, supportsCaseInsensitiveLike, supportsCommentOn, supportsCurrentTimestampSelection, supportsDistinctFromPredicate, supportsExceptAll, supportsFetchClause, supportsFilterClause, supportsIfExistsAfterAlterTable, supportsIfExistsAfterTableName, supportsIfExistsBeforeConstraintName, supportsIfExistsBeforeIndexName, supportsIfExistsBeforeTableName, supportsInsertReturning, supportsInsertReturningGeneratedKeys, supportsInsertReturningRowId, supportsIsTrue, supportsJoinInMutationStatementSubquery, supportsLobValueChangePropagation, supportsOffsetInSubquery, supportsPartitionBy, supportsRecursiveCTE, supportsRowConstructor, supportsRowValueConstructorDistinctFromSyntax, supportsRowValueConstructorSyntax, supportsRowValueConstructorSyntaxInQuantifiedPredicates, supportsStandardArrays, supportsTemporalLiteralOffset, supportsTimeLiteralOffset, supportsTupleCounts, supportsValuesList, supportsWindowFunctions, supportsWithClauseInSubquery, timestampaddPattern, timestampdiffPattern, translateExtractField, unquoteGetGeneratedKeys, useArrayForMultiValuedParameters

    Methods inherited from class org.hibernate.dialect.Dialect

    addPartitionKeyToPrimaryKey, addSqlHintOrComment, addUseIndexQueryHint, appendArrayLiteral, appendBinaryLiteral, appendCheckConstraintOptions, appendIntervalLiteral, appendIntervalLiteral, appendLiteral, appendLockHint, appendUUIDLiteral, applyLocksToSql, augmentRecognizedTableTypes, buildIdentifierHelper, buildLockingClauseStrategy, buildOptimisticForceIncrementStrategy, buildOptimisticStrategy, buildPessimisticForceIncrementStrategy, buildPessimisticReadStrategy, buildPessimisticWriteStrategy, buildReadStrategy, buildStringToBooleanCast, buildStringToBooleanCastDecode, buildStringToBooleanDecode, canBatchTruncate, canCreateCatalog, canCreateSchema, causesRollback, checkVersion, closeQuote, contribute, contributeFunctions, currentDate, currentLocalTime, currentLocalTimestamp, defaultScrollMode, doesRepeatableReadCauseReadersToBlockWriters, doesRoundTemporalOnOverflow, equivalentTypes, escapeComment, forceLobAsLastValue, getAddColumnString, getAddColumnSuffixString, getAddForeignKeyConstraintString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAlterTableString, getArrayTypeName, getAuxiliaryDatabaseObjectExporter, getBatchLoadSizingStrategy, getBeforeDropStatement, getCallableStatementSupport, getCatalogSeparator, getCheckCondition, getCheckCondition, getCheckCondition, getCheckCondition, getCheckCondition, getCheckCondition, getCheckConstraintString, getColumnAliasExtractor, getColumnComment, getColumnDefaultString, getCreateCatalogCommand, getCreateEnumTypeCommand, getCreateIndexString, getCreateIndexTail, getCreateMultisetTableString, getCreateSchemaCommand, getCreateTableString, getCreateTemporaryTableColumnAnnotation, getCreateUserDefinedTypeExtensionsString, getCreateUserDefinedTypeKindString, getCrossReferenceParentTableFilter, getCurrentSchemaCommand, getDefaultDecimalPrecision, getDefaultIntervalSecondScale, getDefaultLobLength, getDefaultProperties, getDefaultTimestampPrecision, getDefaultUseGetGeneratedKeys, getDisableConstraintStatement, getDoublePrecision, getDropCatalogCommand, getDropEnumTypeCommand, getDropForeignKeyString, getDropSchemaCommand, getDropTableString, getDropUniqueKeyString, getEnableConstraintStatement, getEnumTypeDeclaration, getFallbackSchemaManagementTool, getFloatPrecision, getForeignKeyExporter, getForUpdateNowaitString, getForUpdateSkipLockedString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getFractionalSecondPrecisionInNanos, getFromDualForSelectOnly, getHqlTranslator, getIndexExporter, getInExpressionCountLimit, getInformationExtractor, getKeywords, getLobMergeStrategy, getLockingClauseStrategy, getLockingStrategy, getLockingStrategy, getLockRowIdentifier, getLowercaseFunction, getMaxAliasLength, getMaxIdentifierLength, getMaxNVarcharCapacity, getMaxNVarcharLength, getMaxVarbinaryCapacity, getMaxVarbinaryLength, getMaxVarcharCapacity, getMultiKeyLoadSizingStrategy, getNameQualifierSupport, getNationalizationSupport, getNativeIdentifierGeneratorStrategy, getNativeValueGenerationStrategy, getNoColumnsInsertString, getNullColumnString, getNullColumnString, getParameterCountLimit, getPersistentTemporaryTableStrategy, getPessimisticLockStyle, getPreferredSqlTypeCodeForArray, getPreferredSqlTypeCodeForBoolean, getQueryHintString, getReadLockString, getReadLockString, getReadLockString, getReadLockString, getReadRowLockStrategy, getResultSet, getResultSet, getResultSet, getRowIdColumnString, getSchemaNameResolver, getSelectClauseNullString, getSelectClauseNullString, getSelectGUIDString, getSequenceExporter, getSetOperatorSqlString, getSizeStrategy, getSqmTranslatorFactory, getTableCleaner, getTableComment, getTableExporter, getTableMigrator, getTableTypeString, getTemporalTableSupport, getTemporaryTableAfterUseAction, getTemporaryTableBeforeUseAction, getTemporaryTableCreateCommand, getTemporaryTableDdlTransactionHandling, getTemporaryTableDropCommand, getTemporaryTableExporter, getTemporaryTableTruncateCommand, getTimeoutInSeconds, getTruncateTableStatement, getTruncateTableStatements, getUniqueKeyExporter, getUserDefinedTypeExporter, getValueLOBFragmentForExtraCreateTableInfo, getVersion, getWriteLockString, getWriteLockString, getWriteLockString, getWriteLockString, getWriteRowLockStrategy, hasAlterTable, hasDataTypeBeforeGeneratedAs, hasSelfReferentialForeignKeyBug, initDefaultProperties, isEmptyStringTreatedAsNull, isJdbcLogWarningsEnabledByDefault, isLob, openQuote, ordinal, prependComment, qualifyIndexName, quote, quoteCollation, registerDefaultKeywords, registerKeyword, registerKeywords, registerResultSetOutParameter, requiresCastForConcatenatingNonStrings, requiresColumnListInCreateView, requiresFloatCastingOfIntegerDivision, requiresNotNullBeforeDefault, requiresParensForTupleCounts, resolveSqlTypeLength, stripsTrailingSpacesFromChar, supportsBatchUpdates, supportsBindAsCallableArgument, supportsBindingNullForSetObject, supportsBitType, supportsCascadeDelete, supportsCircularCascadeDeleteConstraints, supportsColumnCheck, supportsConflictClauseForInsertCTE, supportsCrossJoin, supportsCteHeaderColumnList, supportsDuplicateSelectItemsInQueryGroup, supportsExistsInSelect, supportsExpectedLobUsagePattern, supportsForUpdate, supportsFractionalTimestampArithmetic, supportsFromClauseInUpdate, supportsIfExistsAfterConstraintName, supportsIfExistsAfterTypeName, supportsIfExistsBeforeTypeName, supportsIntersect, supportsJdbcConnectionLobCreation, supportsJoinsInDelete, supportsLateral, supportsLockTimeouts, supportsMaterializedLobAccess, supportsNamedColumnCheck, supportsNamedParameters, supportsNationalizedMethods, supportsNestedSubqueryCorrelation, supportsNestedWithClause, supportsNoColumnsInsert, supportsNonQueryWithCTE, supportsNotNullAfterGeneratedAs, supportsNoWait, supportsNullPrecedence, supportsOrderByInSubquery, supportsOrdinalSelectItemReference, supportsOuterJoinForUpdate, supportsPredicateAsExpression, supportsRecursiveCycleClause, supportsRecursiveCycleUsingClause, supportsRecursiveSearchClause, supportsRefCursors, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsRowValueConstructorGtLtSyntax, supportsRowValueConstructorSyntaxInInList, supportsRowValueConstructorSyntaxInInSubQuery, supportsSimpleQueryGrouping, supportsSkipLocked, supportsStandardCurrentTimestampFunction, supportsSubqueryInSelect, supportsSubqueryOnMutatingTable, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTableOptions, supportsTemporaryTablePrimaryKey, supportsTemporaryTables, supportsTruncateWithCast, supportsTupleDistinctCounts, supportsUnboundedLobLocatorMaterialization, supportsUnionAll, supportsUnionInSubquery, supportsUniqueConstraints, supportsUpdateReturning, supportsUserDefinedTypes, supportsValueLOBAccess, supportsValuesListForInsert, supportsWait, supportsWithClause, throttleDdl, toBooleanValueString, toQuotedIdentifier, toString, transformSelectString, translateDurationField, trimPattern, useConnectionToCreateLob, useCrossReferenceForeignKeys, useFollowOnLocking, useInputStreamToInsertBlob, useMaterializedLobWhenCapacityExceeded

    Methods inherited from class java.lang.Object

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

    • KeycloakH2Dialect

      public KeycloakH2Dialect()
  • Method Details

    • getSqlAstTranslatorFactory

      public org.hibernate.sql.ast.SqlAstTranslatorFactory getSqlAstTranslatorFactory()
      Overrides:
      getSqlAstTranslatorFactory in class org.hibernate.dialect.H2Dialect