Class OracleLegacyDialect

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

public class OracleLegacyDialect extends org.hibernate.dialect.Dialect
A SQL dialect for Oracle 8i and above.
  • Nested Class Summary

    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
    protected final boolean
     
    protected final boolean
     
    protected final int
     
    protected final int
     
    protected final boolean
     
    static final String
     

    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
     
    OracleLegacyDialect(org.hibernate.dialect.DatabaseVersion version)
     
    OracleLegacyDialect(org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo info)
     
    OracleLegacyDialect(org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo info, org.hibernate.dialect.OracleServerConfiguration serverConfiguration)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    appendCheckConstraintOptions(org.hibernate.mapping.CheckConstraint checkConstraint, String sqlCheckConstraint)
     
    org.hibernate.engine.jdbc.env.spi.IdentifierHelper
    buildIdentifierHelper(org.hibernate.engine.jdbc.env.spi.IdentifierHelperBuilder builder, DatabaseMetaData metadata)
     
    castPattern(org.hibernate.query.sqm.CastType from, org.hibernate.query.sqm.CastType to)
    Oracle doesn't have any sort of Types.BOOLEAN type or Types.TIME type, and its default behavior for casting dates and timestamps to and from strings is just awful.
    static org.hibernate.dialect.Replacer
    datetimeFormat(String format, boolean useFm, boolean resetFm)
     
    extractPattern(org.hibernate.query.common.TemporalUnit unit)
    Oracle supports a limited list of temporal fields in the extract() function, but we can emulate some of them by using to_char() with a format string instead of extract().
     
    long
    We minimize multiplicative factors by using seconds (with fractional part) as the "native" precision for duration arithmetic.
    org.hibernate.dialect.temptable.TemporaryTableStrategy
     
    org.hibernate.dialect.temptable.TemporaryTableStrategy
     
    protected int
    Oracle doesn't support the generate_series function or lateral recursive CTEs, so it has to be emulated with a top level recursive CTE which requires an upper bound on the amount of elements that the series can return.
     
    getReadLockString(int timeout)
     
    getReadLockString(String aliases, int timeout)
     
    getSelectClauseNullString(int sqlType, org.hibernate.type.spi.TypeConfiguration typeConfiguration)
     
    org.hibernate.dialect.temptable.TemporaryTableKind
     
     
    getWriteLockString(int timeout)
     
    getWriteLockString(String aliases, int timeout)
     
    boolean
     
    boolean
     
    boolean
     
    boolean
    Oracle has neither BIT nor BOOLEAN.
    boolean
    useFollowOnLocking(String sql, org.hibernate.query.spi.QueryOptions queryOptions)
    For Oracle, the FOR UPDATE clause cannot be applied when using ORDER BY, DISTINCT or views.

    Methods declared in class org.hibernate.dialect.Dialect

    addPartitionKeyToPrimaryKey, addSqlHintOrComment, addUseIndexQueryHint, appendArrayLiteral, appendBinaryLiteral, appendBooleanValueString, 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, castType, causesRollback, checkVersion, closeQuote, columnType, contribute, contributeFunctions, contributeTypes, createOptionalTableUpdateOperation, currentDate, currentLocalTime, currentLocalTimestamp, currentTime, currentTimestamp, currentTimestampWithTimeZone, defaultScrollMode, determineDatabaseVersion, doesReadCommittedCauseWritersToBlockReaders, doesRepeatableReadCauseReadersToBlockWriters, doesRoundTemporalOnOverflow, dropConstraints, equivalentTypes, escapeComment, 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, getColumnDefaultString, getCreateCatalogCommand, getCreateEnumTypeCommand, getCreateEnumTypeCommand, getCreateIndexString, getCreateIndexTail, getCreateMultisetTableString, getCreateSchemaCommand, getCreateTableString, getCreateTemporaryTableColumnAnnotation, getCreateUserDefinedTypeExtensionsString, getCreateUserDefinedTypeKindString, getCrossReferenceParentTableFilter, 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, getForeignKeyExporter, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateSkipLockedString, getForUpdateSkipLockedString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getForUpdateString, getFromDualForSelectOnly, getFunctionalDependencyAnalysisSupport, getGroupBySelectItemReferenceStrategy, getHqlTranslator, getIdentityColumnSupport, getIndexExporter, getInExpressionCountLimit, getInformationExtractor, getKeywords, getLimitHandler, getLobMergeStrategy, getLockingClauseStrategy, getLockingStrategy, getLockingStrategy, getLockingSupport, getLockRowIdentifier, getLowercaseFunction, getMaxAliasLength, getMaxIdentifierLength, getMaxNVarcharCapacity, getMaxNVarcharLength, getMaxTimestampPrecision, getMaxVarbinaryCapacity, getMaxVarbinaryLength, getMaxVarcharCapacity, getMaxVarcharLength, getMinimumSupportedVersion, getMultiKeyLoadSizingStrategy, getNameQualifierSupport, getNationalizationSupport, getNativeIdentifierGeneratorStrategy, getNativeParameterMarkerStrategy, getNoColumnsInsertString, getNullColumnString, getNullColumnString, getNullOrdering, getParameterCountLimit, getPersistentTemporaryTableStrategy, getPessimisticLockStyle, getPreferredSqlTypeCodeForArray, getPreferredSqlTypeCodeForBoolean, getQueryHintString, getQueryHintString, getQuerySequencesString, getReadLockString, getReadLockString, getReadRowLockStrategy, getResultSet, getResultSet, getResultSet, getRowIdColumnString, getSchemaNameResolver, getSelectClauseNullString, getSelectGUIDString, getSequenceExporter, getSequenceInformationExtractor, getSequenceSupport, getSetOperatorSqlString, getSizeStrategy, getSqlAstTranslatorFactory, getSqmTranslatorFactory, getTableCleaner, getTableComment, getTableExporter, getTableMigrator, getTableTypeString, getTemporalTableSupport, getTemporaryTableAfterUseAction, getTemporaryTableBeforeUseAction, getTemporaryTableCreateCommand, getTemporaryTableDdlTransactionHandling, getTemporaryTableDropCommand, getTemporaryTableExporter, getTemporaryTableTruncateCommand, getTimeoutInSeconds, getTimeZoneSupport, getTruncateTableStatement, getTruncateTableStatements, getUniqueDelegate, getUniqueKeyExporter, getUserDefinedTypeExporter, getValueLOBFragmentForExtraCreateTableInfo, getVersion, getViolatedConstraintNameExtractor, getWriteLockString, getWriteLockString, getWriteRowLockStrategy, hasAlterTable, hasDataTypeBeforeGeneratedAs, hasSelfReferentialForeignKeyBug, initDefaultProperties, initializeFunctionRegistry, isCurrentTimestampSelectStringCallable, isCurrentTimestampStable, isEmptyStringTreatedAsNull, isJdbcLogWarningsEnabledByDefault, isLob, narrowCastType, openQuote, ordinal, prependComment, qualifyIndexName, quote, quoteCollation, registerColumnTypes, registerDefaultKeywords, registerKeyword, registerKeywords, registerResultSetOutParameter, registerResultSetOutParameter, requiresCastForConcatenatingNonStrings, requiresColumnListInCreateView, requiresFloatCastingOfIntegerDivision, requiresNotNullBeforeDefault, requiresParensForTupleCounts, requiresParensForTupleDistinctCounts, resolveSqlTypeCode, resolveSqlTypeCode, resolveSqlTypeDescriptor, resolveSqlTypeLength, roundsToMaxPrecisionFirst, rowId, rowIdSqlType, stripsTrailingSpacesFromChar, supportsAlterColumnType, supportsArrayConstructor, supportsBatchUpdates, supportsBindAsCallableArgument, supportsBindingNullForSetObject, supportsBindingNullSqlTypeForSetNull, supportsCascadeDelete, supportsCaseInsensitiveLike, supportsCircularCascadeDeleteConstraints, supportsColumnCheck, supportsCommentOn, supportsConflictClauseForInsertCTE, supportsCrossJoin, supportsCteHeaderColumnList, supportsCurrentTimestampSelection, supportsDistinctFromPredicate, supportsDuplicateSelectItemsInQueryGroup, supportsExceptAll, supportsExistsInSelect, supportsExpectedLobUsagePattern, supportsFetchClause, supportsFilterClause, supportsForUpdate, supportsFractionalTimestampArithmetic, supportsFromClauseInUpdate, supportsIfExistsAfterAlterTable, supportsIfExistsAfterConstraintName, supportsIfExistsAfterTableName, supportsIfExistsAfterTypeName, supportsIfExistsBeforeConstraintName, supportsIfExistsBeforeIndexName, supportsIfExistsBeforeTableName, supportsIfExistsBeforeTypeName, supportsInsertReturning, supportsInsertReturningGeneratedKeys, supportsInsertReturningRowId, supportsIntersect, supportsIsTrue, supportsJdbcConnectionLobCreation, supportsJoinInMutationStatementSubquery, supportsJoinsInDelete, supportsLateral, supportsLobValueChangePropagation, supportsLockTimeouts, supportsMaterializedLobAccess, supportsNamedColumnCheck, supportsNamedParameters, supportsNationalizedMethods, supportsNestedSubqueryCorrelation, supportsNestedWithClause, supportsNoColumnsInsert, supportsNonQueryWithCTE, supportsNotNullAfterGeneratedAs, 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, supportsTableCheck, supportsTableOptions, supportsTemporalLiteralOffset, supportsTemporaryTablePrimaryKey, supportsTemporaryTables, supportsTruncateWithCast, supportsTupleCounts, supportsTupleDistinctCounts, supportsUnboundedLobLocatorMaterialization, supportsUnionAll, supportsUnionInSubquery, supportsUniqueConstraints, supportsUpdateReturning, supportsUserDefinedTypes, supportsValueLOBAccess, supportsValuesList, supportsValuesListForInsert, supportsWait, supportsWindowFunctions, supportsWithClause, supportsWithClauseInSubquery, throttleDdl, timestampaddPattern, timestampdiffPattern, toBooleanValueString, toQuotedIdentifier, toString, transformSelectString, translateDurationField, translateExtractField, trimPattern, unquoteGetGeneratedKeys, useArrayForMultiValuedParameters, useConnectionToCreateLob, useCrossReferenceForeignKeys, useInputStreamToInsertBlob, useMaterializedLobWhenCapacityExceeded

    Methods declared in class Object

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

    • PREFER_LONG_RAW

      public static final String PREFER_LONG_RAW
      See Also:
    • autonomous

      protected final boolean autonomous
    • extended

      protected final boolean extended
    • applicationContinuity

      protected final boolean applicationContinuity
    • driverMajorVersion

      protected final int driverMajorVersion
    • driverMinorVersion

      protected final int driverMinorVersion
  • Constructor Details

    • OracleLegacyDialect

      public OracleLegacyDialect()
    • OracleLegacyDialect

      public OracleLegacyDialect(org.hibernate.dialect.DatabaseVersion version)
    • OracleLegacyDialect

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

      public OracleLegacyDialect(org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo info, org.hibernate.dialect.OracleServerConfiguration serverConfiguration)
  • Method Details

    • isAutonomous

      public boolean isAutonomous()
    • isExtended

      public boolean isExtended()
    • isApplicationContinuity

      public boolean isApplicationContinuity()
    • getMaximumSeriesSize

      protected int getMaximumSeriesSize()
      Oracle doesn't support the generate_series function or lateral recursive CTEs, so it has to be emulated with a top level recursive CTE which requires an upper bound on the amount of elements that the series can return.
    • castPattern

      public String castPattern(org.hibernate.query.sqm.CastType from, org.hibernate.query.sqm.CastType to)
      Oracle doesn't have any sort of Types.BOOLEAN type or Types.TIME type, and its default behavior for casting dates and timestamps to and from strings is just awful.
      Overrides:
      castPattern in class org.hibernate.dialect.Dialect
    • getFractionalSecondPrecisionInNanos

      public long getFractionalSecondPrecisionInNanos()
      We minimize multiplicative factors by using seconds (with fractional part) as the "native" precision for duration arithmetic.
      Overrides:
      getFractionalSecondPrecisionInNanos in class org.hibernate.dialect.Dialect
    • extractPattern

      public String extractPattern(org.hibernate.query.common.TemporalUnit unit)
      Oracle supports a limited list of temporal fields in the extract() function, but we can emulate some of them by using to_char() with a format string instead of extract(). Thus, the additional supported fields are TemporalUnit.DAY_OF_YEAR, TemporalUnit.DAY_OF_MONTH, TemporalUnit.DAY_OF_YEAR, and TemporalUnit.WEEK.
      Overrides:
      extractPattern in class org.hibernate.dialect.Dialect
    • supportsBitType

      public boolean supportsBitType()
      Oracle has neither BIT nor BOOLEAN.
      Overrides:
      supportsBitType in class org.hibernate.dialect.Dialect
      Returns:
      false
    • getNativeValueGenerationStrategy

      public GenerationType getNativeValueGenerationStrategy()
      Overrides:
      getNativeValueGenerationStrategy in class org.hibernate.dialect.Dialect
    • getSelectClauseNullString

      public String getSelectClauseNullString(int sqlType, org.hibernate.type.spi.TypeConfiguration typeConfiguration)
      Overrides:
      getSelectClauseNullString in class org.hibernate.dialect.Dialect
    • getLocalTemporaryTableStrategy

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

      public org.hibernate.dialect.temptable.TemporaryTableStrategy getGlobalTemporaryTableStrategy()
      Overrides:
      getGlobalTemporaryTableStrategy in class org.hibernate.dialect.Dialect
    • getSupportedTemporaryTableKind

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

      public String getTemporaryTableCreateOptions()
      Overrides:
      getTemporaryTableCreateOptions in class org.hibernate.dialect.Dialect
    • useFollowOnLocking

      public boolean useFollowOnLocking(String sql, org.hibernate.query.spi.QueryOptions queryOptions)
      For Oracle, the FOR UPDATE clause cannot be applied when using ORDER BY, DISTINCT or views.
      Overrides:
      useFollowOnLocking in class org.hibernate.dialect.Dialect
      See Also:
    • getCurrentSchemaCommand

      public String getCurrentSchemaCommand()
      Overrides:
      getCurrentSchemaCommand in class org.hibernate.dialect.Dialect
    • getWriteLockString

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

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

      public String getReadLockString(int timeout)
      Overrides:
      getReadLockString in class org.hibernate.dialect.Dialect
    • getReadLockString

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

      public static org.hibernate.dialect.Replacer datetimeFormat(String format, boolean useFm, boolean resetFm)
    • 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
    • appendCheckConstraintOptions

      public String appendCheckConstraintOptions(org.hibernate.mapping.CheckConstraint checkConstraint, String sqlCheckConstraint)
      Overrides:
      appendCheckConstraintOptions in class org.hibernate.dialect.Dialect