Class SybaseDialect

    • Field Detail

      • jtdsDriver

        @Deprecated(forRemoval=true)
        protected final boolean jtdsDriver
        Deprecated, for removal: This API element is subject to removal in a future version.
    • Method Detail

      • resolveSqlTypeDescriptor

        public JdbcType resolveSqlTypeDescriptor​(String columnTypeName,
                                                 int jdbcTypeCode,
                                                 int precision,
                                                 int scale,
                                                 JdbcTypeRegistry jdbcTypeRegistry)
        Description copied from class: Dialect
        Assigns an appropriate JdbcType to a column of a JDBC result set based on the column type name, JDBC type code, precision, and scale.
        Overrides:
        resolveSqlTypeDescriptor in class AbstractTransactSQLDialect
        Parameters:
        columnTypeName - the column type name
        jdbcTypeCode - the type code
        precision - the precision or 0
        scale - the scale or 0
        Returns:
        an appropriate instance of JdbcType
      • 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
      • supportsNullPrecedence

        public boolean supportsNullPrecedence()
        Description copied from class: Dialect
        Does this dialect support nulls first and nulls last?
        Overrides:
        supportsNullPrecedence in class Dialect
      • getInExpressionCountLimit

        public int getInExpressionCountLimit()
        Description copied from class: Dialect
        Return the limit that the underlying database places on the number of elements in an IN predicate. If the database defines no such limits, simply return zero or a number smaller than zero.
        Overrides:
        getInExpressionCountLimit in class Dialect
        Returns:
        The limit, or a non-positive integer to indicate no limit.
      • getParameterCountLimit

        public int getParameterCountLimit()
        Description copied from class: Dialect
        Return the limit that the underlying database places on the number of parameters that can be defined for a PreparedStatement. If the database defines no such limits, simply return zero or a number smaller than zero. By default, Dialect returns the same value as Dialect.getInExpressionCountLimit().
        Overrides:
        getParameterCountLimit in class Dialect
        Returns:
        The limit, or a non-positive integer to indicate no limit.
      • 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 Dialect
        Parameters:
        typeContributions - Callback to contribute the types
        serviceRegistry - The service registry
      • initializeFunctionRegistry

        public void initializeFunctionRegistry​(FunctionContributions functionContributions)
        Description copied from class: Dialect
        Initialize the given registry with any dialect-specific functions.

        Support for certain SQL functions is required, and if the database does not support a required function, then the dialect must define a way to emulate it.

        These required functions include the functions defined by the JPA query language specification:

        • avg(arg) - aggregate function
        • count([distinct ]arg) - aggregate function
        • max(arg) - aggregate function
        • min(arg) - aggregate function
        • sum(arg) - aggregate function
        • coalesce(arg0, arg1, ...)
        • nullif(arg0, arg1)
        • lower(arg)
        • upper(arg)
        • length(arg)
        • concat(arg0, arg1, ...)
        • locate(pattern, string[, start])
        • substring(string, start[, length])
        • trim([[spec ][character ]from] string)
        • abs(arg)
        • mod(arg0, arg1)
        • sqrt(arg)
        • current date
        • current time
        • current timestamp
        Along with an additional set of functions defined by ANSI SQL:
        • any(arg) - aggregate function
        • every(arg) - aggregate function
        • var_samp(arg) - aggregate function
        • var_pop(arg) - aggregate function
        • stddev_samp(arg) - aggregate function
        • stddev_pop(arg) - aggregate function
        • cast(arg as Type)
        • extract(field from arg)
        • ln(arg)
        • exp(arg)
        • power(arg0, arg1)
        • floor(arg)
        • ceiling(arg)
        • position(pattern in string)
        • substring(string from start[ for length])
        • overlay(string placing replacement from start[ for length])
        And the following functions for working with java.time types:
        • local date
        • local time
        • local datetime
        • offset datetime
        • instant
        And a number of additional "standard" functions:
        • left(string, length)
        • right(string, length)
        • replace(string, pattern, replacement)
        • pad(string with length spec[ character])
        • repeat(string, times)
        • pi
        • log10(arg)
        • log(base, arg)
        • sign(arg)
        • sin(arg)
        • cos(arg)
        • tan(arg)
        • asin(arg)
        • acos(arg)
        • atan(arg)
        • atan2(arg0, arg1)
        • round(arg0[, arg1])
        • truncate(arg0[, arg1])
        • sinh(arg)
        • tanh(arg)
        • cosh(arg)
        • least(arg0, arg1, ...)
        • greatest(arg0, arg1, ...)
        • degrees(arg)
        • radians(arg)
        • bitand(arg1, arg1)
        • bitor(arg1, arg1)
        • bitxor(arg1, arg1)
        • format(datetime as pattern)
        • collate(string as collation)
        • str(arg) - synonym of cast(a as String)
        • ifnull(arg0, arg1) - synonym of coalesce(a, b)
        Finally, the following functions are defined as abbreviations for extract(), and desugared by the parser:
        • second(arg) - synonym of extract(second from a)
        • minute(arg) - synonym of extract(minute from a)
        • hour(arg) - synonym of extract(hour from a)
        • day(arg) - synonym of extract(day from a)
        • month(arg) - synonym of extract(month from a)
        • year(arg) - synonym of extract(year from a)
        Note that according to this definition, the second() function returns a floating point value, contrary to the integer type returned by the native function with this name on many databases. Thus, we don't just naively map these HQL functions to the native SQL functions with the same names.
        Overrides:
        initializeFunctionRegistry in class AbstractTransactSQLDialect
      • getNullColumnString

        public String getNullColumnString()
        Description copied from class: Dialect
        The keyword used to specify a nullable column, usually "", but sometimes " null".
        Overrides:
        getNullColumnString in class Dialect
      • canCreateSchema

        public boolean canCreateSchema()
        Description copied from class: Dialect
        Does this dialect support creating and dropping schema?
        Overrides:
        canCreateSchema in class Dialect
        Returns:
        True if the dialect supports schema creation; false otherwise.
      • getMaxIdentifierLength

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

        public String castPattern​(CastType from,
                                  CastType to)
        Description copied from class: Dialect
        Obtain a pattern for the SQL equivalent to a cast() function call. The resulting pattern must contain ?1 and ?2 placeholders for the arguments.
        Overrides:
        castPattern in class Dialect
        Parameters:
        from - a CastType indicating the type of the value argument
        to - a CastType indicating the type the value argument is cast to
      • supportsFractionalTimestampArithmetic

        public boolean supportsFractionalTimestampArithmetic()
        Description copied from class: Dialect
        Whether the database supports adding a fractional interval to a timestamp, for example timestamp + 0.5 second.
        Overrides:
        supportsFractionalTimestampArithmetic in class Dialect
      • timestampaddPattern

        public String timestampaddPattern​(TemporalUnit unit,
                                          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 Dialect
        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,
                                           TemporalType fromTemporalType,
                                           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 Dialect
        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
      • appendDatetimeFormat

        public void appendDatetimeFormat​(SqlAppender appender,
                                         String format)
        Description copied from class: Dialect
        Translate the given datetime format string from the pattern language defined by Java's DateTimeFormatter to whatever pattern language is understood by the native datetime formatting function for this database (often the to_char() function).

        Since it's never possible to translate every pattern letter sequences understood by DateTimeFormatter, only the following subset of pattern letters is accepted by Hibernate:

        • G: era
        • y: year of era
        • Y: year of week-based year
        • M: month of year
        • w: week of week-based year (ISO week number)
        • W: week of month
        • E: day of week (name)
        • e: day of week (number)
        • d: day of month
        • D: day of year
        • a: AM/PM
        • H: hour of day (24 hour time)
        • h: hour of AM/PM (12 hour time)
        • m: minutes
        • s: seconds
        • z,Z,x: timezone offset

        In addition, punctuation characters and single-quoted literal strings are accepted.

        Appends a pattern accepted by the function that formats dates and times in this dialect to a SQL fragment that is being constructed.

        Overrides:
        appendDatetimeFormat in class Dialect
      • supportsStandardCurrentTimestampFunction

        public boolean supportsStandardCurrentTimestampFunction()
        Description copied from class: Dialect
        Does this dialect have an ANSI SQL current_timestamp function?
        Overrides:
        supportsStandardCurrentTimestampFunction in class Dialect
      • getAlterColumnTypeString

        public String getAlterColumnTypeString​(String columnName,
                                               String columnType,
                                               String columnDefinition)
        Description copied from class: Dialect
        The fragment of an alter table command which modifies a column type, or null if column types cannot be modified. Often alter column col_name set data type col_type.
        Overrides:
        getAlterColumnTypeString in class Dialect
        Parameters:
        columnName - the name of the column
        columnType - the new type of the column
        columnDefinition - the full column definition
        Returns:
        a fragment to be appended to alter table
      • supportsAlterColumnType

        public boolean supportsAlterColumnType()
        Description copied from class: Dialect
        Does this dialect support modifying the type of an existing column?
        Overrides:
        supportsAlterColumnType in class Dialect
      • supportsFromClauseInUpdate

        public boolean supportsFromClauseInUpdate()
        Description copied from class: Dialect
        Does this dialect support the from clause for update statements?
        Overrides:
        supportsFromClauseInUpdate in class Dialect
        Returns:
        true if from clause is supported