org.apache.cayenne.map

## Class DbKeyGenerator

- java.lang.Object
- - org.apache.cayenne.map.DbKeyGenerator

- All Implemented Interfaces:
    Serializable, CayenneMapEntry, XMLSerializable

      public class DbKeyGenerator
      extends Object
      implements CayenneMapEntry, XMLSerializable, Serializable

  DbKeyGenerator is an abstraction of a primary key generator It configures the primary key generation per DbEntity in a RDBMS independent manner. DbAdapter generates actual key values based on the configuration. For more details see data-map.dtd
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected DbEntity` | `dbEntity`
    `protected String` | `generatorName`
    `protected String` | `generatorType`
    `protected Integer` | `keyCacheSize`
    `protected String` | `name`
    `static String` | `NAMED_SEQUENCE_TABLE_TYPE`
    `static String` | `ORACLE_TYPE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DbKeyGenerator()`
    `DbKeyGenerator(String name)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `encodeAsXML(XMLEncoder encoder)` Prints itself as XML to the provided XMLEncoder.
    `DbEntity` | `getDbEntity()`
    `String` | `getGeneratorName()`
    `String` | `getGeneratorType()`
    `Integer` | `getKeyCacheSize()`
    `String` | `getName()` Returns the name property of this object.
    `Object` | `getParent()` Returns the parent map.
    `void` | `setDbEntity(DbEntity dbEntity)`
    `void` | `setGeneratorName(String generatorName)`
    `void` | `setGeneratorType(String generatorType)`
    `void` | `setKeyCacheSize(Integer keyCacheSize)`
    `void` | `setName(String name)`
    `void` | `setParent(Object parent)` Stores the parent map.
    `String` | `toString()`

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

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

- - ### Field Detail

    - #### ORACLE_TYPE

          public static final String ORACLE_TYPE

      See Also:
        Constant Field Values

    - #### NAMED_SEQUENCE_TABLE_TYPE

          public static final String NAMED_SEQUENCE_TABLE_TYPE

      See Also:
        Constant Field Values

    - #### name

          protected String name

    - #### dbEntity

          protected DbEntity dbEntity

    - #### generatorType

          protected String generatorType

    - #### keyCacheSize

          protected Integer keyCacheSize

    - #### generatorName

          protected String generatorName

  - ### Constructor Detail

    - #### DbKeyGenerator

          public DbKeyGenerator()

    - #### DbKeyGenerator

          public DbKeyGenerator(String name)

  - ### Method Detail

    - #### getName

          public String getName()

      Description copied from interface: `CayenneMapEntry`
      Returns the name property of this object.
      Specified by:
        `getName` in interface `CayenneMapEntry`
      Returns:
        name of this entry.

    - #### setName

          public void setName(String name)

    - #### getParent

          public Object getParent()

      Description copied from interface: `CayenneMapEntry`
      Returns the parent map.
      Specified by:
        `getParent` in interface `CayenneMapEntry`

    - #### setParent

          public void setParent(Object parent)

      Description copied from interface: `CayenneMapEntry`
      Stores the parent map.
      Specified by:
        `setParent` in interface `CayenneMapEntry`

    - #### encodeAsXML

          public void encodeAsXML(XMLEncoder encoder)

      Prints itself as XML to the provided XMLEncoder.
      Specified by:
        `encodeAsXML` in interface `XMLSerializable`
      Since:
        1.1

    - #### getDbEntity

          public DbEntity getDbEntity()

    - #### setDbEntity

          public void setDbEntity(DbEntity dbEntity)

    - #### setGeneratorType

          public void setGeneratorType(String generatorType)

    - #### getGeneratorType

          public String getGeneratorType()

    - #### setKeyCacheSize

          public void setKeyCacheSize(Integer keyCacheSize)

    - #### getKeyCacheSize

          public Integer getKeyCacheSize()

    - #### setGeneratorName

          public void setGeneratorName(String generatorName)

    - #### getGeneratorName

          public String getGeneratorName()

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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