Class SybaseASEDialect

    • Constructor Detail

      • SybaseASEDialect

        public SybaseASEDialect()
    • Method Detail

      • getMaxVarcharLength

        public int getMaxVarcharLength()
        Description copied from class: Dialect
        The longest possible length of a Types.VARCHAR-like column. For longer column lengths, use some sort of text-like type for the column.
        Overrides:
        getMaxVarcharLength in class Dialect
      • getFloatPrecision

        public int getFloatPrecision()
        Description copied from class: Dialect
        This is the default precision for a generated column mapped to a Java Float or float. That is, a value representing "single precision".

        Usually 24 binary digits, at least for databases with a conventional interpretation of the ANSI SQL specification.

        Overrides:
        getFloatPrecision in class Dialect
        Returns:
        a value representing "single precision", usually in binary digits, but sometimes in decimal digits
      • getDoublePrecision

        public int getDoublePrecision()
        Description copied from class: Dialect
        This is the default precision for a generated column mapped to a Java Double or double. That is, a value representing "double precision".

        Usually 53 binary digits, at least for databases with a conventional interpretation of the ANSI SQL specification.

        Overrides:
        getDoublePrecision in class Dialect
        Returns:
        a value representing "double precision", usually in binary digits, but sometimes in decimal digits
      • supportsBitType

        public boolean supportsBitType()
        The Sybase ASE BIT type does not allow null values, so we don't use it.
        Overrides:
        supportsBitType in class Dialect
        Returns:
        false
      • supportsDistinctFromPredicate

        public boolean supportsDistinctFromPredicate()
        Description copied from class: Dialect
        Is this SQL dialect known to support some kind of distinct from predicate.

        Basically, does it support syntax like "... where FIRST_NAME IS DISTINCT FROM LAST_NAME"

        Overrides:
        supportsDistinctFromPredicate in class Dialect
        Returns:
        True if this SQL dialect is known to support some kind of distinct from predicate; false otherwise
      • contributeTypes

        public void contributeTypes​(TypeContributions typeContributions,
                                    ServiceRegistry serviceRegistry)
        Description copied from class: Dialect
        Allows the Dialect to contribute additional types
        Overrides:
        contributeTypes in class SybaseDialect
        Parameters:
        typeContributions - Callback to contribute the types
        serviceRegistry - The service registry
      • resolveSqlTypeLength

        public int resolveSqlTypeLength​(String columnTypeName,
                                        int jdbcTypeCode,
                                        int precision,
                                        int scale,
                                        int displaySize)
        Overrides:
        resolveSqlTypeLength in class Dialect
      • currentDate

        public String currentDate()
        Description copied from class: Dialect
        Translation of the HQL/JPQL current_date function, which maps to the Java type java.sql.Date, and of the HQL local_date function which maps to the Java type java.sql.LocalDate.
        Overrides:
        currentDate in class Dialect
      • currentTime

        public String currentTime()
        Description copied from class: Dialect
        Translation of the HQL/JPQL current_time function, which maps to the Java type java.sql.Time which is a time with no time zone. This contradicts ANSI SQL where current_time has the type TIME WITH TIME ZONE.

        It is recommended to override this in dialects for databases which support localtime or time at local.

        Overrides:
        currentTime in class Dialect
      • currentTimestamp

        public String currentTimestamp()
        Description copied from class: Dialect
        Translation of the HQL/JPQL current_timestamp function, which maps to the Java type java.sql.Timestamp which is a datetime with no time zone. This contradicts ANSI SQL where current_timestamp has the type TIMESTAMP WITH TIME ZONE.

        It is recommended to override this in dialects for databases which support localtimestamp or timestamp at local.

        Overrides:
        currentTimestamp in class Dialect
      • timestampaddPattern

        public String timestampaddPattern​(TemporalUnit unit,
                                          jakarta.persistence.TemporalType temporalType,
                                          IntervalType intervalType)
        Description copied from class: Dialect
        Obtain a pattern for the SQL equivalent to a timestampadd() function call. The resulting pattern must contain ?1, ?2, and ?3 placeholders for the arguments.
        Overrides:
        timestampaddPattern in class SybaseDialect
        Parameters:
        unit - The unit to add to the temporal
        temporalType - The type of the temporal
        intervalType - The type of interval to add or null if it's not a native interval
      • getFractionalSecondPrecisionInNanos

        public long getFractionalSecondPrecisionInNanos()
        Description copied from class: Dialect
        The "native" precision for arithmetic with datetimes and day-to-second durations. Datetime differences will be calculated with this precision except when a precision is explicitly specified as a TemporalUnit.

        Usually 1 (nanoseconds), 1_000 (microseconds), or 1_000_000 (milliseconds).

        Overrides:
        getFractionalSecondPrecisionInNanos in class Dialect
        Returns:
        the precision, specified as a quantity of nanoseconds
        See Also:
        TemporalUnit.NATIVE
      • timestampdiffPattern

        public String timestampdiffPattern​(TemporalUnit unit,
                                           jakarta.persistence.TemporalType fromTemporalType,
                                           jakarta.persistence.TemporalType toTemporalType)
        Description copied from class: Dialect
        Obtain a pattern for the SQL equivalent to a timestampdiff() function call. The resulting pattern must contain ?1, ?2, and ?3 placeholders for the arguments.
        Overrides:
        timestampdiffPattern in class SybaseDialect
        Parameters:
        unit - the first argument
        fromTemporalType - true if the first argument is a timestamp, false if a date
        toTemporalType - true if the second argument is
      • supportsCascadeDelete

        public boolean supportsCascadeDelete()
        Description copied from class: Dialect
        Does this dialect support cascaded delete on foreign key definitions?
        Overrides:
        supportsCascadeDelete in class Dialect
        Returns:
        true indicates that the dialect does support cascaded delete on foreign keys.
      • getMaxAliasLength

        public int getMaxAliasLength()
        Description copied from class: Dialect
        What is the maximum length Hibernate can use for generated aliases?

        The maximum here should account for the fact that Hibernate often needs to append "uniqueing" information to the end of generated aliases. That "uniqueing" information will be added to the end of a identifier generated to the length specified here; so be sure to leave some room (generally speaking 5 positions will suffice).

        Overrides:
        getMaxAliasLength in class Dialect
        Returns:
        The maximum length.
      • getMaxIdentifierLength

        public int getMaxIdentifierLength()
        Description copied from class: Dialect
        What is the maximum identifier length supported by the dialect?
        Overrides:
        getMaxIdentifierLength in class SybaseDialect
        Returns:
        The maximum length.
      • supportsValuesListForInsert

        public boolean supportsValuesListForInsert()
        Description copied from class: Dialect
        Does this dialect/database support VALUES list (e.g. VALUES (1), (2), (3) ) for insert statements.
        Overrides:
        supportsValuesListForInsert in class Dialect
        Returns:
        true if VALUES list are supported for insert statements
      • supportsLockTimeouts

        public boolean supportsLockTimeouts()
        Description copied from class: Dialect
        Informational metadata about whether this dialect is known to support specifying timeouts for requested lock acquisitions.
        Overrides:
        supportsLockTimeouts in class Dialect
        Returns:
        True is this dialect supports specifying lock timeouts.
      • supportsOrderByInSubquery

        public boolean supportsOrderByInSubquery()
        Description copied from class: Dialect
        Does this dialect support the order by clause in subqueries? Ex: select * from Table1 where col1 in (select col1 from Table2 order by col2 limit 1)
        Overrides:
        supportsOrderByInSubquery in class Dialect
        Returns:
        boolean
      • supportsUnionInSubquery

        public boolean supportsUnionInSubquery()
        Description copied from class: Dialect
        Does this dialect support UNION in a subquery.
        Overrides:
        supportsUnionInSubquery in class Dialect
        Returns:
        True if UNION is supported ina subquery; false otherwise.
      • supportsExpectedLobUsagePattern

        public boolean supportsExpectedLobUsagePattern()
        Description copied from class: Dialect
        Expected LOB usage pattern is such that I can perform an insert via prepared statement with a parameter binding for a LOB value without crazy casting to JDBC driver implementation-specific classes...

        Part of the trickiness here is the fact that this is largely driver dependent. For example, Oracle (which is notoriously bad with LOB support in their drivers historically) actually does a pretty good job with LOB support as of the 10.2.x versions of their drivers...

        Overrides:
        supportsExpectedLobUsagePattern in class Dialect
        Returns:
        True if normal LOB usage patterns can be used with this driver; false if driver-specific hookiness needs to be applied.
      • getForUpdateString

        public String getForUpdateString()
        Description copied from class: Dialect
        Get the string to append to SELECT statements to acquire locks for this dialect.
        Overrides:
        getForUpdateString in class AbstractTransactSQLDialect
        Returns:
        The appropriate FOR UPDATE clause string.
      • getForUpdateString

        public String getForUpdateString​(String aliases)
        Description copied from class: Dialect
        Get the FOR UPDATE OF column_list fragment appropriate for this dialect given the aliases of the columns to be write locked.
        Overrides:
        getForUpdateString in class Dialect
        Parameters:
        aliases - The columns to be write locked.
        Returns:
        The appropriate FOR UPDATE OF column_list clause string.
      • appendLockHint

        public String appendLockHint​(LockOptions mode,
                                     String tableName)
        Description copied from class: Dialect
        Some dialects support an alternative means to SELECT FOR UPDATE, whereby a "lock hint" is appended to the table name in the from clause.

        contributed by Helge Schulz

        Overrides:
        appendLockHint in class AbstractTransactSQLDialect
        Parameters:
        mode - The lock options to apply
        tableName - The name of the table to which to apply the lock hint.
        Returns:
        The table with any required lock hints.
      • applyLocksToSql

        public String applyLocksToSql​(String sql,
                                      LockOptions aliasedLockOptions,
                                      Map<String,​String[]> keyColumnNames)
        Description copied from class: Dialect
        Modifies the given SQL by applying the appropriate updates for the specified lock modes and key columns.

        The behavior here is that of an ANSI SQL SELECT FOR UPDATE. This method is really intended to allow dialects which do not support SELECT FOR UPDATE to achieve this in their own fashion.

        Overrides:
        applyLocksToSql in class AbstractTransactSQLDialect
        Parameters:
        sql - the SQL string to modify
        aliasedLockOptions - lock options indexed by aliased table names.
        keyColumnNames - a map of key columns indexed by aliased table names.
        Returns:
        the modified SQL string.
      • buildSQLExceptionConversionDelegate

        public SQLExceptionConversionDelegate buildSQLExceptionConversionDelegate()
        Description copied from class: Dialect
        Build an instance of a SQLExceptionConversionDelegate for interpreting dialect-specific error or SQLState codes.

        If this method is overridden to return a non-null value, the default SQLExceptionConverter will use the returned SQLExceptionConversionDelegate in addition to the following standard delegates:

        1. a "static" delegate based on the JDBC 4 defined SQLException hierarchy;
        2. a delegate that interprets SQLState codes for either X/Open or SQL-2003 codes, depending on java.sql.DatabaseMetaData#getSQLStateType

        It is strongly recommended that specific Dialect implementations override this method, since interpretation of a SQL error is much more accurate when based on the vendor-specific ErrorCode rather than the SQLState.

        Specific Dialects may override to return whatever is most appropriate for that vendor.

        Overrides:
        buildSQLExceptionConversionDelegate in class Dialect
        Returns:
        The SQLExceptionConversionDelegate for this dialect