org.apache.cayenne.dba.derby

## Class DerbyPkGenerator

- java.lang.Object
- - org.apache.cayenne.dba.JdbcPkGenerator
  - - org.apache.cayenne.dba.oracle.OraclePkGenerator
    - - org.apache.cayenne.dba.derby.DerbyPkGenerator

- All Implemented Interfaces:
    PkGenerator

      public class DerbyPkGenerator
      extends OraclePkGenerator

  PK generator for Derby that uses sequences.
  Since:
    4.0 (old one used AUTO_PK_SUPPORT table)

- - ### Field Summary

    - ### Fields inherited from class org.apache.cayenne.dba.JdbcPkGenerator

      `adapter, DEFAULT_PK_CACHE_SIZE, pkCache, pkCacheSize, pkStartValue`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected String` | `createSequenceString(DbEntity entity)`
    `protected String` | `dropSequenceString(DbEntity entity)` Returns a SQL string needed to drop any database objects associated with automatic primary key generation process for a specific DbEntity.
    `protected String` | `selectAllSequencesQuery()`
    `protected String` | `selectNextValQuery(String pkGeneratingSequenceName)`
    `protected String` | `sequenceName(DbEntity entity)` Returns expected primary key sequence name for a DbEntity.

    - ### Methods inherited from class org.apache.cayenne.dba.oracle.OraclePkGenerator

      `createAutoPk, createAutoPkStatements, dropAutoPk, dropAutoPkStatements, getExistingSequences, getSequencePrefix, longPkFromDatabase, pkCacheSize`

    - ### Methods inherited from class org.apache.cayenne.dba.JdbcPkGenerator

      `autoPkTableExists, dropAutoPkString, generatePk, getAdapter, getPkCacheSize, pkCreateString, pkDeleteString, pkSelectString, pkTableCreateString, pkUpdateString, reset, runUpdate, setPkCacheSize`

    - ### Methods inherited from class java.lang.Object

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

- - ### Method Detail

    - #### sequenceName

          protected String sequenceName(DbEntity entity)

      Description copied from class: `OraclePkGenerator`
      Returns expected primary key sequence name for a DbEntity.
      Overrides:
        `sequenceName` in class `OraclePkGenerator`

    - #### selectNextValQuery

          protected String selectNextValQuery(String pkGeneratingSequenceName)

      Overrides:
        `selectNextValQuery` in class `OraclePkGenerator`

    - #### selectAllSequencesQuery

          protected String selectAllSequencesQuery()

      Overrides:
        `selectAllSequencesQuery` in class `OraclePkGenerator`

    - #### dropSequenceString

          protected String dropSequenceString(DbEntity entity)

      Description copied from class: `OraclePkGenerator`
      Returns a SQL string needed to drop any database objects associated with automatic primary key generation process for a specific DbEntity.
      Overrides:
        `dropSequenceString` in class `OraclePkGenerator`

    - #### createSequenceString

          protected String createSequenceString(DbEntity entity)

      Overrides:
        `createSequenceString` in class `OraclePkGenerator`

Copyright © 2001–2018 Apache Cayenne. All rights reserved.