Class Dialect

    • Field Detail

      • DEFAULT_BATCH_SIZE

        public static final java.lang.String DEFAULT_BATCH_SIZE
        Defines a default batch size constant
        See Also:
        Constant Field Values
      • NO_BATCH

        public static final java.lang.String NO_BATCH
        Defines a "no batching" batch size constant
        See Also:
        Constant Field Values
      • QUOTE

        public static final java.lang.String QUOTE
        Characters used as opening for quoting SQL identifiers
        See Also:
        Constant Field Values
      • CLOSED_QUOTE

        public static final java.lang.String CLOSED_QUOTE
        Characters used as closing for quoting SQL identifiers
        See Also:
        Constant Field Values
      • TWO_SINGLE_QUOTES_REPLACEMENT

        public static final java.lang.String TWO_SINGLE_QUOTES_REPLACEMENT
      • LEGACY_LOB_MERGE_STRATEGY

        protected static final LobMergeStrategy LEGACY_LOB_MERGE_STRATEGY
        The legacy behavior of Hibernate. LOBs are not processed by merge
      • STREAM_XFER_LOB_MERGE_STRATEGY

        protected static final LobMergeStrategy STREAM_XFER_LOB_MERGE_STRATEGY
        Merge strategy based on transferring contents based on streams.
      • NEW_LOCATOR_LOB_MERGE_STRATEGY

        protected static final LobMergeStrategy NEW_LOCATOR_LOB_MERGE_STRATEGY
        Merge strategy based on creating a new LOB locator.
      • STANDARD_DEFAULT_BATCH_LOAD_SIZING_STRATEGY

        protected final BatchLoadSizingStrategy STANDARD_DEFAULT_BATCH_LOAD_SIZING_STRATEGY
    • Constructor Detail

      • Dialect

        protected Dialect()
    • Method Detail

      • equivalentTypes

        public boolean equivalentTypes​(int typeCode1,
                                       int typeCode2)
        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.
        Parameters:
        typeCode1 - the first JDBC type code
        typeCode2 - the second JDBC type code
        Returns:
        true if the two type codes are equivalent
      • getDialect

        @Deprecated
        public static Dialect getDialect()
                                  throws HibernateException
        Deprecated.
        this static method will be removed.
        Get an instance of the dialect specified by the current System properties.
        Returns:
        The specified Dialect
        Throws:
        HibernateException - If no dialect was specified, or if it could not be instantiated.
      • getDialect

        @Deprecated
        public static Dialect getDialect​(java.util.Properties props)
                                  throws HibernateException
        Deprecated.
        this static method will be removed.
        Get an instance of the dialect specified by the given properties or by the current System properties.
        Parameters:
        props - The properties to use for finding the dialect class to use.
        Returns:
        The specified Dialect
        Throws:
        HibernateException - If no dialect was specified, or if it could not be instantiated.
      • getDefaultProperties

        public final java.util.Properties getDefaultProperties()
        Retrieve a set of default Hibernate properties for this database.
        Returns:
        a set of Hibernate properties
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • contributeTypes

        public void contributeTypes​(TypeContributions typeContributions,
                                    ServiceRegistry serviceRegistry)
        Allows the Dialect to contribute additional types
        Parameters:
        typeContributions - Callback to contribute the types
        serviceRegistry - The service registry
      • getTypeName

        public java.lang.String getTypeName​(int code)
                                     throws HibernateException
        Get the name of the database type associated with the given Types typecode.
        Parameters:
        code - The Types typecode
        Returns:
        the database type name
        Throws:
        HibernateException - If no mapping was specified for that type.
      • getTypeName

        public java.lang.String getTypeName​(int code,
                                            long length,
                                            int precision,
                                            int scale)
                                     throws HibernateException
        Get the name of the database type associated with the given Types typecode with the given storage specification parameters.
        Parameters:
        code - The Types typecode
        length - The datatype length
        precision - The datatype precision
        scale - The datatype scale
        Returns:
        the database type name
        Throws:
        HibernateException - If no mapping was specified for that type.
      • getCastTypeName

        public java.lang.String getCastTypeName​(int code)
        Get the name of the database type appropriate for casting operations (via the CAST() SQL function) for the given Types typecode.
        Parameters:
        code - The Types typecode
        Returns:
        The database type name
      • cast

        public java.lang.String cast​(java.lang.String value,
                                     int jdbcTypeCode,
                                     int length,
                                     int precision,
                                     int scale)
        Return an expression casting the value to the specified type
        Parameters:
        value - The value to cast
        jdbcTypeCode - The JDBC type code to cast to
        length - The type length
        precision - The type precision
        scale - The type scale
        Returns:
        The cast expression
      • cast

        public java.lang.String cast​(java.lang.String value,
                                     int jdbcTypeCode,
                                     int length)
        Return an expression casting the value to the specified type. Simply calls cast(String, int, int, int, int) passing Column.DEFAULT_PRECISION and Column.DEFAULT_SCALE as the precision/scale.
        Parameters:
        value - The value to cast
        jdbcTypeCode - The JDBC type code to cast to
        length - The type length
        Returns:
        The cast expression
      • cast

        public java.lang.String cast​(java.lang.String value,
                                     int jdbcTypeCode,
                                     int precision,
                                     int scale)
        Return an expression casting the value to the specified type. Simply calls cast(String, int, int, int, int) passing Column.DEFAULT_LENGTH as the length
        Parameters:
        value - The value to cast
        jdbcTypeCode - The JDBC type code to cast to
        precision - The type precision
        scale - The type scale
        Returns:
        The cast expression
      • registerColumnType

        protected void registerColumnType​(int code,
                                          long capacity,
                                          java.lang.String name)
        Subclasses register a type name for the given type code and maximum column length. $l in the type name with be replaced by the column length (if appropriate).
        Parameters:
        code - The Types typecode
        capacity - The maximum length of database type
        name - The database type name
      • registerColumnType

        protected void registerColumnType​(int code,
                                          java.lang.String name)
        Subclasses register a type name for the given type code. $l in the type name with be replaced by the column length (if appropriate).
        Parameters:
        code - The Types typecode
        name - The database type name
      • getSqlTypeDescriptorOverride

        protected SqlTypeDescriptor getSqlTypeDescriptorOverride​(int sqlCode)
        Returns the SqlTypeDescriptor that should be used to handle the given JDBC type code. Returns null if there is no override.
        Parameters:
        sqlCode - A Types constant indicating the SQL column type
        Returns:
        The SqlTypeDescriptor to use as an override, or null if there is no override.
      • getHibernateTypeName

        public java.lang.String getHibernateTypeName​(int code)
                                              throws HibernateException
        Get the name of the Hibernate Type associated with the given Types type code.
        Parameters:
        code - The Types type code
        Returns:
        The Hibernate Type name.
        Throws:
        HibernateException - If no mapping was specified for that type.
      • isTypeNameRegistered

        public boolean isTypeNameRegistered​(java.lang.String typeName)
        Whether or not the given type name has been registered for this dialect (including both hibernate type names and custom-registered type names).
        Parameters:
        typeName - the type name.
        Returns:
        true if the given string has been registered either as a hibernate type or as a custom-registered one
      • getHibernateTypeName

        public java.lang.String getHibernateTypeName​(int code,
                                                     int length,
                                                     int precision,
                                                     int scale)
                                              throws HibernateException
        Get the name of the Hibernate Type associated with the given Types typecode with the given storage specification parameters.
        Parameters:
        code - The Types typecode
        length - The datatype length
        precision - The datatype precision
        scale - The datatype scale
        Returns:
        The Hibernate Type name.
        Throws:
        HibernateException - If no mapping was specified for that type.
      • registerHibernateType

        protected void registerHibernateType​(int code,
                                             long capacity,
                                             java.lang.String name)
        Registers a Hibernate Type name for the given Types type code and maximum column length.
        Parameters:
        code - The Types typecode
        capacity - The maximum length of database type
        name - The Hibernate Type name
      • registerHibernateType

        protected void registerHibernateType​(int code,
                                             java.lang.String name)
        Registers a Hibernate Type name for the given Types type code.
        Parameters:
        code - The Types typecode
        name - The Hibernate Type name
      • registerFunction

        protected void registerFunction​(java.lang.String name,
                                        SQLFunction function)
      • getFunctions

        public final java.util.Map<java.lang.String,​SQLFunction> getFunctions()
        Retrieves a map of the dialect's registered functions (functionName => SQLFunction).
        Returns:
        The map of registered functions.
      • getNativeIdentifierGeneratorClass

        @Deprecated
        public java.lang.Class getNativeIdentifierGeneratorClass()
        The class (which implements IdentifierGenerator) which acts as this dialects native generation strategy.

        Comes into play whenever the user specifies the native generator.

        Returns:
        The native generator class.
      • getNativeIdentifierGeneratorStrategy

        public java.lang.String getNativeIdentifierGeneratorStrategy()
        Resolves the native generation strategy associated to this dialect.

        Comes into play whenever the user specifies the native generator.

        Returns:
        The native generator strategy.
      • supportsSequences

        public boolean supportsSequences()
        Does this dialect support sequences?
        Returns:
        True if sequences supported; false otherwise.
      • getSequenceNextValString

        public java.lang.String getSequenceNextValString​(java.lang.String sequenceName)
                                                  throws MappingException
        Generate the appropriate select statement to to retrieve the next value of a sequence.

        This should be a "stand alone" select statement.

        Parameters:
        sequenceName - the name of the sequence
        Returns:
        String The "nextval" select string.
        Throws:
        MappingException - If sequences are not supported.
      • getSelectSequenceNextValString

        public java.lang.String getSelectSequenceNextValString​(java.lang.String sequenceName)
                                                        throws MappingException
        Generate the select expression fragment that will retrieve the next value of a sequence as part of another (typically DML) statement.

        This differs from getSequenceNextValString(String) in that this should return an expression usable within another statement.

        Parameters:
        sequenceName - the name of the sequence
        Returns:
        The "nextval" fragment.
        Throws:
        MappingException - If sequences are not supported.
      • getCreateSequenceStrings

        @Deprecated
        public java.lang.String[] getCreateSequenceStrings​(java.lang.String sequenceName)
                                                    throws MappingException
        The multiline script used to create a sequence.
        Parameters:
        sequenceName - The name of the sequence
        Returns:
        The sequence creation commands
        Throws:
        MappingException - If sequences are not supported.
      • getCreateSequenceStrings

        public java.lang.String[] getCreateSequenceStrings​(java.lang.String sequenceName,
                                                           int initialValue,
                                                           int incrementSize)
                                                    throws MappingException
        An optional multi-line form for databases which supportsPooledSequences().
        Parameters:
        sequenceName - The name of the sequence
        initialValue - The initial value to apply to 'create sequence' statement
        incrementSize - The increment value to apply to 'create sequence' statement
        Returns:
        The sequence creation commands
        Throws:
        MappingException - If sequences are not supported.
      • getCreateSequenceString

        protected java.lang.String getCreateSequenceString​(java.lang.String sequenceName)
                                                    throws MappingException
        Typically dialects which support sequences can create a sequence with a single command. This is convenience form of getCreateSequenceStrings(java.lang.String) to help facilitate that.

        Dialects which support sequences and can create a sequence in a single command need *only* override this method. Dialects which support sequences but require multiple commands to create a sequence should instead override getCreateSequenceStrings(java.lang.String).

        Parameters:
        sequenceName - The name of the sequence
        Returns:
        The sequence creation command
        Throws:
        MappingException - If sequences are not supported.
      • getCreateSequenceString

        protected java.lang.String getCreateSequenceString​(java.lang.String sequenceName,
                                                           int initialValue,
                                                           int incrementSize)
                                                    throws MappingException
        Overloaded form of getCreateSequenceString(String), additionally taking the initial value and increment size to be applied to the sequence definition.

        The default definition is to suffix getCreateSequenceString(String) with the string: " start with {initialValue} increment by {incrementSize}" where {initialValue} and {incrementSize} are replacement placeholders. Generally dialects should only need to override this method if different key phrases are used to apply the allocation information.
        Parameters:
        sequenceName - The name of the sequence
        initialValue - The initial value to apply to 'create sequence' statement
        incrementSize - The increment value to apply to 'create sequence' statement
        Returns:
        The sequence creation command
        Throws:
        MappingException - If sequences are not supported.
      • getDropSequenceStrings

        public java.lang.String[] getDropSequenceStrings​(java.lang.String sequenceName)
                                                  throws MappingException
        The multiline script used to drop a sequence.
        Parameters:
        sequenceName - The name of the sequence
        Returns:
        The sequence drop commands
        Throws:
        MappingException - If sequences are not supported.
      • getDropSequenceString

        protected java.lang.String getDropSequenceString​(java.lang.String sequenceName)
                                                  throws MappingException
        Typically dialects which support sequences can drop a sequence with a single command. This is convenience form of getDropSequenceStrings(java.lang.String) to help facilitate that.

        Dialects which support sequences and can drop a sequence in a single command need *only* override this method. Dialects which support sequences but require multiple commands to drop a sequence should instead override getDropSequenceStrings(java.lang.String).

        Parameters:
        sequenceName - The name of the sequence
        Returns:
        The sequence drop commands
        Throws:
        MappingException - If sequences are not supported.
      • getQuerySequencesString

        public java.lang.String getQuerySequencesString()
        Get the select command used retrieve the names of all sequences.
        Returns:
        The select command; or null if sequences are not supported.
        See Also:
        SchemaUpdate
      • getSelectGUIDString

        public java.lang.String getSelectGUIDString()
        Get the command used to select a GUID from the underlying database.

        Optional operation.

        Returns:
        The appropriate command.
      • getLimitHandler

        public LimitHandler getLimitHandler()
        Returns the delegate managing LIMIT clause.
        Returns:
        LIMIT clause delegate.
      • supportsLimit

        @Deprecated
        public boolean supportsLimit()
        Deprecated.
        getLimitHandler() should be overridden instead.
        Does this dialect support some form of limiting query results via a SQL clause?
        Returns:
        True if this dialect supports some form of LIMIT.
      • supportsLimitOffset

        @Deprecated
        public boolean supportsLimitOffset()
        Deprecated.
        getLimitHandler() should be overridden instead.
        Does this dialect's LIMIT support (if any) additionally support specifying an offset?
        Returns:
        True if the dialect supports an offset within the limit support.
      • supportsVariableLimit

        @Deprecated
        public boolean supportsVariableLimit()
        Deprecated.
        getLimitHandler() should be overridden instead.
        Does this dialect support bind variables (i.e., prepared statement parameters) for its limit/offset?
        Returns:
        True if bind variables can be used; false otherwise.
      • bindLimitParametersInReverseOrder

        @Deprecated
        public boolean bindLimitParametersInReverseOrder()
        Deprecated.
        getLimitHandler() should be overridden instead.
        ANSI SQL defines the LIMIT clause to be in the form LIMIT offset, limit. Does this dialect require us to bind the parameters in reverse order?
        Returns:
        true if the correct order is limit, offset
      • bindLimitParametersFirst

        @Deprecated
        public boolean bindLimitParametersFirst()
        Deprecated.
        getLimitHandler() should be overridden instead.
        Does the LIMIT clause come at the start of the SELECT statement, rather than at the end?
        Returns:
        true if limit parameters should come before other parameters
      • useMaxForLimit

        @Deprecated
        public boolean useMaxForLimit()
        Deprecated.
        getLimitHandler() should be overridden instead.
        Does the LIMIT clause take a "maximum" row number instead of a total number of returned rows?

        This is easiest understood via an example. Consider you have a table with 20 rows, but you only want to retrieve rows number 11 through 20. Generally, a limit with offset would say that the offset = 11 and the limit = 10 (we only want 10 rows at a time); this is specifying the total number of returned rows. Some dialects require that we instead specify offset = 11 and limit = 20, where 20 is the "last" row we want relative to offset (i.e. total number of rows = 20 - 11 = 9)

        So essentially, is limit relative from offset? Or is limit absolute?

        Returns:
        True if limit is relative from offset; false otherwise.
      • forceLimitUsage

        @Deprecated
        public boolean forceLimitUsage()
        Deprecated.
        getLimitHandler() should be overridden instead.
        Generally, if there is no limit applied to a Hibernate query we do not apply any limits to the SQL query. This option forces that the limit be written to the SQL query.
        Returns:
        True to force limit into SQL query even if none specified in Hibernate query; false otherwise.
      • getLimitString

        @Deprecated
        public java.lang.String getLimitString​(java.lang.String query,
                                               int offset,
                                               int limit)
        Deprecated.
        getLimitHandler() should be overridden instead.
        Given a limit and an offset, apply the limit clause to the query.
        Parameters:
        query - The query to which to apply the limit.
        offset - The offset of the limit
        limit - The limit of the limit ;)
        Returns:
        The modified query statement with the limit applied.
      • getLimitString

        @Deprecated
        protected java.lang.String getLimitString​(java.lang.String query,
                                                  boolean hasOffset)
        Deprecated.
        getLimitHandler() should be overridden instead.
        Apply a limit clause to the query.

        Typically dialects utilize variable limit clauses when they support limits. Thus, when building the select command we do not actually need to know the limit or the offset since we will just be using placeholders.

        Here we do still pass along whether or not an offset was specified so that dialects not supporting offsets can generate proper exceptions. In general, dialects will override one or the other of this method and getLimitString(String, int, int).

        Parameters:
        query - The query to which to apply the limit.
        hasOffset - Is the query requesting an offset?
        Returns:
        the modified SQL
      • convertToFirstRowValue

        @Deprecated
        public int convertToFirstRowValue​(int zeroBasedFirstResult)
        Deprecated.
        getLimitHandler() should be overridden instead.
        Hibernate APIs explicitly state that setFirstResult() should be a zero-based offset. Here we allow the Dialect a chance to convert that value based on what the underlying db or driver will expect.

        NOTE: what gets passed into getLimitString(String,int,int) is the zero-based offset. Dialects which do not supportsVariableLimit() should take care to perform any needed first-row-conversion calls prior to injecting the limit values into the SQL string.

        Parameters:
        zeroBasedFirstResult - The user-supplied, zero-based first row offset.
        Returns:
        The corresponding db/dialect specific offset.
        See Also:
        Query.setFirstResult(int), Criteria.setFirstResult(int)
      • supportsLockTimeouts

        public boolean supportsLockTimeouts()
        Informational metadata about whether this dialect is known to support specifying timeouts for requested lock acquisitions.
        Returns:
        True is this dialect supports specifying lock timeouts.
      • isLockTimeoutParameterized

        public boolean isLockTimeoutParameterized()
        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 param 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.
        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)
        Get a strategy instance which knows how to acquire a database-level lock of the specified mode for this dialect.
        Parameters:
        lockable - The persister for the entity to be locked.
        lockMode - The type of lock to be acquired.
        Returns:
        The appropriate locking strategy.
        Since:
        3.2
      • getForUpdateString

        public java.lang.String getForUpdateString​(LockOptions lockOptions)
        Given LockOptions (lockMode, timeout), determine the appropriate for update fragment to use.
        Parameters:
        lockOptions - contains the lock mode to apply.
        Returns:
        The appropriate for update fragment.
      • getForUpdateString

        public java.lang.String getForUpdateString​(LockMode lockMode)
        Given a lock mode, determine the appropriate for update fragment to use.
        Parameters:
        lockMode - The lock mode to apply.
        Returns:
        The appropriate for update fragment.
      • getForUpdateString

        public java.lang.String getForUpdateString()
        Get the string to append to SELECT statements to acquire locks for this dialect.
        Returns:
        The appropriate FOR UPDATE clause string.
      • getWriteLockString

        public java.lang.String getWriteLockString​(int timeout)
        Get the string to append to SELECT statements to acquire WRITE locks for this dialect. Location of the returned string is treated the same as getForUpdateString.
        Parameters:
        timeout - in milliseconds, -1 for indefinite wait and 0 for no wait.
        Returns:
        The appropriate LOCK clause string.
      • getWriteLockString

        public java.lang.String getWriteLockString​(java.lang.String aliases,
                                                   int timeout)
        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 of the returned string is treated the same as getForUpdateString.
        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 java.lang.String getReadLockString​(int timeout)
        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 getForUpdateString.
        Parameters:
        timeout - in milliseconds, -1 for indefinite wait and 0 for no wait.
        Returns:
        The appropriate LOCK clause string.
      • getReadLockString

        public java.lang.String getReadLockString​(java.lang.String aliases,
                                                  int timeout)
        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 getForUpdateString.
        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.
      • forUpdateOfColumns

        public boolean forUpdateOfColumns()
        Is FOR UPDATE OF syntax supported?
        Returns:
        True if the database supports FOR UPDATE OF syntax; false otherwise.
      • supportsOuterJoinForUpdate

        public boolean supportsOuterJoinForUpdate()
        Does this dialect support FOR UPDATE in conjunction with outer joined rows?
        Returns:
        True if outer joined rows can be locked via FOR UPDATE.
      • getForUpdateString

        public java.lang.String getForUpdateString​(java.lang.String aliases)
        Get the FOR UPDATE OF column_list fragment appropriate for this dialect given the aliases of the columns to be write locked.
        Parameters:
        aliases - The columns to be write locked.
        Returns:
        The appropriate FOR UPDATE OF column_list clause string.
      • getForUpdateString

        public java.lang.String getForUpdateString​(java.lang.String aliases,
                                                   LockOptions lockOptions)
        Get the FOR UPDATE OF column_list fragment appropriate for this dialect given the aliases of the columns to be write locked.
        Parameters:
        aliases - The columns to be write locked.
        lockOptions - the lock options to apply
        Returns:
        The appropriate FOR UPDATE OF column_list clause string.
      • getForUpdateNowaitString

        public java.lang.String getForUpdateNowaitString()
        Retrieves the FOR UPDATE NOWAIT syntax specific to this dialect.
        Returns:
        The appropriate FOR UPDATE NOWAIT clause string.
      • getForUpdateSkipLockedString

        public java.lang.String getForUpdateSkipLockedString()
        Retrieves the FOR UPDATE SKIP LOCKED syntax specific to this dialect.
        Returns:
        The appropriate FOR UPDATE SKIP LOCKED clause string.
      • getForUpdateNowaitString

        public java.lang.String getForUpdateNowaitString​(java.lang.String aliases)
        Get the FOR UPDATE OF column_list NOWAIT fragment appropriate for this dialect given the aliases of the columns to be write locked.
        Parameters:
        aliases - The columns to be write locked.
        Returns:
        The appropriate FOR UPDATE OF colunm_list NOWAIT clause string.
      • getForUpdateSkipLockedString

        public java.lang.String getForUpdateSkipLockedString​(java.lang.String aliases)
        Get the FOR UPDATE OF column_list SKIP LOCKED fragment appropriate for this dialect given the aliases of the columns to be write locked.
        Parameters:
        aliases - The columns to be write locked.
        Returns:
        The appropriate FOR UPDATE colunm_list SKIP LOCKED clause string.
      • appendLockHint

        @Deprecated
        public java.lang.String appendLockHint​(LockMode mode,
                                               java.lang.String tableName)
        Deprecated.
        use appendLockHint(LockOptions,String) instead
        Some dialects support an alternative means to SELECT FOR UPDATE, whereby a "lock hint" is appended to the table name in the from clause.

        contributed by Helge Schulz

        Parameters:
        mode - The lock mode to apply
        tableName - The name of the table to which to apply the lock hint.
        Returns:
        The table with any required lock hints.
      • appendLockHint

        public java.lang.String appendLockHint​(LockOptions lockOptions,
                                               java.lang.String tableName)
        Some dialects support an alternative means to SELECT FOR UPDATE, whereby a "lock hint" is appended to the table name in the from clause.

        contributed by Helge Schulz

        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 java.lang.String applyLocksToSql​(java.lang.String sql,
                                                LockOptions aliasedLockOptions,
                                                java.util.Map<java.lang.String,​java.lang.String[]> keyColumnNames)
        Modifies the given SQL by applying the appropriate updates for the specified lock modes and key columns.

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

        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 java.lang.String getCreateTableString()
        Command used to create a table.
        Returns:
        The command used to create a table.
      • getAlterTableString

        public java.lang.String getAlterTableString​(java.lang.String tableName)
        Command used to alter a table.
        Parameters:
        tableName - The name of the table to alter
        Returns:
        The command used to alter a table.
        Since:
        5.2.11
      • getCreateMultisetTableString

        public java.lang.String getCreateMultisetTableString()
        Slight variation on getCreateTableString(). Here, we have the command used to create a table when there is no primary key and duplicate rows are expected.

        Most databases do not care about the distinction; originally added for Teradata support which does care.

        Returns:
        The command used to create a multiset table.
      • registerResultSetOutParameter

        public int registerResultSetOutParameter​(java.sql.CallableStatement statement,
                                                 int position)
                                          throws java.sql.SQLException
        Registers a parameter (either OUT, or the new REF_CURSOR param type available in Java 8) capable of returning ResultSet *by position*. Pre-Java 8, registering such ResultSet-returning parameters varied greatly across database and drivers; hence its inclusion as part of the Dialect contract.
        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:
        java.sql.SQLException - Indicates problems registering the param.
      • registerResultSetOutParameter

        public int registerResultSetOutParameter​(java.sql.CallableStatement statement,
                                                 java.lang.String name)
                                          throws java.sql.SQLException
        Registers a parameter (either OUT, or the new REF_CURSOR param type available in Java 8) capable of returning ResultSet *by name*. Pre-Java 8, registering such ResultSet-returning parameters varied greatly across database and drivers; hence its inclusion as part of the Dialect contract.
        Parameters:
        statement - The callable statement.
        name - The parameter name (for drivers which support named parameters).
        Returns:
        The number of (contiguous) bind positions used.
        Throws:
        java.sql.SQLException - Indicates problems registering the param.
      • getResultSet

        public java.sql.ResultSet getResultSet​(java.sql.CallableStatement statement)
                                        throws java.sql.SQLException
        Given a callable statement previously processed by registerResultSetOutParameter(java.sql.CallableStatement, int), extract the ResultSet from the OUT parameter.
        Parameters:
        statement - The callable statement.
        Returns:
        The extracted result set.
        Throws:
        java.sql.SQLException - Indicates problems extracting the result set.
      • getResultSet

        public java.sql.ResultSet getResultSet​(java.sql.CallableStatement statement,
                                               int position)
                                        throws java.sql.SQLException
        Given a callable statement previously processed by registerResultSetOutParameter(java.sql.CallableStatement, int), extract the ResultSet.
        Parameters:
        statement - The callable statement.
        position - The bind position at which to register the output param.
        Returns:
        The extracted result set.
        Throws:
        java.sql.SQLException - Indicates problems extracting the result set.
      • getResultSet

        public java.sql.ResultSet getResultSet​(java.sql.CallableStatement statement,
                                               java.lang.String name)
                                        throws java.sql.SQLException
        Given a callable statement previously processed by registerResultSetOutParameter(java.sql.CallableStatement, int), extract the ResultSet from the OUT parameter.
        Parameters:
        statement - The callable statement.
        name - The parameter name (for drivers which support named parameters).
        Returns:
        The extracted result set.
        Throws:
        java.sql.SQLException - Indicates problems extracting the result set.
      • supportsCurrentTimestampSelection

        public boolean supportsCurrentTimestampSelection()
        Does this dialect support a way to retrieve the database's current timestamp value?
        Returns:
        True if the current timestamp can be retrieved; false otherwise.
      • isCurrentTimestampSelectStringCallable

        public boolean isCurrentTimestampSelectStringCallable()
        Should the value returned by getCurrentTimestampSelectString() be treated as callable. Typically this indicates that JDBC escape syntax is being used...
        Returns:
        True if the getCurrentTimestampSelectString() return is callable; false otherwise.
      • getCurrentTimestampSelectString

        public java.lang.String getCurrentTimestampSelectString()
        Retrieve the command used to retrieve the current timestamp from the database.
        Returns:
        The command.
      • getCurrentTimestampSQLFunctionName

        public java.lang.String getCurrentTimestampSQLFunctionName()
        The name of the database-specific SQL function for retrieving the current timestamp.
        Returns:
        The function name.
      • buildSQLExceptionConverter

        @Deprecated
        public SQLExceptionConverter buildSQLExceptionConverter()
        Deprecated.
        buildSQLExceptionConversionDelegate() should be overridden instead.
        Build an instance of the SQLExceptionConverter preferred by this dialect for converting SQLExceptions into Hibernate's JDBCException hierarchy.

        The preferred method is to not override this method; if possible, buildSQLExceptionConversionDelegate() should be overridden instead. If this method is not overridden, the default SQLExceptionConverter implementation executes 3 SQLException converter delegates:

        1. a "static" delegate based on the JDBC 4 defined SQLException hierarchy;
        2. the vendor-specific delegate returned by buildSQLExceptionConversionDelegate(); (it is strongly recommended that specific Dialect implementations override buildSQLExceptionConversionDelegate())
        3. a delegate that interprets SQLState codes for either X/Open or SQL-2003 codes, depending on java.sql.DatabaseMetaData#getSQLStateType

        If this method is overridden, it is strongly recommended that the returned SQLExceptionConverter interpret SQL errors based on vendor-specific error codes rather than the SQLState since the interpretation is more accurate when using vendor-specific ErrorCodes.

        Returns:
        The Dialect's preferred SQLExceptionConverter, or null to indicate that the default SQLExceptionConverter should be used.
        See Also:
        buildSQLExceptionConversionDelegate()
      • buildSQLExceptionConversionDelegate

        public SQLExceptionConversionDelegate buildSQLExceptionConversionDelegate()
        Build an instance of a SQLExceptionConversionDelegate for interpreting dialect-specific error or SQLState codes.

        When buildSQLExceptionConverter() returns null, the default SQLExceptionConverter is used to interpret SQLState and error codes. If this method is overridden to return a non-null value, the default SQLExceptionConverter will use the returned SQLExceptionConversionDelegate in addition to the following standard delegates:

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

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

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

        Returns:
        The SQLExceptionConversionDelegate for this dialect
      • getSelectClauseNullString

        public java.lang.String getSelectClauseNullString​(int sqlType)
        Given a Types type code, determine an appropriate null value to use in a select clause.

        One thing to consider here is that certain databases might require proper casting for the nulls here since the select here will be part of a UNION/UNION ALL.

        Parameters:
        sqlType - The Types type code.
        Returns:
        The appropriate select clause value fragment.
      • supportsUnionAll

        public boolean supportsUnionAll()
        Does this dialect support UNION ALL, which is generally a faster variant of UNION?
        Returns:
        True if UNION ALL is supported; false otherwise.
      • createOuterJoinFragment

        public JoinFragment createOuterJoinFragment()
        Create a JoinFragment strategy responsible for handling this dialect's variations in how joins are handled.
        Returns:
        This dialect's JoinFragment strategy.
      • createCaseFragment

        public CaseFragment createCaseFragment()
        Create a CaseFragment strategy responsible for handling this dialect's variations in how CASE statements are handled.
        Returns:
        This dialect's CaseFragment strategy.
      • getNoColumnsInsertString

        public java.lang.String getNoColumnsInsertString()
        The fragment used to insert a row without specifying any column values. This is not possible on some databases.
        Returns:
        The appropriate empty values clause.
      • supportsNoColumnsInsert

        public boolean supportsNoColumnsInsert()
        Check if the INSERT statement is allowed to contain no column.
        Returns:
        if the Dialect supports no-column INSERT.
      • getLowercaseFunction

        public java.lang.String getLowercaseFunction()
        The name of the SQL function that transforms a string to lowercase
        Returns:
        The dialect-specific lowercase function.
      • getCaseInsensitiveLike

        public java.lang.String getCaseInsensitiveLike()
        The name of the SQL function that can do case insensitive like comparison.
        Returns:
        The dialect-specific "case insensitive" like function.
      • supportsCaseInsensitiveLike

        public boolean supportsCaseInsensitiveLike()
        Does this dialect support case insensitive LIKE restrictions?
        Returns:
        true if the underlying database supports case insensitive like comparison, false otherwise. The default is false.
      • transformSelectString

        public java.lang.String transformSelectString​(java.lang.String select)
        Meant as a means for end users to affect the select strings being sent to the database and perhaps manipulate them in some fashion.

        The recommend approach is to instead use Interceptor.onPrepareStatement(String).

        Parameters:
        select - The select command
        Returns:
        The mutated select command, or the same as was passed in.
      • getMaxAliasLength

        public int getMaxAliasLength()
        What is the maximum length Hibernate can use for generated aliases?

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

        Returns:
        The maximum length.
      • toBooleanValueString

        public java.lang.String toBooleanValueString​(boolean bool)
        The SQL literal value to which this database maps boolean values.
        Parameters:
        bool - The boolean value
        Returns:
        The appropriate SQL literal.
      • registerKeyword

        protected void registerKeyword​(java.lang.String word)
      • openQuote

        public char openQuote()
        The character specific to this dialect used to begin a quoted identifier.
        Returns:
        The dialect's specific open quote character.
      • closeQuote

        public char closeQuote()
        The character specific to this dialect used to close a quoted identifier.
        Returns:
        The dialect's specific close quote character.
      • quote

        public final java.lang.String quote​(java.lang.String name)
        Apply dialect-specific quoting.

        By default, the incoming value is checked to see if its first character is the back-tick (`). If so, the dialect specific quoting is applied.

        Parameters:
        name - The value to be quoted.
        Returns:
        The quoted (or unmodified, if not starting with back-tick) value.
        See Also:
        openQuote(), closeQuote()
      • canCreateCatalog

        public boolean canCreateCatalog()
        Does this dialect support catalog creation?
        Returns:
        True if the dialect supports catalog creation; false otherwise.
      • getCreateCatalogCommand

        public java.lang.String[] getCreateCatalogCommand​(java.lang.String catalogName)
        Get the SQL command used to create the named catalog
        Parameters:
        catalogName - The name of the catalog to be created.
        Returns:
        The creation commands
      • getDropCatalogCommand

        public java.lang.String[] getDropCatalogCommand​(java.lang.String catalogName)
        Get the SQL command used to drop the named catalog
        Parameters:
        catalogName - The name of the catalog to be dropped.
        Returns:
        The drop commands
      • canCreateSchema

        public boolean canCreateSchema()
        Does this dialect support schema creation?
        Returns:
        True if the dialect supports schema creation; false otherwise.
      • getCreateSchemaCommand

        public java.lang.String[] getCreateSchemaCommand​(java.lang.String schemaName)
        Get the SQL command used to create the named schema
        Parameters:
        schemaName - The name of the schema to be created.
        Returns:
        The creation commands
      • getDropSchemaCommand

        public java.lang.String[] getDropSchemaCommand​(java.lang.String schemaName)
        Get the SQL command used to drop the named schema
        Parameters:
        schemaName - The name of the schema to be dropped.
        Returns:
        The drop commands
      • getCurrentSchemaCommand

        public java.lang.String getCurrentSchemaCommand()
        Get the SQL command used to retrieve the current schema name. Works in conjunction with getSchemaNameResolver(), unless the return from there does not need this information. E.g., a custom impl might make use of the Java 1.7 addition of the Connection.getSchema() method
        Returns:
        The current schema retrieval SQL
      • getSchemaNameResolver

        public SchemaNameResolver getSchemaNameResolver()
        Get the strategy for determining the schema name of a Connection
        Returns:
        The schema name resolver strategy
      • hasAlterTable

        public boolean hasAlterTable()
        Does this dialect support the ALTER TABLE syntax?
        Returns:
        True if we support altering of tables; false otherwise.
      • dropConstraints

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

        public boolean qualifyIndexName()
        Do we need to qualify index names with the schema name?
        Returns:
        boolean
      • getAddColumnString

        public java.lang.String getAddColumnString()
        The syntax used to add a column to a table (optional).
        Returns:
        The "add column" fragment.
      • getAddColumnSuffixString

        public java.lang.String getAddColumnSuffixString()
        The syntax for the suffix used to add a column to a table (optional).
        Returns:
        The suffix "add column" fragment.
      • getDropForeignKeyString

        public java.lang.String getDropForeignKeyString()
      • getTableTypeString

        public java.lang.String getTableTypeString()
      • getAddForeignKeyConstraintString

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

        public java.lang.String getAddForeignKeyConstraintString​(java.lang.String constraintName,
                                                                 java.lang.String foreignKeyDefinition)
      • getAddPrimaryKeyConstraintString

        public java.lang.String getAddPrimaryKeyConstraintString​(java.lang.String constraintName)
        The syntax used to add a primary key constraint to a table.
        Parameters:
        constraintName - The name of the PK constraint.
        Returns:
        The "add PK" fragment
      • hasSelfReferentialForeignKeyBug

        public boolean hasSelfReferentialForeignKeyBug()
        Does the database/driver have bug in deleting rows that refer to other rows being deleted in the same query?
        Returns:
        true if the database/driver has this bug
      • getNullColumnString

        public java.lang.String getNullColumnString()
        The keyword used to specify a nullable column.
        Returns:
        String
      • supportsCommentOn

        public boolean supportsCommentOn()
        Does this dialect/database support commenting on tables, columns, etc?
        Returns:
        true if commenting is supported
      • getTableComment

        public java.lang.String getTableComment​(java.lang.String comment)
        Get the comment into a form supported for table definition.
        Parameters:
        comment - The comment to apply
        Returns:
        The comment fragment
      • getColumnComment

        public java.lang.String getColumnComment​(java.lang.String comment)
        Get the comment into a form supported for column definition.
        Parameters:
        comment - The comment to apply
        Returns:
        The comment fragment
      • supportsIfExistsBeforeTableName

        public boolean supportsIfExistsBeforeTableName()
        For dropping a table, can the phrase "if exists" be applied before the table name?

        NOTE : Only one or the other (or neither) of this and supportsIfExistsAfterTableName() should return true

        Returns:
        true if the "if exists" can be applied before the table name
      • supportsIfExistsAfterTableName

        public boolean supportsIfExistsAfterTableName()
        For dropping a table, can the phrase "if exists" be applied after the table name?

        NOTE : Only one or the other (or neither) of this and supportsIfExistsBeforeTableName() should return true

        Returns:
        true if the "if exists" can be applied after the table name
      • supportsIfExistsBeforeConstraintName

        public boolean supportsIfExistsBeforeConstraintName()
        For dropping a constraint with an "alter table", can the phrase "if exists" be applied before the constraint name?

        NOTE : Only one or the other (or neither) of this and supportsIfExistsAfterConstraintName() should return true

        Returns:
        true if the "if exists" can be applied before the constraint name
      • supportsIfExistsAfterConstraintName

        public boolean supportsIfExistsAfterConstraintName()
        For dropping a constraint with an "alter table", can the phrase "if exists" be applied after the constraint name?

        NOTE : Only one or the other (or neither) of this and supportsIfExistsBeforeConstraintName() should return true

        Returns:
        true if the "if exists" can be applied after the constraint name
      • supportsIfExistsAfterAlterTable

        public boolean supportsIfExistsAfterAlterTable()
        For an "alter table", can the phrase "if exists" be applied?
        Returns:
        true if the "if exists" can be applied after ALTER TABLE
        Since:
        5.2.11
      • getDropTableString

        public java.lang.String getDropTableString​(java.lang.String tableName)
        Generate a DROP TABLE statement
        Parameters:
        tableName - The name of the table to drop
        Returns:
        The DROP TABLE command
      • supportsColumnCheck

        public boolean supportsColumnCheck()
        Does this dialect support column-level check constraints?
        Returns:
        True if column-level CHECK constraints are supported; false otherwise.
      • supportsTableCheck

        public boolean supportsTableCheck()
        Does this dialect support table-level check constraints?
        Returns:
        True if table-level CHECK constraints are supported; false otherwise.
      • supportsCascadeDelete

        public boolean supportsCascadeDelete()
        Does this dialect support cascaded delete on foreign key definitions?
        Returns:
        true indicates that the dialect does support cascaded delete on foreign keys.
      • getCascadeConstraintsString

        public java.lang.String getCascadeConstraintsString()
        Completely optional cascading drop clause
        Returns:
        String
      • getCrossJoinSeparator

        public java.lang.String getCrossJoinSeparator()
        Returns the separator to use for defining cross joins when translating HQL queries.

        Typically this will be either [ cross join ] or [, ]

        Note that the spaces are important!

        Returns:
        The cross join separator
      • supportsEmptyInList

        public boolean supportsEmptyInList()
        Does this dialect support empty IN lists?

        For example, is [where XYZ in ()] a supported construct?

        Returns:
        True if empty in lists are supported; false otherwise.
        Since:
        3.2
      • areStringComparisonsCaseInsensitive

        public boolean areStringComparisonsCaseInsensitive()
        Are string comparisons implicitly case insensitive.

        In other words, does [where 'XYZ' = 'xyz'] resolve to true?

        Returns:
        True if comparisons are case insensitive.
        Since:
        3.2
      • supportsRowValueConstructorSyntax

        public boolean supportsRowValueConstructorSyntax()
        Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax; sometimes called tuple syntax.

        Basically, does it support syntax like "... where (FIRST_NAME, LAST_NAME) = ('Steve', 'Ebersole') ...".

        Returns:
        True if this SQL dialect is known to support "row value constructor" syntax; false otherwise.
        Since:
        3.2
      • supportsRowValueConstructorSyntaxInSet

        public boolean supportsRowValueConstructorSyntaxInSet()
        Is this dialect known to support what ANSI-SQL terms "row value constructor" syntax, sometimes called tuple syntax, in the SET clause;

        Basically, does it support syntax like "... SET (FIRST_NAME, LAST_NAME) = ('Steve', 'Ebersole') ...".

        Returns:
        True if this SQL dialect is known to support "row value constructor" syntax in the SET clause; false otherwise.
      • supportsRowValueConstructorSyntaxInInList

        public boolean supportsRowValueConstructorSyntaxInInList()
        If the dialect supports row values, does it offer such support in IN lists as well?

        For example, "... where (FIRST_NAME, LAST_NAME) IN ( (?, ?), (?, ?) ) ..."

        Returns:
        True if this SQL dialect is known to support "row value constructor" syntax in the IN list; false otherwise.
        Since:
        3.2
      • useInputStreamToInsertBlob

        public boolean useInputStreamToInsertBlob()
        Should LOBs (both BLOB and CLOB) be bound using stream operations (i.e. PreparedStatement.setBinaryStream(int, java.io.InputStream, int)).
        Returns:
        True if BLOBs and CLOBs should be bound using stream operations.
        Since:
        3.2
      • supportsParametersInInsertSelect

        public boolean supportsParametersInInsertSelect()
        Does this dialect support parameters within the SELECT clause of INSERT ... SELECT ... statements?
        Returns:
        True if this is supported; false otherwise.
        Since:
        3.2
      • replaceResultVariableInOrderByClauseWithPosition

        public boolean replaceResultVariableInOrderByClauseWithPosition()
        Does this dialect require that references to result variables (i.e, select expression aliases) in an ORDER BY clause be replaced by column positions (1-origin) as defined by the select clause?
        Returns:
        true if result variable references in the ORDER BY clause should be replaced by column positions; false otherwise.
      • renderOrderByElement

        public java.lang.String renderOrderByElement​(java.lang.String expression,
                                                     java.lang.String collation,
                                                     java.lang.String order,
                                                     NullPrecedence nulls)
        Renders an ordering fragment
        Parameters:
        expression - The SQL order expression. In case of @OrderBy annotation user receives property placeholder (e.g. attribute name enclosed in '{' and '}' signs).
        collation - Collation string in format collate IDENTIFIER, or null if expression has not been explicitly specified.
        order - Order direction. Possible values: asc, desc, or null if expression has not been explicitly specified.
        nulls - Nulls precedence. Default value: NullPrecedence.NONE.
        Returns:
        Renders single element of ORDER BY clause.
      • requiresCastingOfParametersInSelectClause

        public boolean requiresCastingOfParametersInSelectClause()
        Does this dialect require that parameters appearing in the SELECT clause be wrapped in cast() calls to tell the db parser the expected type.
        Returns:
        True if select clause parameter must be cast()ed
        Since:
        3.2
      • supportsResultSetPositionQueryMethodsOnForwardOnlyCursor

        public boolean supportsResultSetPositionQueryMethodsOnForwardOnlyCursor()
        Does this dialect support asking the result set its positioning information on forward only cursors. Specifically, in the case of scrolling fetches, Hibernate needs to use ResultSet.isAfterLast() and ResultSet.isBeforeFirst(). Certain drivers do not allow access to these methods for forward only cursors.

        NOTE : this is highly driver dependent!

        Returns:
        True if methods like ResultSet.isAfterLast() and ResultSet.isBeforeFirst() are supported for forward only cursors; false otherwise.
        Since:
        3.2
      • supportsCircularCascadeDeleteConstraints

        public boolean supportsCircularCascadeDeleteConstraints()
        Does this dialect support definition of cascade delete constraints which can cause circular chains?
        Returns:
        True if circular cascade delete constraints are supported; false otherwise.
        Since:
        3.2
      • supportsSubselectAsInPredicateLHS

        public boolean supportsSubselectAsInPredicateLHS()
        Are subselects supported as the left-hand-side (LHS) of IN-predicates.

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

        Returns:
        True if subselects can appear as the LHS of an in-predicate; false otherwise.
        Since:
        3.2
      • supportsExpectedLobUsagePattern

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

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

        Returns:
        True if normal LOB usage patterns can be used with this driver; false if driver-specific hookiness needs to be applied.
        Since:
        3.2
      • supportsLobValueChangePropogation

        public boolean supportsLobValueChangePropogation()
        Does the dialect support propagating changes to LOB values back to the database? Talking about mutating the internal value of the locator as opposed to supplying a new locator instance...

        For BLOBs, the internal value might be changed by: Blob.setBinaryStream(long), Blob.setBytes(long, byte[]), Blob.setBytes(long, byte[], int, int), or Blob.truncate(long).

        For CLOBs, the internal value might be changed by: Clob.setAsciiStream(long), Clob.setCharacterStream(long), Clob.setString(long, String), Clob.setString(long, String, int, int), or Clob.truncate(long).

        NOTE : I do not know the correct answer currently for databases which (1) are not part of the cruise control process or (2) do not supportsExpectedLobUsagePattern().

        Returns:
        True if the changes are propagated back to the database; false otherwise.
        Since:
        3.2
      • supportsUnboundedLobLocatorMaterialization

        public boolean supportsUnboundedLobLocatorMaterialization()
        Is it supported to materialize a LOB locator outside the transaction in which it was created?

        Again, part of the trickiness here is the fact that this is largely driver dependent.

        NOTE: all database I have tested which supportsExpectedLobUsagePattern() also support the ability to materialize a LOB outside the owning transaction...

        Returns:
        True if unbounded materialization is supported; false otherwise.
        Since:
        3.2
      • supportsSubqueryOnMutatingTable

        public boolean supportsSubqueryOnMutatingTable()
        Does this dialect support referencing the table being mutated in a subquery. The "table being mutated" is the table referenced in an UPDATE or a DELETE query. And so can that table then be referenced in a subquery of said UPDATE/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)
        Returns:
        True if this dialect allows references the mutating table from a subquery.
      • supportsExistsInSelect

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

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

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

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

        public boolean supportsTupleCounts()
        Does this dialect support `count(a,b)`?
        Returns:
        True if the database supports counting tuples; false otherwise.
      • supportsTupleDistinctCounts

        public boolean supportsTupleDistinctCounts()
        Does this dialect support `count(distinct a,b)`?
        Returns:
        True if the database supports counting distinct tuples; false otherwise.
      • requiresParensForTupleDistinctCounts

        public boolean requiresParensForTupleDistinctCounts()
        If supportsTupleDistinctCounts() is true, does the Dialect require the tuple to be wrapped with parens?
        Returns:
        boolean
      • getInExpressionCountLimit

        public int getInExpressionCountLimit()
        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 less-than-zero.
        Returns:
        int The limit, or zero-or-less to indicate no limit.
      • forceLobAsLastValue

        public boolean forceLobAsLastValue()
        HHH-4635 Oracle expects all Lob values to be last in inserts and updates.
        Returns:
        boolean True if Lob values should be last, false if it does not matter.
      • useFollowOnLocking

        @Deprecated
        public boolean useFollowOnLocking()
        Deprecated.
        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.
        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..
      • useFollowOnLocking

        public boolean useFollowOnLocking​(QueryParameters parameters)
        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.
        Parameters:
        parameters - query parameters
        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..
        Since:
        5.2
      • getNotExpression

        public java.lang.String getNotExpression​(java.lang.String expression)
        Negate an expression
        Parameters:
        expression - The expression to negate
        Returns:
        The negated expression
      • getUniqueDelegate

        public UniqueDelegate getUniqueDelegate()
        Get the UniqueDelegate supported by this dialect
        Returns:
        The UniqueDelegate
      • supportsUnique

        @Deprecated
        public boolean supportsUnique()
        Deprecated.
        getUniqueDelegate() should be overridden instead.
        Does this dialect support the UNIQUE column syntax?
        Returns:
        boolean
      • supportsUniqueConstraintInCreateAlterTable

        @Deprecated
        public boolean supportsUniqueConstraintInCreateAlterTable()
        Deprecated.
        getUniqueDelegate() should be overridden instead.
        Does this dialect support adding Unique constraints via create and alter table ?
        Returns:
        boolean
      • getAddUniqueConstraintString

        @Deprecated
        public java.lang.String getAddUniqueConstraintString​(java.lang.String constraintName)
        Deprecated.
        getUniqueDelegate() should be overridden instead.
        The syntax used to add a unique constraint to a table.
        Parameters:
        constraintName - The name of the unique constraint.
        Returns:
        The "add unique" fragment
      • supportsNotNullUnique

        @Deprecated
        public boolean supportsNotNullUnique()
        Deprecated.
        getUniqueDelegate() should be overridden instead.
        Is the combination of not-null and unique supported?
        Returns:
        deprecated
      • getQueryHintString

        public java.lang.String getQueryHintString​(java.lang.String query,
                                                   java.util.List<java.lang.String> hintList)
        Apply a hint to the query. The entire query is provided, allowing the Dialect full control over the placement and syntax of the hint. By default, ignore the hint and simply return the query.
        Parameters:
        query - The query to which to apply the hint.
        hintList - The hints to apply
        Returns:
        The modified SQL
      • getQueryHintString

        public java.lang.String getQueryHintString​(java.lang.String query,
                                                   java.lang.String hints)
        Apply a hint to the query. The entire query is provided, allowing the Dialect full control over the placement and syntax of the hint. By default, ignore the hint and simply return the query.
        Parameters:
        query - The query to which to apply the hint.
        hints - The hints to apply
        Returns:
        The modified SQL
      • defaultScrollMode

        public ScrollMode defaultScrollMode()
        Certain dialects support a subset of ScrollModes. Provide a default to be used by Criteria and Query.
        Returns:
        ScrollMode
      • supportsTuplesInSubqueries

        public boolean supportsTuplesInSubqueries()
        Does this dialect support tuples in subqueries? Ex: delete from Table1 where (col1, col2) in (select col1, col2 from Table2)
        Returns:
        boolean
      • getNameQualifierSupport

        public NameQualifierSupport getNameQualifierSupport()
        By default interpret this based on DatabaseMetaData.
        Returns:
        The NameQualifierSupport.
      • isJdbcLogWarningsEnabledByDefault

        public boolean isJdbcLogWarningsEnabledByDefault()
        Does the fetching JDBC statement warning for logging is enabled by default
        Returns:
        boolean
        Since:
        5.1
      • augmentPhysicalTableTypes

        public void augmentPhysicalTableTypes​(java.util.List<java.lang.String> tableTypesList)
      • augmentRecognizedTableTypes

        public void augmentRecognizedTableTypes​(java.util.List<java.lang.String> tableTypesList)
      • supportsPartitionBy

        public boolean supportsPartitionBy()
        Does the underlying database support partition by
        Returns:
        boolean
        Since:
        5.2
      • supportsNamedParameters

        public boolean supportsNamedParameters​(java.sql.DatabaseMetaData databaseMetaData)
                                        throws java.sql.SQLException
        Override the DatabaseMetaData#supportsNamedParameters()
        Returns:
        boolean
        Throws:
        java.sql.SQLException - Accessing the DatabaseMetaData can throw it. Just re-throw and Hibernate will handle.
      • supportsNationalizedTypes

        public boolean supportsNationalizedTypes()
        Does this dialect supports Nationalized Types
        Returns:
        boolean
      • supportsNonQueryWithCTE

        public boolean supportsNonQueryWithCTE()
        Does this dialect/database support non-query statements (e.g. INSERT, UPDATE, DELETE) with CTE (Common Table Expressions)?
        Returns:
        true if non-query statements are supported with CTE
      • supportsValuesList

        public boolean supportsValuesList()
        Does this dialect/database support VALUES list (e.g. VALUES (1), (2), (3) )
        Returns:
        true if VALUES list are supported
      • supportsSkipLocked

        public boolean supportsSkipLocked()
        Does this dialect/database support SKIP_LOCKED timeout.
        Returns:
        true if SKIP_LOCKED is supported
      • supportsNoWait

        public boolean supportsNoWait()
        Does this dialect/database support NO_WAIT timeout.
        Returns:
        true if NO_WAIT is supported
      • isLegacyLimitHandlerBehaviorEnabled

        public boolean isLegacyLimitHandlerBehaviorEnabled()
      • inlineLiteral

        public java.lang.String inlineLiteral​(java.lang.String literal)
        Inline String literal.
        Returns:
        escaped String
      • supportsJdbcConnectionLobCreation

        public boolean supportsJdbcConnectionLobCreation​(java.sql.DatabaseMetaData databaseMetaData)
        Check whether the JDBC Connection supports creating LOBs via Connection.createBlob(), Connection.createNClob() or Connection.createClob().
        Parameters:
        databaseMetaData - JDBC DatabaseMetaData which can be used if LOB creation is supported only starting from a given Driver version
        Returns:
        true if LOBs can be created via the JDBC Connection.
      • escapeLiteral

        protected java.lang.String escapeLiteral​(java.lang.String literal)
        Escape String literal.
        Returns:
        escaped String
      • addSqlHintOrComment

        public java.lang.String addSqlHintOrComment​(java.lang.String sql,
                                                    QueryParameters parameters,
                                                    boolean commentsEnabled)
        Modify the SQL, adding hints or comments, if necessary
        Parameters:
        sql - original sql
        parameters - query parameters
        commentsEnabled - if comments are enabled
      • prependComment

        protected java.lang.String prependComment​(java.lang.String sql,
                                                  java.lang.String comment)
      • escapeComment

        public static java.lang.String escapeComment​(java.lang.String comment)
      • supportsSelectAliasInGroupByClause

        public boolean supportsSelectAliasInGroupByClause()
      • getCreateTemporaryTableColumnAnnotation

        public java.lang.String getCreateTemporaryTableColumnAnnotation​(int sqlTypeCode)
        Annotation to be appended to the end of each COLUMN clause for temporary tables.
        Parameters:
        sqlTypeCode - The SQL type code
        Returns:
        The annotation to be appended (e.g. "COLLATE DATABASE_DEFAULT" in SQLServer SQL)