Class OraclePkGenerator

  • All Implemented Interfaces:
    Direct Known Subclasses:
    DB2PkGenerator, DerbyPkGenerator, H2PkGenerator, IngresPkGenerator, PostgresPkGenerator, SQLServerPkGenerator

    public class OraclePkGenerator
    extends JdbcPkGenerator
    Sequence-based primary key generator implementation for Oracle. Uses Oracle sequences to generate primary key values. This approach is at least 50% faster when tested with Oracle compared to the lookup table approach.

    When using Cayenne key caching mechanism, make sure that sequences in the database have "INCREMENT BY" greater or equal to OraclePkGenerator "pkCacheSize" property value. If this is not the case, you will need to adjust PkGenerator value accordingly. For example when sequence is incremented by 1 each time, use the following code:

    • Constructor Detail

      • OraclePkGenerator

        public OraclePkGenerator()
        Used by DI
      • OraclePkGenerator

        protected OraclePkGenerator​(JdbcAdapter adapter)