Class DialectDelegateWrapper

  • All Implemented Interfaces:
    FunctionContributor, TypeContributor, ConversionContext

    @Incubating
    public class DialectDelegateWrapper
    extends Dialect
    A wrapper of Dialect, to allow decorating some selected methods without having to extend the original class. This is used by Hibernate Reactive, possibly useful for others too, best maintained in the Hibernate ORM core repository to ensure alignment with the Dialect contract.
    • Field Detail

      • wrapped

        protected final Dialect wrapped
    • Constructor Detail

      • DialectDelegateWrapper

        public DialectDelegateWrapper​(Dialect wrapped)
    • Method Detail

      • extractRealDialect

        public static Dialect extractRealDialect​(Dialect dialect)
        Extract the wrapped dialect, recursively until a non-wrapped implementation is found; this is useful for all the code needing to know "of which type" the underlying implementation actually is.
        Parameters:
        dialect - the Dialect to unwrap
        Returns:
        a Dialect implementation which is not a DialectDelegateWrapper; could be the same as the argument.
      • getWrappedDialect

        public Dialect getWrappedDialect()
        Exposed so to allow code needing to know the implementation.
        Returns:
        the wrapped Dialect
      • checkVersion

        protected final void checkVersion()
        Overrides:
        checkVersion in class Dialect
      • castType

        public String castType​(int sqlTypeCode)
        Description copied from class: Dialect
        The SQL type to use in cast( ... as ... ) expressions when casting to the target type represented by the given JDBC type code.
        Overrides:
        castType in class Dialect
        Parameters:
        sqlTypeCode - The JDBC type code representing the target type
        Returns:
        The SQL type to use in cast()
      • getVersion

        public DatabaseVersion getVersion()
        Description copied from class: Dialect
        Get the version of the SQL dialect that is the target of this instance.
        Overrides:
        getVersion in class Dialect
      • resolveSqlTypeCode

        public Integer resolveSqlTypeCode​(String typeName,
                                          String baseTypeName,
                                          TypeConfiguration typeConfiguration)
        Description copied from class: Dialect
        Resolves the SqlTypes type code for the given column type name as reported by the database and the base type name (i.e. without precision, length and scale), or null if it can't be resolved.
        Overrides:
        resolveSqlTypeCode in class Dialect
      • getNativeParameterMarkerStrategy

        public ParameterMarkerStrategy getNativeParameterMarkerStrategy()
        Description copied from class: Dialect
        Support for native parameter markers.

        This is generally dependent on both the database and the driver.

        Overrides:
        getNativeParameterMarkerStrategy in class Dialect
        Returns:
        May return null to indicate that the JDBC standard strategy should be used
      • 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 Dialect
        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
      • getEnumTypeDeclaration

        public String getEnumTypeDeclaration​(String name,
                                             String[] values)
        Description copied from class: Dialect
        If this database has a special MySQL-style enum column type, return the type declaration for the given enumeration of values.

        If the database has no such type, return null.

        Overrides:
        getEnumTypeDeclaration in class Dialect
        values - the enumerated values of the type
        Returns:
        the DDL column type declaration
      • getCheckCondition

        public String getCheckCondition​(String columnName,
                                        String[] values)
        Description copied from class: Dialect
        Render a SQL check condition for a column that represents an enumerated value by its string representation or a given list of values (with NULL value allowed).
        Overrides:
        getCheckCondition in class Dialect
        Returns:
        a SQL expression that will occur in a check constraint
      • getCheckCondition

        public String getCheckCondition​(String columnName,
                                        long min,
                                        long max)
        Description copied from class: Dialect
        Render a SQL check condition for a column that represents an enumerated value. by its ordinal representation.
        Overrides:
        getCheckCondition in class Dialect
        Returns:
        a SQL expression that will occur in a check constraint
      • ordinal

        public int ordinal()
        Description copied from interface: FunctionContributor
        Determines order in which the contributions will be applied (lowest ordinal first).

        The range 0-500 is reserved for Hibernate, range 500-1000 for libraries and 1000-Integer.MAX_VALUE for user-defined FunctionContributors.

        Contributions from higher precedence contributors (higher numbers) effectively override contributions from lower precedence. E.g. if a contributor with precedence 1000 contributes a function named "max", that will override Hibernate's standard function of that name.

        Specified by:
        ordinal in interface FunctionContributor
        Overrides:
        ordinal in class Dialect
        Returns:
        the ordinal for this FunctionContributor
      • 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 Dialect
      • 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
      • currentLocalTime

        public String currentLocalTime()
        Description copied from class: Dialect
        Translation of the HQL local_time function, which maps to the Java type LocalTime which is a time with no time zone. It should usually be the same SQL function as for Dialect.currentTime().

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

        Overrides:
        currentLocalTime in class Dialect
      • currentLocalTimestamp

        public String currentLocalTimestamp()
        Description copied from class: Dialect
        Translation of the HQL local_datetime function, which maps to the Java type LocalDateTime which is a datetime with no time zone. It should usually be the same SQL function as for Dialect.currentTimestamp().

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

        Overrides:
        currentLocalTimestamp in class Dialect
      • currentTimestampWithTimeZone

        public String currentTimestampWithTimeZone()
        Description copied from class: Dialect
        Translation of the HQL offset_datetime function, which maps to the Java type OffsetDateTime which is a datetime with a time zone. This in principle correctly maps to the ANSI SQL current_timestamp which has the type TIMESTAMP WITH TIME ZONE.
        Overrides:
        currentTimestampWithTimeZone in class Dialect
      • 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
      • trimPattern

        public String trimPattern​(TrimSpec specification,
                                  char character)
        Description copied from class: Dialect
        Obtain a pattern for the SQL equivalent to a trim() function call. The resulting pattern must contain a ?1 placeholder for the argument of type String.
        Overrides:
        trimPattern in class Dialect
        Parameters:
        specification - leading or trailing
        character - the character to trim
      • trimPattern

        public String trimPattern​(TrimSpec specification,
                                  boolean isWhitespace)
        Description copied from class: Dialect
        Obtain a pattern for the SQL equivalent to a trim() function call. The resulting pattern must contain a ?1 placeholder for the argument of type String and a ?2 placeholder for the trim character if isWhitespace was false.
        Overrides:
        trimPattern in class Dialect
        Parameters:
        specification - leading, trailing or both
        isWhitespace - true if the trim character is a whitespace and can be omitted, false if it must be explicit and a ?2 placeholder should be included in the pattern
      • 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
      • 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
      • 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
      • equivalentTypes

        public boolean equivalentTypes​(int typeCode1,
                                       int typeCode2)
        Description copied from class: Dialect
        Do the given JDBC type codes, as defined in Types represent essentially the same type in this dialect of SQL?

        The default implementation treats NUMERIC and DECIMAL as the same type, and FLOAT, REAL, and DOUBLE as essentially the same type, since the ANSI SQL specification fails to meaningfully distinguish them.

        The default implementation also treats VARCHAR, NVARCHAR, LONGVARCHAR, and LONGNVARCHAR as the same type, and BINARY and LONGVARBINARY as the same type, since Hibernate doesn't really differentiate these types.

        On the other hand, integral types are not treated as equivalent, instead, Dialect.isCompatibleIntegralType(int, int) is responsible for determining if the types are compatible.

        Overrides:
        equivalentTypes in class Dialect
        Parameters:
        typeCode1 - the first column type info
        typeCode2 - the second column type info
        Returns:
        true if the two type codes are equivalent
      • 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
      • getNativeIdentifierGeneratorStrategy

        public String getNativeIdentifierGeneratorStrategy()
        Description copied from class: Dialect
        The name identifying the "native" id generation strategy for this dialect.

        This is the name of the id generation strategy which should be used when "native" is specified in hbm.xml.

        Overrides:
        getNativeIdentifierGeneratorStrategy in class Dialect
        Returns:
        The name identifying the native generator strategy.
      • getQuerySequencesString

        public String getQuerySequencesString()
        Description copied from class: Dialect
        Get the select command used retrieve the names of all sequences.
        Overrides:
        getQuerySequencesString in class Dialect
        Returns:
        The select command; or null if sequences are not supported.
      • getSelectGUIDString

        public String getSelectGUIDString()
        Description copied from class: Dialect
        Get the command used to select a GUID from the database.

        Optional operation.

        Overrides:
        getSelectGUIDString in class Dialect
        Returns:
        The appropriate command.
      • supportsTemporaryTables

        public boolean supportsTemporaryTables()
        Description copied from class: Dialect
        Does this database have some sort of support for temporary tables?
        Overrides:
        supportsTemporaryTables in class Dialect
        Returns:
        true by default, since most do
      • supportsTemporaryTablePrimaryKey

        public boolean supportsTemporaryTablePrimaryKey()
        Description copied from class: Dialect
        Does this database support primary keys for temporary tables?
        Overrides:
        supportsTemporaryTablePrimaryKey in class Dialect
        Returns:
        true by default, since most do
      • 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.
      • isLockTimeoutParameterized

        @Deprecated(since="6",
                    forRemoval=true)
        public boolean isLockTimeoutParameterized()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from class: Dialect
        If this dialect supports specifying lock timeouts, are those timeouts rendered into the SQL string as parameters? The implication is that Hibernate will need to bind the timeout value as a parameter in the PreparedStatement. If true, the parameter position is always handled as the last parameter; if the dialect specifies the lock timeout elsewhere in the SQL statement then the timeout value should be directly rendered into the statement and this method should return false.
        Overrides:
        isLockTimeoutParameterized in class Dialect
        Returns:
        True if the lock timeout is rendered into the SQL string as a parameter; false otherwise.
      • getLockingStrategy

        public LockingStrategy getLockingStrategy​(Lockable lockable,
                                                  LockMode lockMode)
        Description copied from class: Dialect
        A LockingStrategy which is able to acquire a database-level lock with the specified level.
        Overrides:
        getLockingStrategy in class Dialect
        Parameters:
        lockable - The persister for the entity to be locked.
        lockMode - The type of lock to be acquired.
        Returns:
        The appropriate locking strategy.
      • getForUpdateString

        public String getForUpdateString​(LockOptions lockOptions)
        Description copied from class: Dialect
        Given a set of LockOptions (lock level, timeout), determine the appropriate for update fragment to use to obtain the lock.
        Overrides:
        getForUpdateString in class Dialect
        Parameters:
        lockOptions - contains the lock mode to apply.
        Returns:
        The appropriate for update fragment.
      • getForUpdateString

        public String getForUpdateString​(LockMode lockMode)
        Description copied from class: Dialect
        Given a LockMode, determine the appropriate for update fragment to use to obtain the lock.
        Overrides:
        getForUpdateString in class Dialect
        Parameters:
        lockMode - The lock mode to apply.
        Returns:
        The appropriate for update fragment.
      • getForUpdateString

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

        public String getWriteLockString​(int timeout)
        Description copied from class: Dialect
        Get the string to append to SELECT statements to acquire pessimistic WRITE locks for this dialect.

        Location of the returned string is treated the same as Dialect.getForUpdateString().

        Overrides:
        getWriteLockString in class Dialect
        Parameters:
        timeout - in milliseconds, -1 for indefinite wait and 0 for no wait.
        Returns:
        The appropriate LOCK clause string.
      • getWriteLockString

        public String getWriteLockString​(String aliases,
                                         int timeout)
        Description copied from class: Dialect
        Get the string to append to SELECT statements to acquire WRITE locks for this dialect, given the aliases of the columns to be write locked.

        Location of the returned string is treated the same as Dialect.getForUpdateString().

        Overrides:
        getWriteLockString in class Dialect
        Parameters:
        aliases - The columns to be read locked.
        timeout - in milliseconds, -1 for indefinite wait and 0 for no wait.
        Returns:
        The appropriate LOCK clause string.
      • getReadLockString

        public String getReadLockString​(int timeout)
        Description copied from class: Dialect
        Get the string to append to SELECT statements to acquire READ locks for this dialect.

        Location of the returned string is treated the same as Dialect.getForUpdateString().

        Overrides:
        getReadLockString in class Dialect
        Parameters:
        timeout - in milliseconds, -1 for indefinite wait and 0 for no wait.
        Returns:
        The appropriate LOCK clause string.
      • getReadLockString

        public String getReadLockString​(String aliases,
                                        int timeout)
        Description copied from class: Dialect
        Get the string to append to SELECT statements to acquire READ locks for this dialect, given the aliases of the columns to be read locked.

        Location of the returned string is treated the same as Dialect.getForUpdateString().

        Overrides:
        getReadLockString in class Dialect
        Parameters:
        aliases - The columns to be read locked.
        timeout - in milliseconds, -1 for indefinite wait and 0 for no wait.
        Returns:
        The appropriate LOCK clause string.
      • supportsOuterJoinForUpdate

        public boolean supportsOuterJoinForUpdate()
        Description copied from class: Dialect
        Does this dialect support FOR UPDATE in conjunction with outer-joined rows?
        Overrides:
        supportsOuterJoinForUpdate in class Dialect
        Returns:
        True if outer-joined rows can be locked via FOR UPDATE.
      • 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.
      • getForUpdateString

        public String getForUpdateString​(String aliases,
                                         LockOptions lockOptions)
        Description copied from class: Dialect
        Get the FOR UPDATE OF or FOR SHARE OF fragment appropriate for this dialect, given the aliases of the columns to be locked.
        Overrides:
        getForUpdateString in class Dialect
        Parameters:
        aliases - The columns to be locked.
        lockOptions - the lock options to apply
        Returns:
        The appropriate FOR UPDATE OF column_list clause string.
      • getForUpdateNowaitString

        public String getForUpdateNowaitString()
        Description copied from class: Dialect
        Retrieves the FOR UPDATE NOWAIT syntax specific to this dialect.
        Overrides:
        getForUpdateNowaitString in class Dialect
        Returns:
        The appropriate FOR UPDATE NOWAIT clause string.
      • getForUpdateSkipLockedString

        public String getForUpdateSkipLockedString()
        Description copied from class: Dialect
        Retrieves the FOR UPDATE SKIP LOCKED syntax specific to this dialect.
        Overrides:
        getForUpdateSkipLockedString in class Dialect
        Returns:
        The appropriate FOR UPDATE SKIP LOCKED clause string.
      • getForUpdateNowaitString

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

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

        public String appendLockHint​(LockOptions lockOptions,
                                     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 Dialect
        Parameters:
        lockOptions - 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, applying the appropriate updates for the specified lock modes and key columns.

        This allows emulation of SELECT FOR UPDATE for dialects which do not support the standard syntax.

        Overrides:
        applyLocksToSql in class Dialect
        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.
      • getCreateTableString

        public String getCreateTableString()
        Description copied from class: Dialect
        The command used to create a table, usually create table.
        Overrides:
        getCreateTableString in class Dialect
        Returns:
        The command used to create a table.
      • 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
      • supportsIfExistsBeforeTableName

        public boolean supportsIfExistsBeforeTableName()
        Description copied from class: Dialect
        For dropping a table, can the phrase if exists be applied before the table name?
        Overrides:
        supportsIfExistsBeforeTableName in class Dialect
        Returns:
        true if if exists can be applied before the table name
      • supportsIfExistsAfterTableName

        public boolean supportsIfExistsAfterTableName()
        Description copied from class: Dialect
        For dropping a table, can the phrase if exists be applied after the table name?
        Overrides:
        supportsIfExistsAfterTableName in class Dialect
        Returns:
        true if if exists can be applied after the table name
      • getCreateIndexString

        public String getCreateIndexString​(boolean unique)
        Description copied from class: Dialect
        The command used to create an index, usually create index or create unique index.
        Overrides:
        getCreateIndexString in class Dialect
        Parameters:
        unique - true if the index is a unique index
        Returns:
        The command used to create an index.
      • getCreateIndexTail

        public String getCreateIndexTail​(boolean unique,
                                         List<Column> columns)
        Description copied from class: Dialect
        A string to be appended to the end of the create index command, usually to specify that null values are to be considered distinct.
        Overrides:
        getCreateIndexTail in class Dialect
      • qualifyIndexName

        public boolean qualifyIndexName()
        Description copied from class: Dialect
        Do we need to qualify index names with the schema name?
        Overrides:
        qualifyIndexName in class Dialect
        Returns:
        true if we do
      • getCreateMultisetTableString

        public String getCreateMultisetTableString()
        Description copied from class: Dialect
        Slight variation on Dialect.getCreateTableString(). Here, we have the command used to create a table when there is no primary key and duplicate rows are expected.
        Overrides:
        getCreateMultisetTableString in class Dialect
        Returns:
        The command used to create a multiset table.
      • hasAlterTable

        public boolean hasAlterTable()
        Description copied from class: Dialect
        Does this dialect support the ALTER TABLE syntax?
        Overrides:
        hasAlterTable in class Dialect
        Returns:
        True if we support altering existing tables; false otherwise.
      • getAlterTableString

        public String getAlterTableString​(String tableName)
        Description copied from class: Dialect
        The command used to alter a table with the given name, usually alter table tab_name or alter table tab_name if exists.

        We prefer the if exists form if supported.

        Overrides:
        getAlterTableString in class Dialect
        Parameters:
        tableName - The name of the table to alter
        Returns:
        The command used to alter a table.
      • supportsIfExistsAfterAlterTable

        public boolean supportsIfExistsAfterAlterTable()
        Description copied from class: Dialect
        For an alter table, can the phrase if exists be applied?
        Overrides:
        supportsIfExistsAfterAlterTable in class Dialect
        Returns:
        true if if exists can be applied after alter table
      • getAddColumnString

        public String getAddColumnString()
        Description copied from class: Dialect
        The subcommand of the alter table command used to add a column to a table, usually add column or add.
        Overrides:
        getAddColumnString in class Dialect
        Returns:
        The add column fragment.
      • getAddColumnSuffixString

        public String getAddColumnSuffixString()
        Description copied from class: Dialect
        The syntax for the suffix used to add a column to a table.
        Overrides:
        getAddColumnSuffixString in class Dialect
        Returns:
        The suffix of the add column fragment.
      • dropConstraints

        public boolean dropConstraints()
        Description copied from class: Dialect
        Do we need to drop constraints before dropping tables in this dialect?
        Overrides:
        dropConstraints in class Dialect
        Returns:
        True if constraints must be dropped prior to dropping the table; false otherwise.
      • getDropForeignKeyString

        public String getDropForeignKeyString()
        Description copied from class: Dialect
        The subcommand of the alter table command used to drop a foreign key constraint, usually drop constraint.
        Overrides:
        getDropForeignKeyString in class Dialect
      • getDropUniqueKeyString

        public String getDropUniqueKeyString()
        Description copied from class: Dialect
        The subcommand of the alter table command used to drop a unique key constraint.
        Overrides:
        getDropUniqueKeyString in class Dialect
      • supportsIfExistsBeforeConstraintName

        public boolean supportsIfExistsBeforeConstraintName()
        Description copied from class: Dialect
        For dropping a constraint with an alter table statement, can the phrase if exists be applied before the constraint name?
        Overrides:
        supportsIfExistsBeforeConstraintName in class Dialect
        Returns:
        true if if exists can be applied before the constraint name
      • supportsIfExistsAfterConstraintName

        public boolean supportsIfExistsAfterConstraintName()
        Description copied from class: Dialect
        For dropping a constraint with an alter table, can the phrase if exists be applied after the constraint name?
        Overrides:
        supportsIfExistsAfterConstraintName in class Dialect
        Returns:
        true if if exists can be applied after the constraint name
      • 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
      • 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
      • getAddForeignKeyConstraintString

        public String getAddForeignKeyConstraintString​(String constraintName,
                                                       String[] foreignKey,
                                                       String referencedTable,
                                                       String[] primaryKey,
                                                       boolean referencesPrimaryKey)
        Description copied from class: Dialect
        The syntax used to add a foreign key constraint to a table, with the referenced key columns explicitly specified.
        Overrides:
        getAddForeignKeyConstraintString in class Dialect
        Parameters:
        constraintName - The foreign key constraint name
        foreignKey - The names of the columns comprising the foreign key
        referencedTable - The table referenced by the foreign key
        primaryKey - The explicit columns in the referencedTable referenced by this foreign key.
        referencesPrimaryKey - if false, constraint should be explicit about which column names the constraint refers to
        Returns:
        the "add FK" fragment
      • getAddForeignKeyConstraintString

        public String getAddForeignKeyConstraintString​(String constraintName,
                                                       String foreignKeyDefinition)
        Description copied from class: Dialect
        The syntax used to add a foreign key constraint to a table, given the definition of the foreign key as a string.
        Overrides:
        getAddForeignKeyConstraintString in class Dialect
        Parameters:
        constraintName - The foreign key constraint name
        foreignKeyDefinition - The whole definition of the foreign key as a fragment
      • getAddPrimaryKeyConstraintString

        public String getAddPrimaryKeyConstraintString​(String constraintName)
        Description copied from class: Dialect
        The syntax used to add a primary key constraint to a table.
        Overrides:
        getAddPrimaryKeyConstraintString in class Dialect
        Parameters:
        constraintName - The name of the PK constraint.
        Returns:
        The "add PK" fragment
      • getCreateUserDefinedTypeKindString

        public String getCreateUserDefinedTypeKindString()
        Description copied from class: Dialect
        The kind of user-defined type to create, or the empty string if this does not need to be specified. Included after create type type_name as, but before the list of members.
        Overrides:
        getCreateUserDefinedTypeKindString in class Dialect
      • supportsIfExistsBeforeTypeName

        public boolean supportsIfExistsBeforeTypeName()
        Description copied from class: Dialect
        For dropping a type, can the phrase if exists be applied before the type name?
        Overrides:
        supportsIfExistsBeforeTypeName in class Dialect
        Returns:
        true if if exists can be applied before the type name
      • supportsIfExistsAfterTypeName

        public boolean supportsIfExistsAfterTypeName()
        Description copied from class: Dialect
        For dropping a type, can the phrase if exists be applied after the type name?
        Overrides:
        supportsIfExistsAfterTypeName in class Dialect
        Returns:
        true if if exists can be applied after the type name
      • registerResultSetOutParameter

        public int registerResultSetOutParameter​(CallableStatement statement,
                                                 int position)
                                          throws SQLException
        Description copied from class: Dialect
        Registers a parameter capable of returning a ResultSet by position, either an OUT parameter, or a REF_CURSOR parameter as defined in Java 8.
        Overrides:
        registerResultSetOutParameter in class Dialect
        Parameters:
        statement - The callable statement.
        position - The bind position at which to register the output param.
        Returns:
        The number of (contiguous) bind positions used.
        Throws:
        SQLException - Indicates problems registering the param.
      • registerResultSetOutParameter

        public int registerResultSetOutParameter​(CallableStatement statement,
                                                 String name)
                                          throws SQLException
        Description copied from class: Dialect
        Registers a parameter capable of returning a ResultSet by name, either an OUT parameter, or a REF_CURSOR parameter as defined in Java 8.
        Overrides:
        registerResultSetOutParameter in class Dialect
        Parameters:
        statement - The callable statement.
        name - The parameter name (for drivers which support named parameters).
        Returns:
        The number of (contiguous) bind positions used.
        Throws:
        SQLException - Indicates problems registering the param.
      • supportsCurrentTimestampSelection

        public boolean supportsCurrentTimestampSelection()
        Description copied from class: Dialect
        Does this dialect support some way to retrieve the current timestamp value from the database?
        Overrides:
        supportsCurrentTimestampSelection in class Dialect
        Returns:
        True if the current timestamp can be retrieved; false otherwise.
      • getCurrentTimestampSelectString

        public String getCurrentTimestampSelectString()
        Description copied from class: Dialect
        The command used to retrieve the current timestamp from the database.
        Overrides:
        getCurrentTimestampSelectString 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
      • getSelectClauseNullString

        public String getSelectClauseNullString​(int sqlType,
                                                TypeConfiguration typeConfiguration)
        Description copied from class: Dialect
        Given a JDBC type code, return the expression for a literal null value of that type, to use in a select clause.

        The select query will be an element of a UNION or UNION ALL.

        Overrides:
        getSelectClauseNullString in class Dialect
        Parameters:
        sqlType - The Types type code.
        typeConfiguration - The type configuration
        Returns:
        The appropriate select clause value fragment.
      • supportsUnionAll

        public boolean supportsUnionAll()
        Description copied from class: Dialect
        Does this dialect support UNION ALL?
        Overrides:
        supportsUnionAll in class Dialect
        Returns:
        True if UNION ALL is supported; false otherwise.
      • 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.
      • getNoColumnsInsertString

        @Deprecated(since="6")
        public String getNoColumnsInsertString()
        Deprecated.
        Description copied from class: Dialect
        The fragment used to insert a row without specifying any column values, usually just (), but sometimes default values.
        Overrides:
        getNoColumnsInsertString in class Dialect
        Returns:
        The appropriate empty values clause.
      • supportsNoColumnsInsert

        public boolean supportsNoColumnsInsert()
        Description copied from class: Dialect
        Is the INSERT statement is allowed to contain no columns?
        Overrides:
        supportsNoColumnsInsert in class Dialect
        Returns:
        if this dialect supports no-column INSERT.
      • getLowercaseFunction

        public String getLowercaseFunction()
        Description copied from class: Dialect
        The name of the SQL function that transforms a string to lowercase, almost always lower.
        Overrides:
        getLowercaseFunction in class Dialect
        Returns:
        The dialect-specific lowercase function.
      • getCaseInsensitiveLike

        public String getCaseInsensitiveLike()
        Description copied from class: Dialect
        The name of the SQL operator that performs case-insensitive LIKE comparisons.
        Overrides:
        getCaseInsensitiveLike in class Dialect
        Returns:
        The dialect-specific case-insensitive like operator.
      • supportsCaseInsensitiveLike

        public boolean supportsCaseInsensitiveLike()
        Description copied from class: Dialect
        Does this dialect support case-insensitive LIKE comparisons?
        Overrides:
        supportsCaseInsensitiveLike in class Dialect
        Returns:
        true if the database supports case-insensitive like comparisons, false otherwise. The default is false.
      • supportsTruncateWithCast

        public boolean supportsTruncateWithCast()
        Description copied from class: Dialect
        Does this dialect support truncation of values to a specified length via a cast?
        Overrides:
        supportsTruncateWithCast in class Dialect
        Returns:
        true if the database supports truncation via a cast, false otherwise. The default is true.
      • transformSelectString

        public String transformSelectString​(String select)
        Description copied from class: Dialect
        Meant as a means for end users to affect the select strings being sent to the database and perhaps manipulate them in some fashion.
        Overrides:
        transformSelectString in class Dialect
        Parameters:
        select - The select command
        Returns:
        The mutated select command, or the same as was passed in.
      • 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 Dialect
        Returns:
        The maximum length.
      • toBooleanValueString

        public String toBooleanValueString​(boolean bool)
        Description copied from class: Dialect
        The SQL literal expression representing the given boolean value.
        Overrides:
        toBooleanValueString in class Dialect
        Parameters:
        bool - The boolean value
        Returns:
        The appropriate SQL literal.
      • appendBooleanValueString

        public void appendBooleanValueString​(SqlAppender appender,
                                             boolean bool)
        Description copied from class: Dialect
        Append the SQL literal expression representing the given boolean value to the given SqlAppender.
        Overrides:
        appendBooleanValueString in class Dialect
        Parameters:
        appender - The SqlAppender to append the literal expression to
        bool - The boolean value
      • registerKeyword

        public void registerKeyword​(String word)
        Description copied from class: Dialect
        Register a keyword.
        Overrides:
        registerKeyword in class Dialect
        Parameters:
        word - a reserved word in this SQL dialect
      • openQuote

        public char openQuote()
        Description copied from class: Dialect
        The character specific to this dialect used to begin a quoted identifier.
        Overrides:
        openQuote in class Dialect
        Returns:
        The dialect-specific open quote character.
      • closeQuote

        public char closeQuote()
        Description copied from class: Dialect
        The character specific to this dialect used to close a quoted identifier.
        Overrides:
        closeQuote in class Dialect
        Returns:
        The dialect-specific close quote character.
      • quote

        public String quote​(String name)
        Description copied from class: Dialect
        Apply dialect-specific quoting if the given name is quoted using backticks.

        By default, the incoming name is checked to see if its first character is a backtick (`). If it is, the dialect specific quoting is applied.

        Overrides:
        quote in class Dialect
        Parameters:
        name - The value to be quoted.
        Returns:
        The quoted (or unmodified, if not starting with backtick) value.
        See Also:
        Dialect.openQuote(), Dialect.closeQuote()
      • getTemporaryTableCreateOptions

        public String getTemporaryTableCreateOptions()
        Description copied from class: Dialect
        An arbitrary SQL fragment appended to the end of the statement to create a temporary table, specifying dialect-specific options, or null if there are no options to specify.
        Overrides:
        getTemporaryTableCreateOptions in class Dialect
      • getCreateTemporaryTableColumnAnnotation

        public String getCreateTemporaryTableColumnAnnotation​(int sqlTypeCode)
        Description copied from class: Dialect
        Annotation to be appended to the end of each COLUMN clause for temporary tables.
        Overrides:
        getCreateTemporaryTableColumnAnnotation in class Dialect
        Parameters:
        sqlTypeCode - The SQL type code
        Returns:
        The annotation to be appended, for example, COLLATE DATABASE_DEFAULT in SQL Server
      • canCreateCatalog

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

        public String[] getCreateCatalogCommand​(String catalogName)
        Description copied from class: Dialect
        Get the SQL command used to create the named catalog.
        Overrides:
        getCreateCatalogCommand in class Dialect
        Parameters:
        catalogName - The name of the catalog to be created.
        Returns:
        The creation commands
      • getDropCatalogCommand

        public String[] getDropCatalogCommand​(String catalogName)
        Description copied from class: Dialect
        Get the SQL command used to drop the named catalog.
        Overrides:
        getDropCatalogCommand in class Dialect
        Parameters:
        catalogName - The name of the catalog to be dropped.
        Returns:
        The drop commands
      • 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.
      • getCreateSchemaCommand

        public String[] getCreateSchemaCommand​(String schemaName)
        Description copied from class: Dialect
        Get the SQL command used to create the named schema.
        Overrides:
        getCreateSchemaCommand in class Dialect
        Parameters:
        schemaName - The name of the schema to be created.
        Returns:
        The creation commands
      • getDropSchemaCommand

        public String[] getDropSchemaCommand​(String schemaName)
        Description copied from class: Dialect
        Get the SQL command used to drop the named schema.
        Overrides:
        getDropSchemaCommand in class Dialect
        Parameters:
        schemaName - The name of the schema to be dropped.
        Returns:
        The drop commands
      • hasSelfReferentialForeignKeyBug

        public boolean hasSelfReferentialForeignKeyBug()
        Description copied from class: Dialect
        Does the database/driver have bug in deleting rows that refer to other rows being deleted in the same query?
        Overrides:
        hasSelfReferentialForeignKeyBug in class Dialect
        Returns:
        true if the database/driver has this bug
      • 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
      • getNullColumnString

        public String getNullColumnString​(String columnType)
        Description copied from class: Dialect
        The keyword used to specify a nullable column of the given SQL type.
        Overrides:
        getNullColumnString in class Dialect
      • supportsCommentOn

        public boolean supportsCommentOn()
        Description copied from class: Dialect
        Does this dialect support commenting on tables and columns?
        Overrides:
        supportsCommentOn in class Dialect
        Returns:
        true if commenting is supported
      • getTableComment

        public String getTableComment​(String comment)
        Description copied from class: Dialect
        Get the comment into a form supported for table definition.
        Overrides:
        getTableComment in class Dialect
        Parameters:
        comment - The comment to apply
        Returns:
        The comment fragment
      • getUserDefinedTypeComment

        public String getUserDefinedTypeComment​(String comment)
        Description copied from class: Dialect
        Get the comment into a form supported for UDT definition.
        Overrides:
        getUserDefinedTypeComment in class Dialect
        Parameters:
        comment - The comment to apply
        Returns:
        The comment fragment
      • getColumnComment

        public String getColumnComment​(String comment)
        Description copied from class: Dialect
        Get the comment into a form supported for column definition.
        Overrides:
        getColumnComment in class Dialect
        Parameters:
        comment - The comment to apply
        Returns:
        The comment fragment
      • supportsColumnCheck

        public boolean supportsColumnCheck()
        Description copied from class: Dialect
        Does this dialect support column-level check constraints?
        Overrides:
        supportsColumnCheck in class Dialect
        Returns:
        True if column-level check constraints are supported; false otherwise.
      • supportsTableCheck

        public boolean supportsTableCheck()
        Description copied from class: Dialect
        Does this dialect support table-level check constraints?
        Overrides:
        supportsTableCheck in class Dialect
        Returns:
        True if table-level check constraints are supported; false otherwise.
      • 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.
      • getCascadeConstraintsString

        public String getCascadeConstraintsString()
        Description copied from class: Dialect
        The keyword that specifies that a drop table operation should be cascaded to its constraints, typically " cascade" where the leading space is required, or the empty string if there is no such keyword in this dialect.
        Overrides:
        getCascadeConstraintsString in class Dialect
        Returns:
        The cascade drop keyword, if any, with a leading space
      • supportsParametersInInsertSelect

        @Deprecated(since="6",
                    forRemoval=true)
        public boolean supportsParametersInInsertSelect()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Description copied from class: Dialect
        Does this dialect support parameters within the SELECT clause of INSERT ... SELECT ... statements?
        Overrides:
        supportsParametersInInsertSelect in class Dialect
        Returns:
        True if this is supported; false otherwise.
      • supportsOrdinalSelectItemReference

        public boolean supportsOrdinalSelectItemReference()
        Description copied from class: Dialect
        Does this dialect support references to result variables (i.e, select items) by column positions (1-origin) as defined by the select clause?
        Overrides:
        supportsOrdinalSelectItemReference in class Dialect
        Returns:
        true if result variable references by column positions are supported; false otherwise.
      • supportsNullPrecedence

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

        public boolean requiresCastForConcatenatingNonStrings()
        Description copied from class: Dialect
        Does this dialect/database require casting of non-string arguments in the concat() function?
        Overrides:
        requiresCastForConcatenatingNonStrings in class Dialect
        Returns:
        true if casting using cast() is required
      • requiresFloatCastingOfIntegerDivision

        public boolean requiresFloatCastingOfIntegerDivision()
        Description copied from class: Dialect
        Does this dialect require that integer divisions be wrapped in cast() calls to tell the db parser the expected type.
        Overrides:
        requiresFloatCastingOfIntegerDivision in class Dialect
        Returns:
        True if integer divisions must be cast()ed to float
      • supportsCircularCascadeDeleteConstraints

        public boolean supportsCircularCascadeDeleteConstraints()
        Description copied from class: Dialect
        Does this dialect support definition of cascade delete constraints which can cause circular chains?
        Overrides:
        supportsCircularCascadeDeleteConstraints in class Dialect
        Returns:
        True if circular cascade delete constraints are supported; false otherwise.
      • supportsSubselectAsInPredicateLHS

        public boolean supportsSubselectAsInPredicateLHS()
        Description copied from class: Dialect
        Is a subselect supported as the left-hand side (LHS) of an IN predicates?

        In other words, is syntax like <subquery> IN (1, 2, 3) supported?

        Overrides:
        supportsSubselectAsInPredicateLHS in class Dialect
        Returns:
        True if a subselect can appear as the LHS of an in-predicate; 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.
        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.
      • supportsUnboundedLobLocatorMaterialization

        public boolean supportsUnboundedLobLocatorMaterialization()
        Description copied from class: Dialect
        Is it supported to materialize a LOB locator outside the transaction in which it was created?
        Overrides:
        supportsUnboundedLobLocatorMaterialization in class Dialect
        Returns:
        True if unbounded materialization is supported; false otherwise.
      • supportsSubqueryOnMutatingTable

        public boolean supportsSubqueryOnMutatingTable()
        Description copied from class: Dialect
        Does this dialect support referencing the table being mutated in a subquery? The "table being mutated" is the table referenced in an update or delete query. And so can that table then be referenced in a subquery of the update or delete query?

        For example, would the following two syntaxes be supported:

        • delete from TABLE_A where ID not in (select ID from TABLE_A)
        • update TABLE_A set NON_ID = 'something' where ID in (select ID from TABLE_A)
        Overrides:
        supportsSubqueryOnMutatingTable in class Dialect
        Returns:
        True if this dialect allows references the mutating table from a subquery.
      • supportsExistsInSelect

        public boolean supportsExistsInSelect()
        Description copied from class: Dialect
        Does the dialect support an exists statement in the select clause?
        Overrides:
        supportsExistsInSelect in class Dialect
        Returns:
        True if exists checks are allowed in the select clause; false otherwise.
      • doesReadCommittedCauseWritersToBlockReaders

        public boolean doesReadCommittedCauseWritersToBlockReaders()
        Description copied from class: Dialect
        For the underlying database, is READ_COMMITTED isolation implemented by forcing readers to wait for write locks to be released?
        Overrides:
        doesReadCommittedCauseWritersToBlockReaders in class Dialect
        Returns:
        True if writers block readers to achieve READ_COMMITTED; false otherwise.
      • doesRepeatableReadCauseReadersToBlockWriters

        public boolean doesRepeatableReadCauseReadersToBlockWriters()
        Description copied from class: Dialect
        For the underlying database, is REPEATABLE_READ isolation implemented by forcing writers to wait for read locks to be released?
        Overrides:
        doesRepeatableReadCauseReadersToBlockWriters in class Dialect
        Returns:
        True if readers block writers to achieve REPEATABLE_READ; false otherwise.
      • supportsBindAsCallableArgument

        public boolean supportsBindAsCallableArgument()
        Description copied from class: Dialect
        Does this dialect support using a JDBC bind parameter as an argument to a function or procedure call?
        Overrides:
        supportsBindAsCallableArgument in class Dialect
        Returns:
        Returns true if the database supports accepting bind params as args, false otherwise. The default is true.
      • supportsTupleCounts

        public boolean supportsTupleCounts()
        Description copied from class: Dialect
        Does this dialect support count(a,b)?
        Overrides:
        supportsTupleCounts in class Dialect
        Returns:
        True if the database supports counting tuples; false otherwise.
      • supportsTupleDistinctCounts

        public boolean supportsTupleDistinctCounts()
        Description copied from class: Dialect
        Does this dialect support count(distinct a,b)?
        Overrides:
        supportsTupleDistinctCounts in class Dialect
        Returns:
        True if the database supports counting distinct tuples; false otherwise.
      • 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.
      • forceLobAsLastValue

        public boolean forceLobAsLastValue()
        Description copied from class: Dialect
        Must LOB values occur last in inserts and updates?
        Overrides:
        forceLobAsLastValue in class Dialect
        Returns:
        boolean True if Lob values should be last, false if it does not matter.
      • isEmptyStringTreatedAsNull

        public boolean isEmptyStringTreatedAsNull()
        Description copied from class: Dialect
        Return whether the dialect considers an empty string value to be null.
        Overrides:
        isEmptyStringTreatedAsNull in class Dialect
        Returns:
        boolean True if an empty string is treated as null, false otherwise.
      • useFollowOnLocking

        public boolean useFollowOnLocking​(String sql,
                                          QueryOptions queryOptions)
        Description copied from class: Dialect
        Some dialects have trouble applying pessimistic locking depending upon what other query options are specified (paging, ordering, etc). This method allows these dialects to request that locking be applied by subsequent selects.
        Overrides:
        useFollowOnLocking in class Dialect
        Returns:
        true indicates that the dialect requests that locking be applied by subsequent select; false (the default) indicates that locking should be applied to the main SQL statement.
      • getQueryHintString

        public String getQueryHintString​(String query,
                                         List<String> hintList)
        Description copied from class: Dialect
        Apply a hint to the given SQL query.

        The entire query is provided, allowing full control over the placement and syntax of the hint.

        By default, ignore the hint and simply return the query.

        Overrides:
        getQueryHintString in class Dialect
        Parameters:
        query - The query to which to apply the hint.
        hintList - The hints to apply
        Returns:
        The modified SQL
      • getQueryHintString

        public String getQueryHintString​(String query,
                                         String hints)
        Description copied from class: Dialect
        Apply a hint to the given SQL query.

        The entire query is provided, allowing full control over the placement and syntax of the hint.

        By default, ignore the hint and simply return the query.

        Overrides:
        getQueryHintString in class Dialect
        Parameters:
        query - The query to which to apply the hint.
        hints - The hints to apply
        Returns:
        The modified SQL
      • supportsOffsetInSubquery

        public boolean supportsOffsetInSubquery()
        Description copied from class: Dialect
        Does this dialect support offset in subqueries?

        For example:

         select * from Table1 where col1 in (select col1 from Table2 order by col2 limit 1 offset 1)
         
        Overrides:
        supportsOffsetInSubquery in class Dialect
        Returns:
        true if it does
      • 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
      • supportsSubqueryInSelect

        public boolean supportsSubqueryInSelect()
        Description copied from class: Dialect
        Does this dialect support subqueries in the select clause?

        For example:

         select col1, (select col2 from Table2 where ...) from Table1
         
        Overrides:
        supportsSubqueryInSelect in class Dialect
        Returns:
        true if it does
      • supportsInsertReturning

        public boolean supportsInsertReturning()
        Description copied from class: Dialect
        Does this dialect fully support returning arbitrary generated column values after execution of an insert statement, using native SQL syntax?

        Support for identity columns is insufficient here, we require something like:

        1. insert ... returning ...
        2. select from final table (insert ... )
        Overrides:
        supportsInsertReturning in class Dialect
        Returns:
        true if InsertReturningDelegate works for any sort of primary key column (not just identity columns), or false if InsertReturningDelegate does not work, or only works for specialized identity/"autoincrement" columns
        See Also:
        InsertReturningDelegate
      • supportsFetchClause

        public boolean supportsFetchClause​(FetchClauseType type)
        Description copied from class: Dialect
        Does this dialect support the given FETCH clause type.
        Overrides:
        supportsFetchClause in class Dialect
        Parameters:
        type - The fetch clause type
        Returns:
        true if the underlying database supports the given fetch clause type, false otherwise. The default is false.
      • supportsWindowFunctions

        public boolean supportsWindowFunctions()
        Description copied from class: Dialect
        Does this dialect support window functions like row_number() over (..)?
        Overrides:
        supportsWindowFunctions in class Dialect
        Returns:
        true if the underlying database supports window functions, false otherwise. The default is false.
      • supportsLateral

        public boolean supportsLateral()
        Description copied from class: Dialect
        Does this dialect support the SQL lateral keyword or a proprietary alternative?
        Overrides:
        supportsLateral in class Dialect
        Returns:
        true if the underlying database supports lateral, false otherwise. The default is false.
      • isJdbcLogWarningsEnabledByDefault

        public boolean isJdbcLogWarningsEnabledByDefault()
        Description copied from class: Dialect
        Is JDBC statement warning logging enabled by default?
        Overrides:
        isJdbcLogWarningsEnabledByDefault in class Dialect
      • supportsPartitionBy

        public boolean supportsPartitionBy()
        Description copied from class: Dialect
        Does is dialect support partition by?
        Overrides:
        supportsPartitionBy in class Dialect
      • supportsStandardArrays

        public boolean supportsStandardArrays()
        Description copied from class: Dialect
        Does this database have native support for ANSI SQL standard arrays which are expressed in terms of the element type name: integer array.
        Overrides:
        supportsStandardArrays in class Dialect
        Returns:
        boolean
      • getArrayTypeName

        public String getArrayTypeName​(String javaElementTypeName,
                                       String elementTypeName,
                                       Integer maxLength)
        Description copied from class: Dialect
        The SQL type name for the array type with elements of the given type name.

        The ANSI-standard syntax is integer array.

        Overrides:
        getArrayTypeName in class Dialect
      • 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
      • supportsNonQueryWithCTE

        public boolean supportsNonQueryWithCTE()
        Description copied from class: Dialect
        Does this dialect support insert, update, and delete statements with Common Table Expressions (CTEs)?
        Overrides:
        supportsNonQueryWithCTE in class Dialect
        Returns:
        true if non-query statements are supported with CTE
      • supportsRecursiveCTE

        public boolean supportsRecursiveCTE()
        Description copied from class: Dialect
        Does this dialect/database support recursive CTEs?
        Overrides:
        supportsRecursiveCTE in class Dialect
        Returns:
        true if recursive CTEs are supported
      • supportsValuesList

        public boolean supportsValuesList()
        Description copied from class: Dialect
        Does this dialect support values lists of form VALUES (1), (2), (3)?
        Overrides:
        supportsValuesList in class Dialect
        Returns:
        true if values list are supported
      • 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
      • 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
      • supportsNoWait

        public boolean supportsNoWait()
        Description copied from class: Dialect
        Does this dialect support NO_WAIT timeout.
        Overrides:
        supportsNoWait in class Dialect
        Returns:
        true if NO_WAIT is supported
      • supportsWait

        public boolean supportsWait()
        Description copied from class: Dialect
        Does this dialect support WAIT timeout.
        Overrides:
        supportsWait in class Dialect
        Returns:
        true if WAIT is supported
      • escapeComment

        public static String escapeComment​(String comment)
      • 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
      • getMaxNVarcharLength

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

        For longer column lengths, use some sort of ntext-like type for the column.

        Overrides:
        getMaxNVarcharLength in class Dialect
      • getMaxVarbinaryLength

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

        For longer column lengths, use some sort of image-like type for the column.

        Overrides:
        getMaxVarbinaryLength in class Dialect
      • getMaxVarcharCapacity

        public int getMaxVarcharCapacity()
        Description copied from class: Dialect
        The longest possible length of a Types.VARCHAR-like column.

        For longer column lengths, use some sort of clob-like type for the column.

        Overrides:
        getMaxVarcharCapacity in class Dialect
      • getMaxNVarcharCapacity

        public int getMaxNVarcharCapacity()
        Description copied from class: Dialect
        The longest possible length of a Types.NVARCHAR-like column.

        For longer column lengths, use some sort of nclob-like type for the column.

        Overrides:
        getMaxNVarcharCapacity in class Dialect
      • getMaxVarbinaryCapacity

        public int getMaxVarbinaryCapacity()
        Description copied from class: Dialect
        The longest possible length of a Types.VARBINARY-like column.

        For longer column lengths, use some sort of blob-like type for the column.

        Overrides:
        getMaxVarbinaryCapacity 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
      • 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
      • supportsBitType

        public boolean supportsBitType()
        Description copied from class: Dialect
        Does this dialect have a true SQL BIT type with just two values (0 and 1) or, even better, a proper SQL BOOLEAN type, or does Types.BIT get mapped to a numeric type with more than two values?
        Overrides:
        supportsBitType in class Dialect
        Returns:
        true if there is a BIT or BOOLEAN type
      • supportsPredicateAsExpression

        public boolean supportsPredicateAsExpression()
        Description copied from class: Dialect
        Whether a predicate like a > 0 can appear in an expression context, for example, in a select list item.
        Overrides:
        supportsPredicateAsExpression in class Dialect
      • generatedAs

        public String generatedAs​(String generatedAs)
        Description copied from class: Dialect
        The generated as clause, or similar, for generated column declarations in DDL statements.
        Overrides:
        generatedAs in class Dialect
        Parameters:
        generatedAs - a SQL expression used to generate the column value
        Returns:
        The generated as clause containing the given expression
      • hasDataTypeBeforeGeneratedAs

        public boolean hasDataTypeBeforeGeneratedAs()
        Description copied from class: Dialect
        Is an explicit column type required for generated as columns?
        Overrides:
        hasDataTypeBeforeGeneratedAs in class Dialect
        Returns:
        true if an explicit type is required
      • getDisableConstraintsStatement

        public String getDisableConstraintsStatement()
        Description copied from class: Dialect
        A SQL statement that temporarily disables foreign key constraint checking for all tables.
        Overrides:
        getDisableConstraintsStatement in class Dialect
      • getEnableConstraintsStatement

        public String getEnableConstraintsStatement()
        Description copied from class: Dialect
        A SQL statement that re-enables foreign key constraint checking for all tables.
        Overrides:
        getEnableConstraintsStatement in class Dialect
      • getDisableConstraintStatement

        public String getDisableConstraintStatement​(String tableName,
                                                    String name)
        Description copied from class: Dialect
        A SQL statement that temporarily disables checking of the given foreign key constraint.
        Overrides:
        getDisableConstraintStatement in class Dialect
        Parameters:
        tableName - the name of the table
        name - the name of the constraint
      • getEnableConstraintStatement

        public String getEnableConstraintStatement​(String tableName,
                                                   String name)
        Description copied from class: Dialect
        A SQL statement that re-enables checking of the given foreign key constraint.
        Overrides:
        getEnableConstraintStatement in class Dialect
        Parameters:
        tableName - the name of the table
        name - the name of the constraint
      • canBatchTruncate

        public boolean canBatchTruncate()
        Description copied from class: Dialect
        Does the truncate table statement accept multiple tables?
        Overrides:
        canBatchTruncate in class Dialect
        Returns:
        true if it does
      • getTruncateTableStatements

        public String[] getTruncateTableStatements​(String[] tableNames)
        Description copied from class: Dialect
        A SQL statement or statements that truncate the given tables.
        Overrides:
        getTruncateTableStatements in class Dialect
        Parameters:
        tableNames - the names of the tables
      • getTruncateTableStatement

        public String getTruncateTableStatement​(String tableName)
        Description copied from class: Dialect
        A SQL statement that truncates the given table.
        Overrides:
        getTruncateTableStatement in class Dialect
        Parameters:
        tableName - the name of the table
      • 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
      • appendUUIDLiteral

        public void appendUUIDLiteral​(SqlAppender appender,
                                      UUID literal)
        Description copied from class: Dialect
        Append a literal SQL uuid representing the given Java UUID.

        This is usually a cast() expression, but it might be a function call.

        Overrides:
        appendUUIDLiteral in class Dialect
      • supportsTemporalLiteralOffset

        public boolean supportsTemporalLiteralOffset()
        Description copied from class: Dialect
        Does this dialect supports timezone offsets in temporal literals.
        Overrides:
        supportsTemporalLiteralOffset in class Dialect
      • rowId

        public String rowId​(String rowId)
        Description copied from class: Dialect
        The name of a rowid-like pseudo-column which acts as a high-performance row locator, or null if this dialect has no such pseudo-column.

        If the rowid-like value is an explicitly-declared named column instead of an implicit pseudo-column, and if the given name is nonempty, return the given name.

        Overrides:
        rowId in class Dialect
        Parameters:
        rowId - the name specified by RowId.value(), which is ignored if Dialect.getRowIdColumnString(java.lang.String) is not overridden
      • rowIdSqlType

        public int rowIdSqlType()
        Description copied from class: Dialect
        The JDBC type code of the rowid-like pseudo-column which acts as a high-performance row locator.
        Overrides:
        rowIdSqlType in class Dialect
        Returns:
        Types.ROWID by default
      • getRowIdColumnString

        public String getRowIdColumnString​(String rowId)
        Description copied from class: Dialect
        If this dialect requires that the rowid column be declared explicitly, return the DDL column definition.
        Overrides:
        getRowIdColumnString in class Dialect
        Returns:
        the DDL column definition, or null if the rowid is an implicit pseudo-column