Package org.apache.cayenne.dba.postgres

## Class PostgresPkGenerator

- java.lang.Object
- - org.apache.cayenne.dba.JdbcPkGenerator
  - - org.apache.cayenne.dba.oracle.OraclePkGenerator
    - - org.apache.cayenne.dba.postgres.PostgresPkGenerator

- All Implemented Interfaces:
    `PkGenerator`

      public class PostgresPkGenerator
      extends OraclePkGenerator

  Default PK generator for PostgreSQL that uses sequences for PK generation.

- - ### 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
    --- | --- | ---
    `` | `PostgresPkGenerator()` | Used by DI
    `protected` | `PostgresPkGenerator​(JdbcAdapter adapter)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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 Detail

    - #### PostgresPkGenerator

          public PostgresPkGenerator()

      Used by DI
      Since:
        4.1

    - #### PostgresPkGenerator

          protected PostgresPkGenerator​(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`