Class MetadataProcessor
- java.lang.Object
-
- org.eclipse.persistence.internal.jpa.metadata.MetadataProcessor
-
public class MetadataProcessor extends java.lang.ObjectINTERNAL: The object/relational metadata processor for the EJB3.0 specification.- Since:
- TopLink EJB 3.0 Reference Implementation
- Author:
- Guy Pelletier
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Set<MetadataProcessor>m_compositeMemberProcessorsprotected MetadataProcessorm_compositeProcessorprotected MetadataFactorym_factoryprotected java.lang.ClassLoaderm_loaderprotected MetadataSourcem_metadataSourceprotected java.util.Mapm_predeployPropertiesprotected MetadataProjectm_projectprotected org.eclipse.persistence.internal.sessions.AbstractSessionm_session
-
Constructor Summary
Constructors Constructor Description MetadataProcessor()INTERNAL: Empty processor to be used as a composite processor.MetadataProcessor(javax.persistence.spi.PersistenceUnitInfo puInfo, org.eclipse.persistence.internal.sessions.AbstractSession session, java.lang.ClassLoader loader, boolean weaveLazy, boolean weaveEager, boolean weaveFetchGroups, boolean multitenantSharedEmf, boolean multitenantSharedCache, java.util.Map predeployProperties, MetadataProcessor compositeProcessor)INTERNAL: Called from EntityManagerSetupImpl.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCompositeMemberProcessor(MetadataProcessor compositeMemberProcessor)INTERNAL: Add containedProcessor to compositeProcessor.voidaddEntityListeners()INTERNAL: Method to place EntityListener's on the descriptors from the given session.voidaddNamedQueries()INTERNAL: Method to place NamedQueries and NamedNativeQueries on the given session.voidaddStructConverterNames()INTERNAL: Adds a list of StructConverter string names that were defined in the metadata of this project to the native EclipseLink project.voidcreateDynamicClasses()INTERNAL: During EntityManagerSetup deploy, using the real class loader we must create our dynamic classes.voidcreateRestInterfaces()MetadataProcessorgetCompositeProcessor()INTERNAL: Return compositeProcessor.MetadataFactorygetMetadataFactory()INTERNAL:MetadataSourcegetMetadataSource()INTERNAL:java.util.Set<MetadataProject>getPearProjects(MetadataProject project)INTERNAL: Returns projects owned by compositeProcessor minus the passed project.java.util.Set<java.lang.String>getPersistenceUnitClassSetFromMappingFiles()INTERNAL: Return a set of class names for each entity, embeddable and mapped superclass found in the mapping files to be processed by the MetadataProcessor.MetadataProjectgetProject()INTERNAL:protected org.eclipse.persistence.logging.SessionLoggetSessionLog()INTERNAL: Return the SessionLog from the Session.protected voidhandleORMException(java.lang.RuntimeException e, java.lang.String mappingFile, boolean throwException)INTERNAL: Handle an exception that occurred while processing ORM xml.protected voidinitPersistenceUnitClasses()INTERNAL: This method is responsible for discovering all the entity classes for this PU and adding corresponding MetadataDescriptor in the MetadataProject.voidloadMappingFiles(boolean throwExceptionOnFail)INTERNAL: This method is responsible for figuring out list of mapping files to read into XMLEntityMappings objects and store on the project.protected voidloadSpecifiedMappingFiles(boolean throwExceptionOnFail)INTERNAL:protected voidloadStandardMappingFiles(java.lang.String ormXMLFile)INTERNAL:voidprocessCustomizers()INTERNAL: Process the customizer for those entities and embeddables that have one defined.voidprocessEntityMappings(PersistenceUnitProcessor.Mode mode)INTERNAL: Performs the initialization of the persistence unit classes and then processes the xml metadata.voidprocessORMMetadata(PersistenceUnitProcessor.Mode mode)INTERNAL: Process the ORM metadata on this processors metadata project (representing a single persistence-unit)voidsetClassLoader(java.lang.ClassLoader loader)INTERNAL: Use this method to set the correct class loader that should be used during processing.voidsetMetadataSource(MetadataSource source)INTERNAL: Use this method to set the MetadataSource class to use for loading extensible mappings
-
-
-
Field Detail
-
m_loader
protected java.lang.ClassLoader m_loader
-
m_factory
protected MetadataFactory m_factory
-
m_project
protected MetadataProject m_project
-
m_session
protected org.eclipse.persistence.internal.sessions.AbstractSession m_session
-
m_predeployProperties
protected java.util.Map m_predeployProperties
-
m_compositeProcessor
protected MetadataProcessor m_compositeProcessor
-
m_compositeMemberProcessors
protected java.util.Set<MetadataProcessor> m_compositeMemberProcessors
-
m_metadataSource
protected MetadataSource m_metadataSource
-
-
Constructor Detail
-
MetadataProcessor
public MetadataProcessor()
INTERNAL: Empty processor to be used as a composite processor.
-
MetadataProcessor
public MetadataProcessor(javax.persistence.spi.PersistenceUnitInfo puInfo, org.eclipse.persistence.internal.sessions.AbstractSession session, java.lang.ClassLoader loader, boolean weaveLazy, boolean weaveEager, boolean weaveFetchGroups, boolean multitenantSharedEmf, boolean multitenantSharedCache, java.util.Map predeployProperties, MetadataProcessor compositeProcessor)INTERNAL: Called from EntityManagerSetupImpl. The 'real' EJB 3.0 processing that includes XML and annotations.
-
-
Method Detail
-
addCompositeMemberProcessor
public void addCompositeMemberProcessor(MetadataProcessor compositeMemberProcessor)
INTERNAL: Add containedProcessor to compositeProcessor.
-
addEntityListeners
public void addEntityListeners()
INTERNAL: Method to place EntityListener's on the descriptors from the given session. This call is made from the EntityManagerSetup deploy call.
-
addNamedQueries
public void addNamedQueries()
INTERNAL: Method to place NamedQueries and NamedNativeQueries on the given session. This call is made from the EntityManagerSetup deploy call.
-
createDynamicClasses
public void createDynamicClasses()
INTERNAL: During EntityManagerSetup deploy, using the real class loader we must create our dynamic classes.
-
createRestInterfaces
public void createRestInterfaces()
-
getCompositeProcessor
public MetadataProcessor getCompositeProcessor()
INTERNAL: Return compositeProcessor.
-
getMetadataFactory
public MetadataFactory getMetadataFactory()
INTERNAL:
-
getMetadataSource
public MetadataSource getMetadataSource()
INTERNAL:
-
getPearProjects
public java.util.Set<MetadataProject> getPearProjects(MetadataProject project)
INTERNAL: Returns projects owned by compositeProcessor minus the passed project.
-
getPersistenceUnitClassSetFromMappingFiles
public java.util.Set<java.lang.String> getPersistenceUnitClassSetFromMappingFiles()
INTERNAL: Return a set of class names for each entity, embeddable and mapped superclass found in the mapping files to be processed by the MetadataProcessor.
-
getProject
public MetadataProject getProject()
INTERNAL:
-
addStructConverterNames
public void addStructConverterNames()
INTERNAL: Adds a list of StructConverter string names that were defined in the metadata of this project to the native EclipseLink project. These StructConverters can be added to the Project to be processed later
-
handleORMException
protected void handleORMException(java.lang.RuntimeException e, java.lang.String mappingFile, boolean throwException)INTERNAL: Handle an exception that occurred while processing ORM xml.
-
initPersistenceUnitClasses
protected void initPersistenceUnitClasses()
INTERNAL: This method is responsible for discovering all the entity classes for this PU and adding corresponding MetadataDescriptor in the MetadataProject. This method will also gather all the weavable classes for this PU. Currently, entity and embeddable classes are weavable. NOTE: The order of processing should not be changed as the steps are dependent on one another.
-
loadMappingFiles
public void loadMappingFiles(boolean throwExceptionOnFail)
INTERNAL: This method is responsible for figuring out list of mapping files to read into XMLEntityMappings objects and store on the project. Note, the order the files are discovered and read is very important so do not change the order of invocation.
-
loadSpecifiedMappingFiles
protected void loadSpecifiedMappingFiles(boolean throwExceptionOnFail)
INTERNAL:
-
loadStandardMappingFiles
protected void loadStandardMappingFiles(java.lang.String ormXMLFile)
INTERNAL:
-
getSessionLog
protected org.eclipse.persistence.logging.SessionLog getSessionLog()
INTERNAL: Return the SessionLog from the Session. If the session is null, return the AbstractSessionLog's SessionLog.- Returns:
- SessionLog
-
processCustomizers
public void processCustomizers()
INTERNAL: Process the customizer for those entities and embeddables that have one defined. This must be the last thing called on this processor before cleanup.
-
processEntityMappings
public void processEntityMappings(PersistenceUnitProcessor.Mode mode)
INTERNAL: Performs the initialization of the persistence unit classes and then processes the xml metadata. Note: Do not change the order of invocation of various methods.
-
processORMMetadata
public void processORMMetadata(PersistenceUnitProcessor.Mode mode)
INTERNAL: Process the ORM metadata on this processors metadata project (representing a single persistence-unit)
-
setClassLoader
public void setClassLoader(java.lang.ClassLoader loader)
INTERNAL: Use this method to set the correct class loader that should be used during processing. Currently, the class loader should only change once, from preDeploy to deploy.
-
setMetadataSource
public void setMetadataSource(MetadataSource source)
INTERNAL: Use this method to set the MetadataSource class to use for loading extensible mappings
-
-