Berkeley DB
version 5.3.28

com.sleepycat.persist.model
Class AnnotationModel

java.lang.Object
  extended by com.sleepycat.persist.model.EntityModel
      extended by 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
AnnotationModel()
          Constructs a model for annotated entity classes.
 
Method Summary
 ClassMetadata getClassMetadata(String className)
          Returns the metadata for a given persistent class name, including proxy classes and entity classes.
 EntityMetadata getEntityMetadata(String className)
          Returns the metadata for a given entity class name.
 Set<String> getKnownClasses()
          Returns the names of all known persistent classes.
 Set<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 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.

Berkeley DB
version 5.3.28

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