Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cayenne.dba.derby
Class DerbyPkGenerator

    java.lang.Object
      org.apache.cayenne.dba.JdbcPkGenerator
          org.apache.cayenne.dba.derby.DerbyPkGenerator

All Implemented Interfaces:
  PkGenerator

    public class DerbyPkGenerator

extends JdbcPkGenerator

Default PK generator for Derby that uses updateable ResultSet to get the next id from the lookup table.

Since:
  1.2

Field Summary

Fields inherited from class org.apache.cayenne.dba.JdbcPkGenerator
`DEFAULT_PK_CACHE_SIZE, pkCache, pkCacheSize`

Method Summary
`protected long` | `longPkFromDatabase(DataNode node, DbEntity entity)` Performs primary key generation ignoring cache.
`protected int` | `pkFromDatabase(DataNode node, DbEntity entity)` Deprecated. since 3.0

Methods inherited from class org.apache.cayenne.dba.JdbcPkGenerator
`autoPkTableExists, binaryPK, createAutoPk, createAutoPkStatements, dropAutoPk, dropAutoPkStatements, dropAutoPkString, generatePk, generatePkForDbEntity, 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

### longPkFromDatabase

    protected long longPkFromDatabase(DataNode node,
                                      DbEntity entity)
                               throws Exception

  Description copied from class: `JdbcPkGenerator`
  Performs primary key generation ignoring cache. Generates a range of primary keys as specified by "pkCacheSize" bean property.

  This method is called internally from "generatePkForDbEntity" and then generated range of key values is saved in cache for performance. Subclasses that implement different primary key generation solutions should override this method, not "generatePkForDbEntity".

  Overrides:
    `longPkFromDatabase` in class `JdbcPkGenerator`
  Throws:
    `Exception`
  Since:
    3.0

### pkFromDatabase

    protected int pkFromDatabase(DataNode node,
                                 DbEntity entity)
                          throws Exception

  Deprecated. since 3.0

  Description copied from class: `JdbcPkGenerator`
  Performs primary key generation ignoring cache. Generates a range of primary keys as specified by "pkCacheSize" bean property.

  This method is called internally from "generatePkForDbEntity" and then generated range of key values is saved in cache for performance. Subclasses that implement different primary key generation solutions should override this method, not "generatePkForDbEntity".

  Overrides:
    `pkFromDatabase` in class `JdbcPkGenerator`
  Throws:
    `Exception`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2010 Apache Cayenne. All Rights Reserved.