public class AnnotationModel extends EntityModel
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 | Description |
---|---|
AnnotationModel() |
Constructs a model for annotated entity classes.
|
Modifier and Type | Method | 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.
|
classForName, convertRawObject, getAllRawTypes, getAllRawTypeVersions, getRawType, getRawTypeVersion, isOpen, registerClass, resolveClass, setCatalog
public AnnotationModel()
public java.util.Set<java.lang.String> getKnownClasses()
EntityModel
getKnownClasses
in class EntityModel
public java.util.Set<java.lang.String> getKnownSpecialClasses()
EntityModel
EntityModel.getKnownClasses()
, which does not return enum and array classes
because they have no metadata.getKnownSpecialClasses
in class EntityModel
public EntityMetadata getEntityMetadata(java.lang.String className)
EntityModel
getEntityMetadata
in class EntityModel
className
- the class name.public ClassMetadata getClassMetadata(java.lang.String className)
EntityModel
getClassMetadata
in class EntityModel
className
- the class name.Copyright (c) 1996, 2020 Oracle and/or its affiliates. All rights reserved.