Package com.sleepycat.persist.model
Class AnnotationModel
java.lang.Object
com.sleepycat.persist.model.EntityModel
com.sleepycat.persist.model.AnnotationModel
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 -
Method Summary
Modifier and TypeMethodDescriptiongetClassMetadata(String className) Returns the metadata for a given persistent class name, including proxy classes and entity classes.getEntityMetadata(String className) Returns the metadata for a given entity class name.Returns the names of all known persistent classes.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
-
Constructor Details
-
AnnotationModel
public AnnotationModel()Constructs a model for annotated entity classes.
-
-
Method Details
-
getKnownClasses
Description copied from class:EntityModelReturns 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:
getKnownClassesin classEntityModel- Returns:
- an unmodifiable set of class names.
-
getKnownSpecialClasses
Description copied from class:EntityModelReturns the names of all known persistent enum and array classes that may be used to store persistent data. This differs fromEntityModel.getKnownClasses(), which does not return enum and array classes because they have no metadata.- Overrides:
getKnownSpecialClassesin classEntityModel- Returns:
- an unmodifiable set of enum and array class names.
-
getEntityMetadata
Description copied from class:EntityModelReturns the metadata for a given entity class name.- Specified by:
getEntityMetadatain classEntityModel- Returns:
- the metadata or null if the class is not an entity class or does not exist.
-
getClassMetadata
Description copied from class:EntityModelReturns the metadata for a given persistent class name, including proxy classes and entity classes.- Specified by:
getClassMetadatain classEntityModel- Returns:
- the metadata or null if the class is not persistent or does not exist.
-