Package org.apache.cayenne.dba.h2

# Class H2PkGenerator

java.lang.Object
org.apache.cayenne.dba.JdbcPkGenerator
org.apache.cayenne.dba.oracle.OraclePkGenerator
org.apache.cayenne.dba.h2.H2PkGenerator

All Implemented Interfaces:
  `PkGenerator`

public class H2PkGenerator extends OraclePkGenerator
Default PK generator for H2 that uses sequences for PK generation.

Since:
  4.0

- ## Field Summary

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

  `adapter, DEFAULT_PK_CACHE_SIZE, pkCache, pkCacheSize, pkStartValue`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  ``
  `H2PkGenerator()`
  Used by DI
  `protected`
  `H2PkGenerator(JdbcAdapter adapter)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected String`
  `createSequenceString(DbEntity ent)`
  `protected String`
  `selectAllSequencesQuery()`
  `protected String`
  `selectNextValQuery(String sequenceName)`

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

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

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

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

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

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

- ## Constructor Details

  - ### H2PkGenerator

    public H2PkGenerator()
    Used by DI
    Since:
      4.1

  - ### H2PkGenerator

    protected H2PkGenerator(JdbcAdapter adapter)

- ## Method Details

  - ### createSequenceString

    protected String createSequenceString(DbEntity ent)
    Overrides:
      `createSequenceString` in class `OraclePkGenerator`

  - ### selectNextValQuery

    protected String selectNextValQuery(String sequenceName)
    Overrides:
      `selectNextValQuery` in class `OraclePkGenerator`

  - ### selectAllSequencesQuery

    protected String selectAllSequencesQuery()
    Overrides:
      `selectAllSequencesQuery` in class `OraclePkGenerator`