com.sleepycat.persist.model

## Class EntityMetadata

- java.lang.Object
- - com.sleepycat.persist.model.EntityMetadata

- All Implemented Interfaces:
    java.io.Serializable

      public class EntityMetadata
      extends java.lang.Object
      implements java.io.Serializable

  The metadata for a persistent entity class. An entity class may be specified with the `Entity` annotation.

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

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `EntityMetadata(java.lang.String className, PrimaryKeyMetadata primaryKey, java.util.Map<java.lang.String,SecondaryKeyMetadata> secondaryKeys)` Used by an `EntityModel` to construct entity metadata.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object other)`
    `java.lang.String` | `getClassName()` Returns the name of the entity class.
    `PrimaryKeyMetadata` | `getPrimaryKey()` Returns the primary key metadata for this entity.
    `java.util.Map<java.lang.String,SecondaryKeyMetadata>` | `getSecondaryKeys()` Returns an unmodifiable map of key name to secondary key metadata, or an empty map if no secondary keys are defined for this entity.
    `int` | `hashCode()`

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

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

- - ### Constructor Detail

    - #### EntityMetadata

          public EntityMetadata(java.lang.String className,
                                PrimaryKeyMetadata primaryKey,
                                java.util.Map<java.lang.String,SecondaryKeyMetadata> secondaryKeys)

      Used by an `EntityModel` to construct entity metadata.
      Parameters:
        `className` - the class name.
        `primaryKey` - the primary key metadata.
        `secondaryKeys` - the secondary key metadata.

  - ### Method Detail

    - #### getClassName

          public java.lang.String getClassName()

      Returns the name of the entity class.
      Returns:
        the name of the entity class.

    - #### getPrimaryKey

          public PrimaryKeyMetadata getPrimaryKey()

      Returns the primary key metadata for this entity. Note that the primary key field may be declared in this class or in a subclass. This metadata may be specified using the `PrimaryKey` annotation.
      Returns:
        the primary key metadata.

    - #### getSecondaryKeys

          public java.util.Map<java.lang.String,SecondaryKeyMetadata> getSecondaryKeys()

      Returns an unmodifiable map of key name to secondary key metadata, or an empty map if no secondary keys are defined for this entity. The returned map contains a mapping for each secondary key of this entity, including secondary keys declared in subclasses and superclasses. This metadata may be specified using `SecondaryKey` annotations.
      Returns:
        the secondary key metadata.

    - #### equals

          public boolean equals(java.lang.Object other)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

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