Class DemoHSQLDialect

java.lang.Object
org.hibernate.dialect.Dialect
org.hibernate.dialect.HSQLDialect
org.broadleafcommerce.common.dialect.DemoHSQLDialect
All Implemented Interfaces:
org.hibernate.exception.spi.ConversionContext

public class DemoHSQLDialect extends org.hibernate.dialect.HSQLDialect
A HSQL DB dialect specifically for the demo. In the demo use case, the database is empty on startup and does not require table drops. Removing the table drop phase stops a number of HHH000389 level Hibernate errors from being emitted to the console. While these exceptions are harmless, their occurrence should be avoided.
Author:
Jeff Fischer
  • 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
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    To avoid seeing all of the hibernate errors on first startup, disable dropping constraints.
    Since we aren't dropping constraints anymore, we must cascade when dropping tables to avoid violating FKs.
    boolean
     
    boolean
    Due to HSQL syntax and the way Dialect.getDropTableString(String) arranges the statements, we must put the if exists before the table name.

    Methods inherited from class org.hibernate.dialect.HSQLDialect

    bindLimitParametersFirst, doesReadCommittedCauseWritersToBlockReaders, doesRepeatableReadCauseReadersToBlockWriters, getAddColumnString, getCreateSequenceString, getCreateSequenceString, getCurrentTimestampSelectString, getCurrentTimestampSQLFunctionName, getDefaultMultiTableBulkIdStrategy, getDropSequenceString, getForUpdateString, getIdentityColumnSupport, getLimitHandler, getLimitString, getLockingStrategy, getNameQualifierSupport, getQuerySequencesString, getSelectClauseNullString, getSelectSequenceNextValString, getSequenceInformationExtractor, getSequenceNextValString, getViolatedConstraintNameExtracter, isCurrentTimestampSelectStringCallable, requiresCastingOfParametersInSelectClause, supportsColumnCheck, supportsCommentOn, supportsCurrentTimestampSelection, supportsEmptyInList, supportsLimit, supportsLobValueChangePropogation, supportsLockTimeouts, supportsNamedParameters, supportsPooledSequences, supportsSequences, supportsTupleDistinctCounts, supportsUnionAll, toBooleanValueString

    Methods inherited from class org.hibernate.dialect.Dialect

    addSqlHintOrComment, appendLockHint, appendLockHint, applyLocksToSql, areStringComparisonsCaseInsensitive, augmentPhysicalTableTypes, augmentRecognizedTableTypes, bindLimitParametersInReverseOrder, buildIdentifierHelper, buildSQLExceptionConversionDelegate, buildSQLExceptionConverter, canCreateCatalog, canCreateSchema, cast, cast, cast, closeQuote, contributeTypes, convertToFirstRowValue, createCaseFragment, createOuterJoinFragment, defaultScrollMode, equivalentTypes, escapeComment, escapeLiteral, forceLimitUsage, forceLobAsLastValue, forUpdateOfColumns, getAddColumnSuffixString, getAddForeignKeyConstraintString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAddUniqueConstraintString, getAlterTableString, getAuxiliaryDatabaseObjectExporter, getCallableStatementSupport, getCaseInsensitiveLike, getCastTypeName, getColumnAliasExtractor, getColumnComment, getCreateCatalogCommand, getCreateMultisetTableString, getCreateSchemaCommand, getCreateSequenceStrings, getCreateSequenceStrings, getCreateTableString, getCreateTemporaryTableColumnAnnotation, getCrossJoinSeparator, getCurrentSchemaCommand, getDefaultBatchLoadSizingStrategy, getDefaultProperties, getDialect, getDialect, getDropCatalogCommand, getDropForeignKeyString, getDropSchemaCommand, getDropSequenceStrings, getDropTableString, getForeignKeyExporter, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateSkipLockedString, getForUpdateSkipLockedString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getFunctions, getHibernateTypeName, getHibernateTypeName, getIndexExporter, getInExpressionCountLimit, getKeywords, getLimitString, getLobMergeStrategy, getLowercaseFunction, getMaxAliasLength, getNativeIdentifierGeneratorClass, getNativeIdentifierGeneratorStrategy, getNoColumnsInsertString, getNotExpression, getNullColumnString, getQueryHintString, getQueryHintString, getReadLockString, getReadLockString, getResultSet, getResultSet, getResultSet, getSchemaNameResolver, getSelectGUIDString, getSequenceExporter, getSqlTypeDescriptorOverride, getTableComment, getTableExporter, getTableTypeString, getTypeName, getTypeName, getUniqueDelegate, getUniqueKeyExporter, getWriteLockString, getWriteLockString, hasAlterTable, hasSelfReferentialForeignKeyBug, inlineLiteral, isJdbcLogWarningsEnabledByDefault, isLegacyLimitHandlerBehaviorEnabled, isLockTimeoutParameterized, isTypeNameRegistered, openQuote, prependComment, qualifyIndexName, quote, registerColumnType, registerColumnType, registerFunction, registerHibernateType, registerHibernateType, registerKeyword, registerResultSetOutParameter, registerResultSetOutParameter, remapSqlTypeDescriptor, renderOrderByElement, replaceResultVariableInOrderByClauseWithPosition, requiresParensForTupleDistinctCounts, supportsBindAsCallableArgument, supportsCascadeDelete, supportsCaseInsensitiveLike, supportsCircularCascadeDeleteConstraints, supportsExistsInSelect, supportsExpectedLobUsagePattern, supportsIfExistsAfterAlterTable, supportsIfExistsAfterConstraintName, supportsIfExistsBeforeConstraintName, supportsJdbcConnectionLobCreation, supportsLimitOffset, supportsNationalizedTypes, supportsNoColumnsInsert, supportsNonQueryWithCTE, supportsNotNullUnique, supportsNoWait, supportsOuterJoinForUpdate, supportsParametersInInsertSelect, supportsPartitionBy, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsRowValueConstructorSyntax, supportsRowValueConstructorSyntaxInInList, supportsRowValueConstructorSyntaxInSet, supportsSelectAliasInGroupByClause, supportsSkipLocked, supportsSubqueryOnMutatingTable, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTupleCounts, supportsTuplesInSubqueries, supportsUnboundedLobLocatorMaterialization, supportsUnique, supportsUniqueConstraintInCreateAlterTable, supportsValuesList, supportsVariableLimit, toString, transformSelectString, useFollowOnLocking, useFollowOnLocking, useInputStreamToInsertBlob, useMaxForLimit

    Methods inherited from class java.lang.Object

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

    • DemoHSQLDialect

      public DemoHSQLDialect()
  • Method Details

    • dropConstraints

      public boolean dropConstraints()
      To avoid seeing all of the hibernate errors on first startup, disable dropping constraints.
      Overrides:
      dropConstraints in class org.hibernate.dialect.HSQLDialect
    • getCascadeConstraintsString

      public String getCascadeConstraintsString()
      Since we aren't dropping constraints anymore, we must cascade when dropping tables to avoid violating FKs.
      Overrides:
      getCascadeConstraintsString in class org.hibernate.dialect.HSQLDialect
    • supportsIfExistsBeforeTableName

      public boolean supportsIfExistsBeforeTableName()
      Due to HSQL syntax and the way Dialect.getDropTableString(String) arranges the statements, we must put the if exists before the table name.
      Overrides:
      supportsIfExistsBeforeTableName in class org.hibernate.dialect.HSQLDialect
    • supportsIfExistsAfterTableName

      public boolean supportsIfExistsAfterTableName()
      Overrides:
      supportsIfExistsAfterTableName in class org.hibernate.dialect.HSQLDialect
      See Also: