Class SybaseAnywhereDialect

  • All Implemented Interfaces:
    org.hibernate.boot.model.FunctionContributor, org.hibernate.boot.model.TypeContributor, org.hibernate.exception.spi.ConversionContext

    public class SybaseAnywhereDialect
    extends org.hibernate.dialect.SybaseDialect
    SQL Dialect for Sybase/SQL Anywhere (Tested on ASA 8.x)
    • Nested Class Summary

      • 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.SybaseDialect

        jtdsDriver
      • 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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      String appendLockHint​(org.hibernate.LockOptions mode, String tableName)  
      String applyLocksToSql​(String sql, org.hibernate.LockOptions aliasedLockOptions, Map<String,​String[]> keyColumnNames)  
      protected String columnType​(int sqlTypeCode)  
      String currentDate()  
      String currentTime()  
      String currentTimestamp()  
      boolean dropConstraints()
      ASA does not require to drop constraint before dropping tables, so disable it.
      String getDual()  
      String getForUpdateString()  
      String getForUpdateString​(String aliases)  
      String getFromDualForSelectOnly()  
      org.hibernate.dialect.identity.IdentityColumnSupport getIdentityColumnSupport()  
      org.hibernate.dialect.pagination.LimitHandler getLimitHandler()  
      int getMaxVarcharLength()  
      String getNoColumnsInsertString()
      Sybase Anywhere syntax would require a "DEFAULT" for each column specified, but I suppose Hibernate use this syntax only with tables with just 1 column
      org.hibernate.sql.ast.SqlAstTranslatorFactory getSqlAstTranslatorFactory()  
      org.hibernate.dialect.TimeZoneSupport getTimeZoneSupport()  
      org.hibernate.dialect.RowLockStrategy getWriteRowLockStrategy()  
      void initializeFunctionRegistry​(org.hibernate.boot.model.FunctionContributions functionContributions)  
      boolean supportsLateral()  
      boolean supportsWindowFunctions()  
      boolean useMaterializedLobWhenCapacityExceeded()  
      • Methods inherited from class org.hibernate.dialect.SybaseDialect

        appendDatetimeFormat, appendDateTimeLiteral, appendDateTimeLiteral, appendDateTimeLiteral, buildIdentifierHelper, canCreateSchema, castPattern, contributeTypes, extractPattern, getAlterColumnTypeString, getCallableStatementSupport, getCurrentSchemaCommand, getDmlTargetColumnQualifierSupport, getDriverKind, getInExpressionCountLimit, getMaxIdentifierLength, getMinimumSupportedVersion, getNameQualifierSupport, getNationalizationSupport, getNullColumnString, getParameterCountLimit, getSqmTranslatorFactory, getUniqueDelegate, resolveSqlTypeDescriptor, resolveSqlTypeLength, supportsAlterColumnType, supportsFractionalTimestampArithmetic, supportsFromClauseInUpdate, supportsNamedParameters, supportsNullPrecedence, supportsStandardCurrentTimestampFunction, timestampaddPattern, timestampdiffPattern, translateExtractField
      • Methods inherited from class org.hibernate.dialect.AbstractTransactSQLDialect

        appendBinaryLiteral, doesReadCommittedCauseWritersToBlockReaders, doesRepeatableReadCauseReadersToBlockWriters, getAddColumnString, getCurrentTimestampSelectString, getDefaultStatementBatchSize, getFallbackSqmInsertStrategy, getFallbackSqmMutationStrategy, getNullOrdering, getPreferredSqlTypeCodeForBoolean, getResultSet, getSelectGUIDString, getSupportedTemporaryTableKind, getTemporaryTableAfterUseAction, getTemporaryTableBeforeUseAction, getTemporaryTableCreateCommand, isCurrentTimestampSelectStringCallable, qualifyIndexName, registerResultSetOutParameter, replaceLtrimRtrim, replaceLtrimRtrim, requiresCastForConcatenatingNonStrings, supportsCurrentTimestampSelection, supportsExistsInSelect, supportsPartitionBy, supportsTupleDistinctCounts, trimPattern
      • Methods inherited from class org.hibernate.dialect.Dialect

        addSqlHintOrComment, appendArrayLiteral, appendBooleanValueString, appendIntervalLiteral, appendLiteral, appendUUIDLiteral, augmentPhysicalTableTypes, augmentRecognizedTableTypes, buildSQLExceptionConversionDelegate, buildStringToBooleanCast, buildStringToBooleanCastDecode, buildStringToBooleanDecode, canBatchTruncate, canCreateCatalog, canDisableConstraints, castType, checkVersion, closeQuote, contribute, contributeFunctions, createOptionalTableUpdateOperation, currentLocalTime, currentLocalTimestamp, currentTimestampWithTimeZone, defaultScrollMode, doesRoundTemporalOnOverflow, equivalentTypes, escapeComment, forceLobAsLastValue, generatedAs, getAddColumnSuffixString, getAddForeignKeyConstraintString, getAddForeignKeyConstraintString, getAddPrimaryKeyConstraintString, getAggregateSupport, getAlterTableString, getArrayTypeName, getAuxiliaryDatabaseObjectExporter, getBatchLoadSizingStrategy, getBeforeDropStatement, getCascadeConstraintsString, getCaseInsensitiveLike, getCheckCondition, getCheckCondition, getCheckCondition, getCheckCondition, getCheckCondition, getColumnAliasExtractor, getColumnComment, getCreateCatalogCommand, getCreateEnumTypeCommand, getCreateEnumTypeCommand, getCreateIndexString, getCreateIndexTail, getCreateMultisetTableString, getCreateSchemaCommand, getCreateTableString, getCreateTemporaryTableColumnAnnotation, getCreateUserDefinedTypeExtensionsString, getCreateUserDefinedTypeKindString, getCrossReferenceParentTableFilter, getDefaultDecimalPrecision, getDefaultIntervalSecondScale, getDefaultLobLength, getDefaultNonContextualLobCreation, getDefaultProperties, getDefaultTimestampPrecision, getDefaultUseGetGeneratedKeys, getDisableConstraintsStatement, getDisableConstraintStatement, getDoublePrecision, getDropCatalogCommand, getDropEnumTypeCommand, getDropEnumTypeCommand, getDropForeignKeyString, getDropSchemaCommand, getDropTableString, getDropUniqueKeyString, getEnableConstraintsStatement, getEnableConstraintStatement, getEnumTypeDeclaration, getEnumTypeDeclaration, getFallbackSchemaManagementTool, getFloatPrecision, getForeignKeyExporter, getForUpdateNowaitString, getForUpdateNowaitString, getForUpdateSkipLockedString, getForUpdateSkipLockedString, getForUpdateString, getForUpdateString, getForUpdateString, getFractionalSecondPrecisionInNanos, getFunctionalDependencyAnalysisSupport, getGroupBySelectItemReferenceStrategy, getHqlTranslator, getIndexExporter, getKeywords, getLobMergeStrategy, getLockingStrategy, getLockRowIdentifier, getLowercaseFunction, getMaxAliasLength, getMaxNVarcharCapacity, getMaxNVarcharLength, getMaxVarbinaryCapacity, getMaxVarbinaryLength, getMaxVarcharCapacity, getMultiKeyLoadSizingStrategy, getNativeIdentifierGeneratorStrategy, getNativeParameterMarkerStrategy, getNullColumnString, getPreferredSqlTypeCodeForArray, getQueryHintString, getQueryHintString, getQuerySequencesString, getReadLockString, getReadLockString, getReadRowLockStrategy, getResultSet, getResultSet, getRowIdColumnString, getSchemaNameResolver, getSelectClauseNullString, getSelectClauseNullString, getSequenceExporter, getSequenceInformationExtractor, getSequenceSupport, getSizeStrategy, getTableCleaner, getTableComment, getTableExporter, getTableMigrator, getTableTypeString, getTemporaryTableCreateOptions, getTemporaryTableDdlTransactionHandling, getTemporaryTableDropCommand, getTemporaryTableExporter, getTemporaryTableTruncateCommand, getTimeoutInSeconds, getTruncateTableStatement, getTruncateTableStatements, getUniqueKeyExporter, getUserDefinedTypeComment, getUserDefinedTypeExporter, getVersion, getViolatedConstraintNameExtractor, getWriteLockString, getWriteLockString, hasAlterTable, hasDataTypeBeforeGeneratedAs, hasSelfReferentialForeignKeyBug, initDefaultProperties, inlineLiteral, isAnsiNullOn, isEmptyStringTreatedAsNull, isJdbcLogWarningsEnabledByDefault, isLob, isLockTimeoutParameterized, openQuote, ordinal, prependComment, quote, quoteCollation, registerColumnTypes, registerDefaultKeywords, registerKeyword, registerKeywords, registerResultSetOutParameter, requiresFloatCastingOfIntegerDivision, requiresParensForTupleCounts, requiresParensForTupleDistinctCounts, resolveSqlTypeCode, resolveSqlTypeCode, rowId, rowIdSqlType, supportsBatchUpdates, supportsBindAsCallableArgument, supportsBindingNullForSetObject, supportsBindingNullSqlTypeForSetNull, supportsBitType, supportsCascadeDelete, supportsCaseInsensitiveLike, supportsCircularCascadeDeleteConstraints, supportsColumnCheck, supportsCommentOn, supportsConflictClauseForInsertCTE, supportsDistinctFromPredicate, supportsExpectedLobUsagePattern, supportsFetchClause, supportsIfExistsAfterAlterTable, supportsIfExistsAfterConstraintName, supportsIfExistsAfterTableName, supportsIfExistsAfterTypeName, supportsIfExistsBeforeConstraintName, supportsIfExistsBeforeTableName, supportsIfExistsBeforeTypeName, supportsInsertReturning, supportsInsertReturningGeneratedKeys, supportsInsertReturningRowId, supportsIsTrue, supportsJdbcConnectionLobCreation, supportsLobValueChangePropagation, supportsLockTimeouts, supportsMaterializedLobAccess, supportsNationalizedMethods, supportsNoColumnsInsert, supportsNonQueryWithCTE, supportsNoWait, supportsOffsetInSubquery, supportsOrderByInSubquery, supportsOrdinalSelectItemReference, supportsOuterJoinForUpdate, supportsParametersInInsertSelect, supportsPredicateAsExpression, supportsRecursiveCTE, supportsRefCursors, supportsResultSetPositionQueryMethodsOnForwardOnlyCursor, supportsSkipLocked, supportsStandardArrays, supportsSubqueryInSelect, supportsSubqueryOnMutatingTable, supportsSubselectAsInPredicateLHS, supportsTableCheck, supportsTemporalLiteralOffset, supportsTemporaryTablePrimaryKey, supportsTemporaryTables, supportsTruncateWithCast, supportsTupleCounts, supportsUnboundedLobLocatorMaterialization, supportsUnionAll, supportsUnionInSubquery, supportsUpdateReturning, supportsValuesList, supportsValuesListForInsert, supportsWait, toBooleanValueString, toQuotedIdentifier, toString, transformSelectString, translateDurationField, trimPattern, unquoteGetGeneratedKeys, useArrayForMultiValuedParameters, useConnectionToCreateLob, useCrossReferenceForeignKeys, useFollowOnLocking, useInputStreamToInsertBlob
    • Constructor Detail

      • SybaseAnywhereDialect

        public SybaseAnywhereDialect()
      • SybaseAnywhereDialect

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

        public SybaseAnywhereDialect​(org.hibernate.dialect.DatabaseVersion version)
    • Method Detail

      • columnType

        protected String columnType​(int sqlTypeCode)
        Overrides:
        columnType in class org.hibernate.dialect.AbstractTransactSQLDialect
      • useMaterializedLobWhenCapacityExceeded

        public boolean useMaterializedLobWhenCapacityExceeded()
        Overrides:
        useMaterializedLobWhenCapacityExceeded in class org.hibernate.dialect.Dialect
      • initializeFunctionRegistry

        public void initializeFunctionRegistry​(org.hibernate.boot.model.FunctionContributions functionContributions)
        Overrides:
        initializeFunctionRegistry in class org.hibernate.dialect.SybaseDialect
      • getMaxVarcharLength

        public int getMaxVarcharLength()
        Overrides:
        getMaxVarcharLength in class org.hibernate.dialect.Dialect
      • getSqlAstTranslatorFactory

        public org.hibernate.sql.ast.SqlAstTranslatorFactory getSqlAstTranslatorFactory()
        Overrides:
        getSqlAstTranslatorFactory in class org.hibernate.dialect.SybaseDialect
      • getTimeZoneSupport

        public org.hibernate.dialect.TimeZoneSupport getTimeZoneSupport()
        Overrides:
        getTimeZoneSupport in class org.hibernate.dialect.Dialect
      • currentDate

        public String currentDate()
        Overrides:
        currentDate in class org.hibernate.dialect.Dialect
      • currentTime

        public String currentTime()
        Overrides:
        currentTime in class org.hibernate.dialect.Dialect
      • currentTimestamp

        public String currentTimestamp()
        Overrides:
        currentTimestamp in class org.hibernate.dialect.Dialect
      • getNoColumnsInsertString

        public String getNoColumnsInsertString()
        Sybase Anywhere syntax would require a "DEFAULT" for each column specified, but I suppose Hibernate use this syntax only with tables with just 1 column

        Overrides:
        getNoColumnsInsertString in class org.hibernate.dialect.Dialect
      • dropConstraints

        public boolean dropConstraints()
        ASA does not require to drop constraint before dropping tables, so disable it.

        NOTE : Also, the DROP statement syntax used by Hibernate to drop constraints is not compatible with ASA.

        Overrides:
        dropConstraints in class org.hibernate.dialect.Dialect
      • supportsWindowFunctions

        public boolean supportsWindowFunctions()
        Overrides:
        supportsWindowFunctions in class org.hibernate.dialect.Dialect
      • supportsLateral

        public boolean supportsLateral()
        Overrides:
        supportsLateral in class org.hibernate.dialect.Dialect
      • getIdentityColumnSupport

        public org.hibernate.dialect.identity.IdentityColumnSupport getIdentityColumnSupport()
        Overrides:
        getIdentityColumnSupport in class org.hibernate.dialect.SybaseDialect
      • getWriteRowLockStrategy

        public org.hibernate.dialect.RowLockStrategy getWriteRowLockStrategy()
        Overrides:
        getWriteRowLockStrategy in class org.hibernate.dialect.AbstractTransactSQLDialect
      • getForUpdateString

        public String getForUpdateString()
        Overrides:
        getForUpdateString in class org.hibernate.dialect.AbstractTransactSQLDialect
      • getForUpdateString

        public String getForUpdateString​(String aliases)
        Overrides:
        getForUpdateString in class org.hibernate.dialect.Dialect
      • appendLockHint

        public String appendLockHint​(org.hibernate.LockOptions mode,
                                     String tableName)
        Overrides:
        appendLockHint in class org.hibernate.dialect.AbstractTransactSQLDialect
      • applyLocksToSql

        public String applyLocksToSql​(String sql,
                                      org.hibernate.LockOptions aliasedLockOptions,
                                      Map<String,​String[]> keyColumnNames)
        Overrides:
        applyLocksToSql in class org.hibernate.dialect.AbstractTransactSQLDialect
      • getLimitHandler

        public org.hibernate.dialect.pagination.LimitHandler getLimitHandler()
        Overrides:
        getLimitHandler in class org.hibernate.dialect.Dialect
      • getDual

        public String getDual()
        Overrides:
        getDual in class org.hibernate.dialect.Dialect
      • getFromDualForSelectOnly

        public String getFromDualForSelectOnly()
        Overrides:
        getFromDualForSelectOnly in class org.hibernate.dialect.Dialect