类 DB2Dialect

    • 构造器详细资料

      • DB2Dialect

        public DB2Dialect()
        Constructs a DB2Dialect
    • 方法详细资料

      • getLowercaseFunction

        public String getLowercaseFunction()
        从类复制的说明: Dialect
        The name of the SQL function that transforms a string to lowercase
        覆盖:
        getLowercaseFunction 在类中 Dialect
        返回:
        The dialect-specific lowercase function.
      • getAddColumnString

        public String getAddColumnString()
        从类复制的说明: Dialect
        The syntax used to add a column to a table (optional).
        覆盖:
        getAddColumnString 在类中 Dialect
        返回:
        The "add column" fragment.
      • dropConstraints

        public boolean dropConstraints()
        从类复制的说明: Dialect
        Do we need to drop constraints before dropping tables in this dialect?
        覆盖:
        dropConstraints 在类中 Dialect
        返回:
        True if constraints must be dropped prior to dropping the table; false otherwise.
      • getSequenceNextValString

        public String getSequenceNextValString​(String sequenceName)
        从类复制的说明: Dialect
        Generate the appropriate select statement to to retrieve the next value of a sequence.

        This should be a "stand alone" select statement.

        覆盖:
        getSequenceNextValString 在类中 Dialect
        参数:
        sequenceName - the name of the sequence
        返回:
        String The "nextval" select string.
      • supportsSequences

        public boolean supportsSequences()
        从类复制的说明: Dialect
        Does this dialect support sequences?
        覆盖:
        supportsSequences 在类中 Dialect
        返回:
        True if sequences supported; false otherwise.
      • getQuerySequencesString

        public String getQuerySequencesString()
        从类复制的说明: Dialect
        Get the select command used retrieve the names of all sequences.
        覆盖:
        getQuerySequencesString 在类中 Dialect
        返回:
        The select command; or null if sequences are not supported.
        另请参阅:
        SchemaUpdate
      • supportsLimit

        public boolean supportsLimit()
        从类复制的说明: Dialect
        Does this dialect support some form of limiting query results via a SQL clause?
        覆盖:
        supportsLimit 在类中 Dialect
        返回:
        True if this dialect supports some form of LIMIT.
      • supportsVariableLimit

        public boolean supportsVariableLimit()
        从类复制的说明: Dialect
        Does this dialect support bind variables (i.e., prepared statement parameters) for its limit/offset?
        覆盖:
        supportsVariableLimit 在类中 Dialect
        返回:
        True if bind variables can be used; false otherwise.
      • getLimitString

        public String getLimitString​(String sql,
                                     int offset,
                                     int limit)
        从类复制的说明: Dialect
        Given a limit and an offset, apply the limit clause to the query.
        覆盖:
        getLimitString 在类中 Dialect
        参数:
        sql - The query to which to apply the limit.
        offset - The offset of the limit
        limit - The limit of the limit ;)
        返回:
        The modified query statement with the limit applied.
      • convertToFirstRowValue

        public int convertToFirstRowValue​(int zeroBasedFirstResult)
        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 Dialect.getLimitString(String,int,int) is the zero-based offset. Dialects which do not Dialect.supportsVariableLimit() should take care to perform any needed first-row-conversion calls prior to injecting the limit values into the SQL string.

        DB2 does have a one-based offset, however this was actually already handled in the limit string building (the '?+1' bit). To not mess up inheritors, I'll leave that part alone and not touch the offset here.

        覆盖:
        convertToFirstRowValue 在类中 Dialect
        参数:
        zeroBasedFirstResult - The user-supplied, zero-based first row offset.
        返回:
        The corresponding db/dialect specific offset.
        另请参阅:
        Query.setFirstResult(int), Criteria.setFirstResult(int)
      • getForUpdateString

        public String getForUpdateString()
        从类复制的说明: Dialect
        Get the string to append to SELECT statements to acquire locks for this dialect.
        覆盖:
        getForUpdateString 在类中 Dialect
        返回:
        The appropriate FOR UPDATE clause string.
      • useMaxForLimit

        public boolean useMaxForLimit()
        从类复制的说明: Dialect
        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?

        覆盖:
        useMaxForLimit 在类中 Dialect
        返回:
        True if limit is relative from offset; false otherwise.
      • supportsOuterJoinForUpdate

        public boolean supportsOuterJoinForUpdate()
        从类复制的说明: Dialect
        Does this dialect support FOR UPDATE in conjunction with outer joined rows?
        覆盖:
        supportsOuterJoinForUpdate 在类中 Dialect
        返回:
        True if outer joined rows can be locked via FOR UPDATE.
      • supportsExistsInSelect

        public boolean supportsExistsInSelect()
        从类复制的说明: Dialect
        Does the dialect support an exists statement in the select clause?
        覆盖:
        supportsExistsInSelect 在类中 Dialect
        返回:
        True if exists checks are allowed in the select clause; false otherwise.
      • supportsLockTimeouts

        public boolean supportsLockTimeouts()
        从类复制的说明: Dialect
        Informational metadata about whether this dialect is known to support specifying timeouts for requested lock acquisitions.
        覆盖:
        supportsLockTimeouts 在类中 Dialect
        返回:
        True is this dialect supports specifying lock timeouts.
      • getSelectClauseNullString

        public String getSelectClauseNullString​(int sqlType)
        从类复制的说明: Dialect
        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.

        覆盖:
        getSelectClauseNullString 在类中 Dialect
        参数:
        sqlType - The Types type code.
        返回:
        The appropriate select clause value fragment.
      • supportsUnionAll

        public boolean supportsUnionAll()
        从类复制的说明: Dialect
        Does this dialect support UNION ALL, which is generally a faster variant of UNION?
        覆盖:
        supportsUnionAll 在类中 Dialect
        返回:
        True if UNION ALL is supported; false otherwise.
      • registerResultSetOutParameter

        public int registerResultSetOutParameter​(CallableStatement statement,
                                                 int col)
                                          throws SQLException
        从类复制的说明: Dialect
        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.
        覆盖:
        registerResultSetOutParameter 在类中 Dialect
        参数:
        statement - The callable statement.
        col - The bind position at which to register the output param.
        返回:
        The number of (contiguous) bind positions used.
        抛出:
        SQLException - Indicates problems registering the param.
      • supportsCommentOn

        public boolean supportsCommentOn()
        从类复制的说明: Dialect
        Does this dialect/database support commenting on tables, columns, etc?
        覆盖:
        supportsCommentOn 在类中 Dialect
        返回:
        true if commenting is supported
      • supportsCurrentTimestampSelection

        public boolean supportsCurrentTimestampSelection()
        从类复制的说明: Dialect
        Does this dialect support a way to retrieve the database's current timestamp value?
        覆盖:
        supportsCurrentTimestampSelection 在类中 Dialect
        返回:
        True if the current timestamp can be retrieved; false otherwise.
      • getCurrentTimestampSelectString

        public String getCurrentTimestampSelectString()
        从类复制的说明: Dialect
        Retrieve the command used to retrieve the current timestamp from the database.
        覆盖:
        getCurrentTimestampSelectString 在类中 Dialect
        返回:
        The command.
      • supportsParametersInInsertSelect

        public boolean supportsParametersInInsertSelect()
        Does this dialect support parameters within the SELECT clause of INSERT ... SELECT ... statements?

        NOTE : DB2 is know to support parameters in the SELECT clause, but only in casted form (see requiresCastingOfParametersInSelectClause()).

        覆盖:
        supportsParametersInInsertSelect 在类中 Dialect
        返回:
        True if this is supported; false otherwise.
      • 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.

        DB2 in fact does require that parameters appearing in the select clause be wrapped in cast() calls to tell the DB parser the type of the select value.

        覆盖:
        requiresCastingOfParametersInSelectClause 在类中 Dialect
        返回:
        True if select clause parameter must be cast()ed
      • getCrossJoinSeparator

        public String getCrossJoinSeparator()
        从类复制的说明: Dialect
        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!

        覆盖:
        getCrossJoinSeparator 在类中 Dialect
        返回:
        The cross join separator
      • supportsEmptyInList

        public boolean supportsEmptyInList()
        从类复制的说明: Dialect
        Does this dialect support empty IN lists?

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

        覆盖:
        supportsEmptyInList 在类中 Dialect
        返回:
        True if empty in lists are supported; false otherwise.
      • doesReadCommittedCauseWritersToBlockReaders

        public boolean doesReadCommittedCauseWritersToBlockReaders()
        从类复制的说明: Dialect
        For the underlying database, is READ_COMMITTED isolation implemented by forcing readers to wait for write locks to be released?
        覆盖:
        doesReadCommittedCauseWritersToBlockReaders 在类中 Dialect
        返回:
        True if writers block readers to achieve READ_COMMITTED; false otherwise.
      • supportsTupleDistinctCounts

        public boolean supportsTupleDistinctCounts()
        从类复制的说明: Dialect
        Does this dialect support `count(distinct a,b)`?
        覆盖:
        supportsTupleDistinctCounts 在类中 Dialect
        返回:
        True if the database supports counting distinct tuples; false otherwise.
      • buildSQLExceptionConversionDelegate

        public SQLExceptionConversionDelegate buildSQLExceptionConversionDelegate()
        从类复制的说明: Dialect
        Build an instance of a SQLExceptionConversionDelegate for interpreting dialect-specific error or SQLState codes.

        When Dialect.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.

        覆盖:
        buildSQLExceptionConversionDelegate 在类中 Dialect
        返回:
        The SQLExceptionConversionDelegate for this dialect
      • getNotExpression

        public String getNotExpression​(String expression)
        从类复制的说明: Dialect
        Negate an expression
        覆盖:
        getNotExpression 在类中 Dialect
        参数:
        expression - The expression to negate
        返回:
        The negated expression
      • getLimitHandler

        public LimitHandler getLimitHandler()
        从类复制的说明: Dialect
        Returns the delegate managing LIMIT clause.
        覆盖:
        getLimitHandler 在类中 Dialect
        返回:
        LIMIT clause delegate.
      • renderOrderByElement

        public String renderOrderByElement​(String expression,
                                           String collation,
                                           String order,
                                           NullPrecedence nullPrecedence)
        Handle DB2 "support" for null precedence...
        覆盖:
        renderOrderByElement 在类中 Dialect
        参数:
        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.
        nullPrecedence - Nulls precedence. Default value: NullPrecedence.NONE.
        返回:
        SQL string.
      • supportsPartitionBy

        public boolean supportsPartitionBy()
        从类复制的说明: Dialect
        Does the underlying database support partition by
        覆盖:
        supportsPartitionBy 在类中 Dialect
        返回:
        boolean