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 Details

    • AnnotationModel

      public AnnotationModel()
      Constructs a model for annotated entity classes.
  • Method Details

    • getKnownClasses

      public Set<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 Set<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(String className)
      Description copied from class: EntityModel
      Returns the metadata for a given entity class name.
      Specified by:
      getEntityMetadata in class EntityModel
      Returns:
      the metadata or null if the class is not an entity class or does not exist.
    • getClassMetadata

      public ClassMetadata getClassMetadata(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
      Returns:
      the metadata or null if the class is not persistent or does not exist.