Class MySQLDictionary

All Implemented Interfaces:
JoinSyntaxes, Configurable, IdentifierConfiguration, ConnectionDecorator, LoggingConnectionDecorator.SQLWarningHandler

public class MySQLDictionary extends AbstractMySQLDictionary
Dictionary for MySQL.
  • Field Details

  • Constructor Details

    • MySQLDictionary

      public MySQLDictionary()
  • Method Details

    • getSelectHint

      protected String getSelectHint()
      Description copied from class: AbstractMySQLDictionary
      The name of the fetch configuration hint whose value is appended after the SELECT keyword of a query.
      Specified by:
      getSelectHint in class AbstractMySQLDictionary
      See Also:
    • getMaxDecimalScale

      protected int getMaxDecimalScale()
      Description copied from class: AbstractMySQLDictionary
      The largest scale of a decimal column the database allows.
      Specified by:
      getMaxDecimalScale in class AbstractMySQLDictionary
    • connectedConfiguration

      public void connectedConfiguration(Connection conn) throws SQLException
      Description copied from class: DBDictionary
      This method is called when the dictionary first sees any connection. It is used to initialize dictionary metadata if needed. If you override this method, be sure to call super.connectedConfiguration.
      Overrides:
      connectedConfiguration in class DBDictionary
      Throws:
      SQLException
    • isReplicationConnection

      public boolean isReplicationConnection(Connection conn) throws SQLException
      Whether the given connection is a Connector/J replication connection, which routes the statements of a read-only connection to a replica: one opened with a jdbc:mysql:replication: URL by Connector/J 8 and later, or by the ReplicationDriver of Connector/J 5, also behind the wrapper of a connection pool. The configured driver name is only consulted when the driver's replication connection interfaces cannot be loaded.
      Overrides:
      isReplicationConnection in class DBDictionary
      Parameters:
      conn - a connection of the store, possibly wrapped by OpenJPA's decorators
      Throws:
      SQLException
    • getReplicationConnectionTypeNames

      protected String[] getReplicationConnectionTypeNames()
      The names of the interfaces a replication connection of the driver implements.
    • delimitsReservedWords

      protected boolean delimitsReservedWords()
      MySQL delimits a name that is a reserved word, also under the compatibility option UpdatedReservedWords=false.
      Specified by:
      delimitsReservedWords in class AbstractMySQLDictionary
    • getBatchFetchSize

      public int getBatchFetchSize(int batchFetchSize)
      Overrides:
      getBatchFetchSize in class DBDictionary
    • matchErrorState

      protected int matchErrorState(Map<Integer, Set<String>> errorStates, SQLException ex)
      Description copied from class: DBDictionary
      Determine the more appropriate type of store exception by matching the SQL Error State of the the given SQLException to the given Error States categorized by error types. Dictionary subclass can override this method and extract SQLException data to figure out if the exception is recoverable.
      Overrides:
      matchErrorState in class DBDictionary
      Parameters:
      errorStates - classification of SQL error states by their specific nature. The keys of the map represent one of the constants defined in StoreException. The value corresponding to a key represent the set of SQL Error States representing specific category of database error. This supplied map is sourced from sql-error-state-codes.xml and filtered the error states for the current database.
      ex - original SQL Exception as raised by the database driver.
      Returns:
      A constant indicating the category of error as defined in StoreException.
    • isFatalException

      public boolean isFatalException(int subtype, SQLException ex)
      Description copied from class: DBDictionary
      Determine if the given SQL Exception is fatal or recoverable (such as a timeout). This implementation always returns true (i.e. all exceptions are fatal). The current dictionary implementation can overwrite this method to mark certain exception conditions as recoverable error.
      Overrides:
      isFatalException in class DBDictionary
      Parameters:
      subtype - A constant indicating the category of error as defined in StoreException.
      ex - original SQL Exception as raised by the database driver.
      Returns:
      false if the error is fatal.