# Class MySQLPkGenerator

java.lang.Object
org.apache.cayenne.dba.JdbcPkGenerator
org.apache.cayenne.dba.mysql.MySQLPkGenerator

All Implemented Interfaces:
  `PkGenerator`

public class MySQLPkGenerator extends JdbcPkGenerator

- ## Field Summary

  ### Fields inherited from class JdbcPkGenerator

  `adapter, DEFAULT_PK_CACHE_SIZE, pkCache, pkCacheSize, pkStartValue`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MySQLPkGenerator(JdbcAdapter adapter)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected String`
  `dropAutoPkString()`
  `protected long`
  `getLongPrimaryKey(SQLLogger logger, Statement statement, String entityName)`
  `protected long`
  `longPkFromDatabase(DataNode node, DbEntity entity)`
  Overrides superclass's implementation to perform locking of the primary key lookup table.
  `protected String`
  `pkTableCreateString()`
  `protected SQLException`
  `processSQLException(SQLException exception, SQLException parent)`
  Appends a new SQLException to the chain.

  ### Methods inherited from class JdbcPkGenerator

  `autoPkTableExists, createAutoPk, createAutoPkStatements, dropAutoPk, dropAutoPkStatements, generatePk, getAdapter, getPkCacheSize, pkCreateString, pkDeleteString, pkSelectString, pkUpdateString, reset, runUpdate, setPkCacheSize`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface PkGenerator

  `generatePk`

- ## Constructor Details

  - ### MySQLPkGenerator

    public MySQLPkGenerator(JdbcAdapter adapter)

- ## Method Details

  - ### longPkFromDatabase

    protected long longPkFromDatabase(DataNode node, DbEntity entity)
    Overrides superclass's implementation to perform locking of the primary key lookup table.
    Overrides:
      `longPkFromDatabase` in class `JdbcPkGenerator`
    Since:
      3.0

  - ### processSQLException

    protected SQLException processSQLException(SQLException exception, SQLException parent)
    Appends a new SQLException to the chain. If parent is null, uses the exception as the chain root.

  - ### dropAutoPkString

    protected String dropAutoPkString()
    Overrides:
      `dropAutoPkString` in class `JdbcPkGenerator`

  - ### pkTableCreateString

    protected String pkTableCreateString()
    Overrides:
      `pkTableCreateString` in class `JdbcPkGenerator`

  - ### getLongPrimaryKey

    protected long getLongPrimaryKey(SQLLogger logger, Statement statement, String entityName) throws SQLException
    Throws:
      `SQLException`
    Since:
      3.0