类 MySQLDialect

    • 字段详细资料

      • ESCAPE_PATTERN_REPLACEMENT

        public static final String ESCAPE_PATTERN_REPLACEMENT
    • 构造器详细资料

      • MySQLDialect

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

      • registerVarcharTypes

        protected void registerVarcharTypes()
      • getAddColumnString

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

        public boolean qualifyIndexName()
        从类复制的说明: Dialect
        Do we need to qualify index names with the schema name?
        覆盖:
        qualifyIndexName 在类中 Dialect
        返回:
        boolean
      • getAddForeignKeyConstraintString

        public String getAddForeignKeyConstraintString​(String constraintName,
                                                       String[] foreignKey,
                                                       String referencedTable,
                                                       String[] primaryKey,
                                                       boolean referencesPrimaryKey)
        从类复制的说明: Dialect
        The syntax used to add a foreign key constraint to a table.
        覆盖:
        getAddForeignKeyConstraintString 在类中 Dialect
        参数:
        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
        返回:
        the "add FK" fragment
      • 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.
      • getLimitHandler

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

        public String getLimitString​(String sql,
                                     boolean hasOffset)
        从类复制的说明: Dialect
        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 Dialect.getLimitString(String, int, int).

        覆盖:
        getLimitString 在类中 Dialect
        参数:
        sql - The query to which to apply the limit.
        hasOffset - Is the query requesting an offset?
        返回:
        the modified SQL
      • closeQuote

        public char closeQuote()
        从类复制的说明: Dialect
        The character specific to this dialect used to close a quoted identifier.
        覆盖:
        closeQuote 在类中 Dialect
        返回:
        The dialect's specific close quote character.
      • openQuote

        public char openQuote()
        从类复制的说明: Dialect
        The character specific to this dialect used to begin a quoted identifier.
        覆盖:
        openQuote 在类中 Dialect
        返回:
        The dialect's specific open quote character.
      • canCreateCatalog

        public boolean canCreateCatalog()
        从类复制的说明: Dialect
        Does this dialect support catalog creation?
        覆盖:
        canCreateCatalog 在类中 Dialect
        返回:
        True if the dialect supports catalog creation; false otherwise.
      • getCreateCatalogCommand

        public String[] getCreateCatalogCommand​(String catalogName)
        从类复制的说明: Dialect
        Get the SQL command used to create the named catalog
        覆盖:
        getCreateCatalogCommand 在类中 Dialect
        参数:
        catalogName - The name of the catalog to be created.
        返回:
        The creation commands
      • getDropCatalogCommand

        public String[] getDropCatalogCommand​(String catalogName)
        从类复制的说明: Dialect
        Get the SQL command used to drop the named catalog
        覆盖:
        getDropCatalogCommand 在类中 Dialect
        参数:
        catalogName - The name of the catalog to be dropped.
        返回:
        The drop commands
      • canCreateSchema

        public boolean canCreateSchema()
        从类复制的说明: Dialect
        Does this dialect support schema creation?
        覆盖:
        canCreateSchema 在类中 Dialect
        返回:
        True if the dialect supports schema creation; false otherwise.
      • getCreateSchemaCommand

        public String[] getCreateSchemaCommand​(String schemaName)
        从类复制的说明: Dialect
        Get the SQL command used to create the named schema
        覆盖:
        getCreateSchemaCommand 在类中 Dialect
        参数:
        schemaName - The name of the schema to be created.
        返回:
        The creation commands
      • getDropSchemaCommand

        public String[] getDropSchemaCommand​(String schemaName)
        从类复制的说明: Dialect
        Get the SQL command used to drop the named schema
        覆盖:
        getDropSchemaCommand 在类中 Dialect
        参数:
        schemaName - The name of the schema to be dropped.
        返回:
        The drop commands
      • supportsIfExistsBeforeTableName

        public boolean supportsIfExistsBeforeTableName()
        从类复制的说明: Dialect
        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 Dialect.supportsIfExistsAfterTableName() should return true

        覆盖:
        supportsIfExistsBeforeTableName 在类中 Dialect
        返回:
        true if the "if exists" can be applied before the table name
      • getSelectGUIDString

        public String getSelectGUIDString()
        从类复制的说明: Dialect
        Get the command used to select a GUID from the underlying database.

        Optional operation.

        覆盖:
        getSelectGUIDString 在类中 Dialect
        返回:
        The appropriate command.
      • getTableComment

        public String getTableComment​(String comment)
        从类复制的说明: Dialect
        Get the comment into a form supported for table definition.
        覆盖:
        getTableComment 在类中 Dialect
        参数:
        comment - The comment to apply
        返回:
        The comment fragment
      • getColumnComment

        public String getColumnComment​(String comment)
        从类复制的说明: Dialect
        Get the comment into a form supported for column definition.
        覆盖:
        getColumnComment 在类中 Dialect
        参数:
        comment - The comment to apply
        返回:
        The comment fragment
      • getCastTypeName

        public String getCastTypeName​(int code)
        从类复制的说明: Dialect
        Get the name of the database type appropriate for casting operations (via the CAST() SQL function) for the given Types typecode.
        覆盖:
        getCastTypeName 在类中 Dialect
        参数:
        code - The Types typecode
        返回:
        The database type name
      • floatingPointNumberCastTarget

        protected String floatingPointNumberCastTarget()
        Determine the cast target for Types.FLOAT and Types.REAL (DOUBLE)
        返回:
        The proper cast target type.
      • fixedPointNumberCastTarget

        protected String fixedPointNumberCastTarget()
        Determine the cast target for Types.NUMERIC
        返回:
        The proper cast target type.
      • 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.
      • 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.
      • supportsRowValueConstructorSyntax

        public boolean supportsRowValueConstructorSyntax()
        从类复制的说明: Dialect
        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') ...".

        覆盖:
        supportsRowValueConstructorSyntax 在类中 Dialect
        返回:
        True if this SQL dialect is known to support "row value constructor" syntax; false otherwise.
      • renderOrderByElement

        public String renderOrderByElement​(String expression,
                                           String collation,
                                           String order,
                                           NullPrecedence nulls)
        从类复制的说明: Dialect
        Renders an ordering fragment
        覆盖:
        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.
        nulls - Nulls precedence. Default value: NullPrecedence.NONE.
        返回:
        Renders single element of ORDER BY clause.
      • 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.
      • getWriteLockString

        public String getWriteLockString​(int timeout)
        从类复制的说明: Dialect
        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.
        覆盖:
        getWriteLockString 在类中 Dialect
        参数:
        timeout - in milliseconds, -1 for indefinite wait and 0 for no wait.
        返回:
        The appropriate LOCK clause string.
      • getReadLockString

        public String getReadLockString​(int timeout)
        从类复制的说明: Dialect
        Get the string to append to SELECT statements to acquire READ locks for this dialect. Location of the returned string is treated the same as getForUpdateString.
        覆盖:
        getReadLockString 在类中 Dialect
        参数:
        timeout - in milliseconds, -1 for indefinite wait and 0 for no wait.
        返回:
        The appropriate LOCK clause string.
      • 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.
      • areStringComparisonsCaseInsensitive

        public boolean areStringComparisonsCaseInsensitive()
        从类复制的说明: Dialect
        Are string comparisons implicitly case insensitive.

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

        覆盖:
        areStringComparisonsCaseInsensitive 在类中 Dialect
        返回:
        True if comparisons are case insensitive.
      • supportsSubqueryOnMutatingTable

        public boolean supportsSubqueryOnMutatingTable()
        从类复制的说明: Dialect
        Does this dialect support referencing the table being mutated in a subquery. The "table being mutated" is the table referenced in an UPDATE or 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)
        覆盖:
        supportsSubqueryOnMutatingTable 在类中 Dialect
        返回:
        True if this dialect allows references the mutating table from a subquery.
      • 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.
      • 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
      • isJdbcLogWarningsEnabledByDefault

        public boolean isJdbcLogWarningsEnabledByDefault()
        从类复制的说明: Dialect
        Does the fetching JDBC statement warning for logging is enabled by default
        覆盖:
        isJdbcLogWarningsEnabledByDefault 在类中 Dialect
        返回:
        boolean
      • supportsCascadeDelete

        public boolean supportsCascadeDelete()
        从类复制的说明: Dialect
        Does this dialect support cascaded delete on foreign key definitions?
        覆盖:
        supportsCascadeDelete 在类中 Dialect
        返回:
        true indicates that the dialect does support cascaded delete on foreign keys.
      • getEngineKeyword

        protected String getEngineKeyword()
      • hasSelfReferentialForeignKeyBug

        public boolean hasSelfReferentialForeignKeyBug()
        从类复制的说明: Dialect
        Does the database/driver have bug in deleting rows that refer to other rows being deleted in the same query?
        覆盖:
        hasSelfReferentialForeignKeyBug 在类中 Dialect
        返回:
        true if the database/driver has this bug
      • 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.
      • getDefaultMySQLStorageEngine

        protected MySQLStorageEngine getDefaultMySQLStorageEngine()