Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Berkeley DB Java Edition version 3.2.76
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sleepycat.persist.model
Class ClassMetadata

    java.lang.Object
      com.sleepycat.persist.model.ClassMetadata

All Implemented Interfaces:
  Serializable

    public class ClassMetadata

extends Object
implements Serializable

The metadata for a persistent class. A persistent class may be specified with the `Entity` or `Persistent` annotation.

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

This and other metadata classes are classes rather than interfaces to allow adding properties to the model at a future date without causing incompatibilities. Any such property will be given a default value and its use will be optional.

Author:
  Mark Hayes
See Also:
  Serialized Form

Constructor Summary
`ClassMetadata(String className, int version, String proxiedClassName, boolean entityClass, PrimaryKeyMetadata primaryKey, Map<String,SecondaryKeyMetadata> secondaryKeys, List<FieldMetadata> compositeKeyFields)` Used by an `EntityModel` to construct persistent class metadata.

Method Summary
`boolean` | `equals(Object other)`
`String` | `getClassName()` Returns the name of the persistent class.
`List<FieldMetadata>` | `getCompositeKeyFields()` Returns an unmodifiable list of metadata for the fields making up a composite key, or null if this is a not a composite key class.
`PrimaryKeyMetadata` | `getPrimaryKey()` Returns the primary key metadata for a key declared in this class, or null if none is declared.
`String` | `getProxiedClassName()` Returns the class name of the proxied class if this class is a `PersistentProxy`, or null otherwise.
`Map<String,SecondaryKeyMetadata>` | `getSecondaryKeys()` Returns an unmodifiable map of field name to secondary key metadata for all secondary keys declared in this class, or null if no secondary keys are declared in this class.
`int` | `getVersion()` Returns the version of this persistent class.
`int` | `hashCode()`
`boolean` | `isEntityClass()` Returns whether this class is an entity class.

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ClassMetadata

    public ClassMetadata(String className,
                         int version,
                         String proxiedClassName,
                         boolean entityClass,
                         PrimaryKeyMetadata primaryKey,
                         Map<String,SecondaryKeyMetadata> secondaryKeys,
                         List<FieldMetadata> compositeKeyFields)

  Used by an `EntityModel` to construct persistent class metadata.

Method Detail

### getClassName

    public String getClassName()

  Returns the name of the persistent class.

### getVersion

    public int getVersion()

  Returns the version of this persistent class. This may be specified using the `Entity.version()` or `Persistent.version()` annotation.

### getProxiedClassName

    public String getProxiedClassName()

  Returns the class name of the proxied class if this class is a `PersistentProxy`, or null otherwise.

### isEntityClass

    public boolean isEntityClass()

  Returns whether this class is an entity class.

### getPrimaryKey

    public PrimaryKeyMetadata getPrimaryKey()

  Returns the primary key metadata for a key declared in this class, or null if none is declared. This may be specified using the `PrimaryKey` annotation.

### getSecondaryKeys

    public Map<String,SecondaryKeyMetadata> getSecondaryKeys()

  Returns an unmodifiable map of field name to secondary key metadata for all secondary keys declared in this class, or null if no secondary keys are declared in this class. This metadata may be specified using `SecondaryKey` annotations.

### getCompositeKeyFields

    public List<FieldMetadata> getCompositeKeyFields()

  Returns an unmodifiable list of metadata for the fields making up a composite key, or null if this is a not a composite key class. The order of the fields in the returned list determines their stored order and may be specified using the `KeyField` annotation. When the composite key class does not implement `Comparable`, the order of the fields is the relative sort order.

### equals

    public boolean equals(Object other)

  Overrides:
    `equals` in class `Object`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Berkeley DB Java Edition version 3.2.76
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 1996,2008 Oracle. All rights reserved.