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 and Description
    --- | ---
    `protected` | `H2PkGenerator(JdbcAdapter adapter)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and 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, setPkCacheSize`

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

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

- - ### Constructor Detail

    - #### H2PkGenerator

          protected H2PkGenerator(JdbcAdapter adapter)

  - ### Method Detail

    - #### 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`

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