Package com.sleepycat.persist.model

## Class PrimaryKeyMetadata

- java.lang.Object
- - com.sleepycat.persist.model.FieldMetadata
  - - com.sleepycat.persist.model.PrimaryKeyMetadata

- All Implemented Interfaces:
    `java.io.Serializable`

      public class PrimaryKeyMetadata
      extends FieldMetadata

  The metadata for a primary key field. A primary key may be specified with the `PrimaryKey` annotation.

  `PrimaryKeyMetadata` objects are thread-safe. Multiple threads may safely call the methods of a shared `PrimaryKeyMetadata` object.

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `PrimaryKeyMetadata​(java.lang.String name, java.lang.String className, java.lang.String declaringClassName, java.lang.String sequenceName)` | Used by an `EntityModel` to construct primary key metadata.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `equals​(java.lang.Object other)` |
    `java.lang.String` | `getSequenceName()` | Returns the name of the sequence for assigning key values.
    `int` | `hashCode()` |

    - ### Methods inherited from class com.sleepycat.persist.model.FieldMetadata

      `getClassName, getDeclaringClassName, getName, toString`

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

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

- - ### Constructor Detail

    - #### PrimaryKeyMetadata

          public PrimaryKeyMetadata​(java.lang.String name,
                                    java.lang.String className,
                                    java.lang.String declaringClassName,
                                    java.lang.String sequenceName)

      Used by an `EntityModel` to construct primary key metadata.
      Parameters:
        `name` - the field name.
        `className` - the class name.
        `declaringClassName` - the name of the class where the field is declared.
        `sequenceName` - the sequence name.

  - ### Method Detail

    - #### getSequenceName

          public java.lang.String getSequenceName()

      Returns the name of the sequence for assigning key values. This may be specified using the `PrimaryKey.sequence()` annotation.
      Returns:
        the sequence name.

    - #### equals

          public boolean equals​(java.lang.Object other)

      Overrides:
        `equals` in class `FieldMetadata`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `FieldMetadata`

Copyright (c) 1996, 2020 Oracle and/or its affiliates. All rights reserved.