|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.openjpa.persistence.AnnotationPersistenceMetaDataParser
public class AnnotationPersistenceMetaDataParser
Persistence annotation metadata parser. Currently does not parse deployment descriptors.
Nested Class Summary | |
---|---|
(package private) static class |
AnnotationPersistenceMetaDataParser.FetchAttributeImpl
An internal class used to mimic the FetchAttribute annotation. |
(package private) static class |
AnnotationPersistenceMetaDataParser.FetchGroupImpl
An internal class used to mimic the FetchGroup annotation. |
Field Summary | |
---|---|
protected Class<?> |
_cls
|
protected Stack<Class<?>> |
_stack
|
Fields inherited from interface org.apache.openjpa.meta.MetaDataModes |
---|
MODE_ALL, MODE_ANN_MAPPING, MODE_MAPPING, MODE_MAPPING_INIT, MODE_META, MODE_NONE, MODE_QUERY |
Constructor Summary | |
---|---|
AnnotationPersistenceMetaDataParser(OpenJPAConfiguration conf)
Constructor; supply configuration. |
Method Summary | |
---|---|
void |
clear()
Clear caches. |
OpenJPAConfiguration |
getConfiguration()
Configuration supplied on construction. |
ClassLoader |
getEnvClassLoader()
Return the environmental class loader to pass on to parsed metadata instances. |
Log |
getLog()
Metadata log. |
boolean |
getMappingOverride()
Whether to allow later parses of mapping information to override earlier information for the same class. |
int |
getMode()
The parse mode. |
MetaDataRepository |
getRepository()
Returns the repository for this parser. |
protected File |
getSourceFile()
Determine the source file we're parsing. |
protected boolean |
handleUnknownClassAnnotation(ClassMetaData meta,
Annotation anno)
Allow subclasses to handle unknown annotations. |
protected boolean |
handleUnknownMemberAnnotation(FieldMetaData fmd,
Annotation anno)
Allow subclasses to handle unknown annotations. |
protected boolean |
handleUnknownPackageAnnotation(Package pkg,
Annotation anno)
Allow subclasses to handle unknown annotations. |
protected boolean |
isMappingMode()
Convenience method for interpreting getMode() . |
protected boolean |
isMappingOverrideMode()
Returns true if we're in mapping mode or in metadata mode with mapping overide enabled. |
protected boolean |
isMetaDataMode()
Convenience method for interpreting getMode() . |
protected boolean |
isQueryMode()
Convenience method for interpreting getMode() . |
protected String |
normalizeCatalogName(String catName)
|
protected String |
normalizeSchemaName(String schName)
|
protected String |
normalizeSequenceName(String seqName)
|
void |
parse(Class<?> cls)
Parse persistence metadata for the given class. |
static Collection<LifecycleCallbacks>[] |
parseCallbackMethods(Class<?> cls,
Collection<LifecycleCallbacks>[] callbacks,
boolean sups,
boolean listener,
MetaDataRepository repos)
Parse callback methods into the given array, and return that array, creating one if null. |
protected void |
parseClassMappingAnnotations(ClassMetaData meta)
Parse class mapping annotations. |
(package private) static void |
parseDataCache(ClassMetaData meta,
boolean enabled,
String name,
int timeout)
|
(package private) static void |
parseDataStoreId(ClassMetaData meta,
GenerationType strategy,
String generator)
|
(package private) static void |
parseFetchGroups(ClassMetaData meta,
AnnotationPersistenceMetaDataParser.FetchGroupImpl... groups)
Parse fetch group input for the FetchGroup and FetchGroups annotations as well as for the fetch-group and fetch-groups XML metadata |
(package private) static void |
parseFetchGroups(ClassMetaData meta,
FetchGroup... groups)
Create fetch groups. |
(package private) static void |
parseGeneratedValue(FieldMetaData fmd,
GenerationType strategy,
String generator)
Sets value generation information for the given field. |
protected void |
parseLobMapping(FieldMetaData fmd)
Setup the field as a LOB mapping. |
protected void |
parseMemberMappingAnnotations(FieldMetaData fmd)
Parse member mapping components. |
protected void |
parsePackageMappingAnnotations(Package pkg)
Parse package mapping annotations. |
void |
setEnvClassLoader(ClassLoader loader)
Set the environmental class loader to pass on to parsed metadata instances. |
void |
setMappingOverride(boolean override)
Whether to allow later parses of mapping information to override earlier information for the same class. |
void |
setMode(int mode)
The parse mode. |
void |
setMode(int mode,
boolean on)
The parse mode. |
void |
setRepository(MetaDataRepository repos)
Set the metadata repository for this parser. |
static Class<?> |
toOverrideType(Class<?> cls)
Convert the given class to its OpenJPA type override equivalent. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Class<?> _cls
protected Stack<Class<?>> _stack
Constructor Detail |
---|
public AnnotationPersistenceMetaDataParser(OpenJPAConfiguration conf)
Method Detail |
---|
public OpenJPAConfiguration getConfiguration()
public Log getLog()
public MetaDataRepository getRepository()
public void setRepository(MetaDataRepository repos)
public ClassLoader getEnvClassLoader()
public void setEnvClassLoader(ClassLoader loader)
public boolean getMappingOverride()
public void setMappingOverride(boolean override)
public int getMode()
public void setMode(int mode, boolean on)
public void setMode(int mode)
protected boolean isMetaDataMode()
getMode()
.
protected boolean isQueryMode()
getMode()
.
protected boolean isMappingMode()
getMode()
.
protected boolean isMappingOverrideMode()
public void clear()
public void parse(Class<?> cls)
protected void parsePackageMappingAnnotations(Package pkg)
protected boolean handleUnknownPackageAnnotation(Package pkg, Annotation anno)
protected void parseClassMappingAnnotations(ClassMetaData meta)
protected boolean handleUnknownClassAnnotation(ClassMetaData meta, Annotation anno)
protected File getSourceFile()
static void parseDataStoreId(ClassMetaData meta, GenerationType strategy, String generator)
static void parseDataCache(ClassMetaData meta, boolean enabled, String name, int timeout)
public static Collection<LifecycleCallbacks>[] parseCallbackMethods(Class<?> cls, Collection<LifecycleCallbacks>[] callbacks, boolean sups, boolean listener, MetaDataRepository repos)
sups
- whether to scan superclasseslistener
- whether this is a listener or notstatic void parseFetchGroups(ClassMetaData meta, FetchGroup... groups)
#parseFetchAttribute(ClassMetaData,
org.apache.openjpa.meta.FetchGroup, FetchAttribute)
only after the
bi-links have been established, because a field f will not only add the
fetch group A which explicitly includes f to its custom fetch groups but
also will also add any fetch group B that includes A.
static void parseFetchGroups(ClassMetaData meta, AnnotationPersistenceMetaDataParser.FetchGroupImpl... groups)
meta
- groups
- protected void parseMemberMappingAnnotations(FieldMetaData fmd)
protected boolean handleUnknownMemberAnnotation(FieldMetaData fmd, Annotation anno)
public static Class<?> toOverrideType(Class<?> cls)
static void parseGeneratedValue(FieldMetaData fmd, GenerationType strategy, String generator)
protected void parseLobMapping(FieldMetaData fmd)
protected String normalizeSequenceName(String seqName)
protected String normalizeSchemaName(String schName)
protected String normalizeCatalogName(String catName)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |