Class SybaseASEDialect

    • Constructor Detail

      • SybaseASEDialect

        public SybaseASEDialect()
    • Method Detail

      • getMaxVarcharLength

        public int getMaxVarcharLength()
        Description copied from class: Dialect
        The biggest size value that can be supplied as argument to a Types.VARCHAR-like type.

        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
        Does this dialect support some kind of distinct from predicate?

        That is, 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
        A callback which allows the Dialect to contribute 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)
        Description copied from class: Dialect
        Determine the length/precision of a column based on information in the JDBC ResultSetMetaData. Note that what JDBC reports as a "precision" might actually be the column length.
        Overrides:
        resolveSqlTypeLength in class Dialect
        Parameters:
        columnTypeName - the name of the column type
        jdbcTypeCode - the JDBC type code of the column type
        precision - the (numeric) precision or (character) length of the column
        scale - the scale of a numeric column
        displaySize - the display size of the column
        Returns:
        the precision or length of the column
      • currentDate

        public String currentDate()
        Description copied from class: Dialect
        Translation of the HQL/JPQL current_date function, which maps to the Java type Date, and of the HQL local_date function which maps to the Java type 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 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 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
      • getFractionalSecondPrecisionInNanos

        public long getFractionalSecondPrecisionInNanos()
        Sybase ASE in principle supports microsecond precision for {code bigdatetime}, but unfortunately its duration arithmetic functions have a nasty habit of overflowing. So to give ourselves a little extra headroom, we will use millisecond as the native unit of precision.
        Overrides:
        getFractionalSecondPrecisionInNanos in class Dialect
        Returns:
        the precision, specified as a quantity of nanoseconds
        See Also:
        TemporalUnit.NATIVE
      • 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
      • 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 on delete actions in foreign key definitions?
        Overrides:
        supportsCascadeDelete in class Dialect
        Returns:
        true if the dialect does support the on delete clause.
      • getMaxAliasLength

        public int getMaxAliasLength()
        Description copied from class: Dialect
        What is the maximum length Hibernate can use for generated aliases?
        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 this dialect?
        Overrides:
        getMaxIdentifierLength in class SybaseDialect
        Returns:
        The maximum length.
      • supportsValuesListForInsert

        public boolean supportsValuesListForInsert()
        Description copied from class: Dialect
        Does this dialect support values lists of form VALUES (1), (2), (3) in insert statements?
        Overrides:
        supportsValuesListForInsert in class Dialect
        Returns:
        true if values list are allowed in insert statements
      • supportsLockTimeouts

        public boolean supportsLockTimeouts()
        Description copied from class: Dialect
        Does this dialect support specifying timeouts when requesting locks.
        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?

        For example:

         select * from Table1 where col1 in (select col1 from Table2 order by col2 limit 1)
         
        Overrides:
        supportsOrderByInSubquery in class Dialect
        Returns:
        true if it does
      • 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 in a subquery; false otherwise.
      • getTableTypeString

        public String getTableTypeString()
        Description copied from class: Dialect
        An arbitrary fragment appended to the end of the create table statement.
        Overrides:
        getTableTypeString in class Dialect
      • supportsSkipLocked

        public boolean supportsSkipLocked()
        Description copied from class: Dialect
        Does this dialect support SKIP_LOCKED timeout.
        Overrides:
        supportsSkipLocked in class Dialect
        Returns:
        true if SKIP_LOCKED is supported
      • 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.
        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.