com.sleepycat.persist.model

## Class AnnotationModel

- java.lang.Object
- - com.sleepycat.persist.model.EntityModel
  - - com.sleepycat.persist.model.AnnotationModel

-     public class AnnotationModel
      extends EntityModel

  The default annotation-based entity model. An `AnnotationModel` is based on annotations that are specified for entity classes and their key fields.

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

  The set of persistent classes in the annotation model is the set of all classes with the `Persistent` or `Entity` annotation.

  The annotations used to define persistent classes are: `Entity`, `Persistent`, `PrimaryKey`, `SecondaryKey` and `KeyField`. A good starting point is `Entity`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AnnotationModel()` Constructs a model for annotated entity classes.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ClassMetadata` | `getClassMetadata(java.lang.String className)` Returns the metadata for a given persistent class name, including proxy classes and entity classes.
    `EntityMetadata` | `getEntityMetadata(java.lang.String className)` Returns the metadata for a given entity class name.
    `java.util.Set<java.lang.String>` | `getKnownClasses()` Returns the names of all known persistent classes.
    `java.util.Set<java.lang.String>` | `getKnownSpecialClasses()` Returns the names of all known persistent enum and array classes that may be used to store persistent data.

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

      `classForName, convertRawObject, getAllRawTypes, getAllRawTypeVersions, getRawType, getRawTypeVersion, isOpen, registerClass, resolveClass, setCatalog`

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

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

- - ### Constructor Detail

    - #### AnnotationModel

          public AnnotationModel()

      Constructs a model for annotated entity classes.

  - ### Method Detail

    - #### getKnownClasses

          public java.util.Set<java.lang.String> getKnownClasses()

      Description copied from class: `EntityModel`
      Returns the names of all known persistent classes. A type becomes known when an instance of the type is stored for the first time or metadata or type information is queried for a specific class name.
      Specified by:
        `getKnownClasses` in class `EntityModel`
      Returns:
        an unmodifiable set of class names.

    - #### getKnownSpecialClasses

          public java.util.Set<java.lang.String> getKnownSpecialClasses()

      Description copied from class: `EntityModel`
      Returns the names of all known persistent enum and array classes that may be used to store persistent data. This differs from `EntityModel.getKnownClasses()`, which does not return enum and array classes because they have no metadata.
      Overrides:
        `getKnownSpecialClasses` in class `EntityModel`
      Returns:
        an unmodifiable set of enum and array class names.

    - #### getEntityMetadata

          public EntityMetadata getEntityMetadata(java.lang.String className)

      Description copied from class: `EntityModel`
      Returns the metadata for a given entity class name.
      Specified by:
        `getEntityMetadata` in class `EntityModel`
      Parameters:
        `className` - the class name.
      Returns:
        the metadata or null if the class is not an entity class or does not exist.

    - #### getClassMetadata

          public ClassMetadata getClassMetadata(java.lang.String className)

      Description copied from class: `EntityModel`
      Returns the metadata for a given persistent class name, including proxy classes and entity classes.
      Specified by:
        `getClassMetadata` in class `EntityModel`
      Parameters:
        `className` - the class name.
      Returns:
        the metadata or null if the class is not persistent or does not exist.

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