|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.datanucleus.metadata.MetaDataManager
public abstract class MetaDataManager
Manager of metadata information in DataNucleus having scope of an NucleusContext. Each PMF/EMF will effectively have a single MetaDataManager handling all XML/Annotations metadata.
Metadata can be loaded into the MetaDataManager in two ways
Acts as a registry of metadata so that metadata files don't need to be parsed multiple times. MetaData is stored as a FileMetaData, which contains PackageMetaData, which contains ClassMetaData, and so on. This maps exactly to the users model of their metadata. The users access point is getMetaDataForClass() which will check the known classes without metadata, then check the existing registered metdata, then check the valid locations for metdata files. This way, the metadata is managed from this single point.
Maintains a list of all classes that have been checked for MetaData and don't have any available. This avoids the needs to look up MetaData multiple times finding the same result. Currently this list is for all ClassMetaData objects keyed by the class name.
Users can register interest in knowing when metadata for classes are loaded by registering a listener using the addListener method. This will then notify the listener when metadata for any class is initialised. This provides the opportunity to reject the metadata where particular features are not supported. For example a StoreManager could register a listener where it doesn't support datastore identity and throw an InvalidMetaDataException. This would then filter back out to the user for the operation they invoked
Field Summary | |
---|---|
protected boolean |
allowAnnotations
Whether we allow annotations metadata. |
protected boolean |
allowMetaDataLoad
Flag defining if we allow metadata load currently. |
protected boolean |
allowORM
Whether we allow ORM XML metadata. |
protected boolean |
allowXML
Whether we allow XML metadata. |
protected AnnotationManager |
annotationManager
Manager for annotations. |
protected Collection<String> |
classesWithoutPersistenceInfo
Cache of class names that are known to not have MetaData/annotations. |
protected MultiMap |
classMetaDataByAppIdClassName
Map of class metadata, keyed by the application-id object-id class name (not SingleField). |
protected Map<String,AbstractClassMetaData> |
classMetaDataByClass
Map of ClassMetaData, keyed by the class name. |
protected Map<String,AbstractClassMetaData> |
classMetaDataByDiscriminatorName
Map of ClassMetaData, keyed by the class discriminator name. |
protected Map<String,AbstractClassMetaData> |
classMetaDataByEntityName
Map of ClassMetaData, keyed by the JPA "entity name". |
protected Map<String,Set<String>> |
directSubclassesByClass
Cache subclass information as that is expensive to compute, keyed by class name |
protected Map<String,org.datanucleus.metadata.MetaDataManager.DiscriminatorLookup> |
discriminatorLookupByRootClassName
|
protected Map<String,FetchPlanMetaData> |
fetchPlanMetaDataByName
Map of FetchPlanMetaData, keyed by the fetch plan name. |
protected Map<String,FileMetaData> |
fileMetaDataByURLString
Map of FileMetaData for the parsed files, keyed by the URL string. |
protected Set<MetaDataListener> |
listeners
Listeners for metadata load. |
protected List<AbstractClassMetaData> |
loadedMetaData
Temporary list of class metadata loaded during the current call. |
protected static Localiser |
LOCALISER
Localiser for messages. |
protected MetaDataParser |
metaDataParser
Parser for MetaData. |
protected NucleusContext |
nucleusContext
The NucleusContext that this metadata manager is operating in. |
protected Map<String,QueryMetaData> |
queryMetaDataByName
Map of QueryMetaData, keyed by the (class name + query name). |
protected Map<String,QueryResultMetaData> |
queryResultMetaDataByName
Map of QueryResultMetaData keyed by the name. |
protected Map<String,SequenceMetaData> |
sequenceMetaDataByPackageSequence
Map of SequenceMetaData, keyed by the package name and sequence name. |
protected Map<String,StoredProcQueryMetaData> |
storedProcQueryMetaDataByName
Map of StoredProcQueryMetaData, keyed by the (class name + query name). |
protected boolean |
supportXMLNamespaces
Flag whether we should be (XML) namespace aware when parsing. |
protected Map<String,TableGeneratorMetaData> |
tableGeneratorMetaDataByPackageSequence
Map of TableGeneratorMetaData, keyed by the package name and generator name. |
protected int |
userMetaDataNumber
Number of user metadata items. |
protected ArrayList<FileMetaData> |
utilisedFileMetaData
Temporary list of the FileMetaData objects utilised in this call for metadata. |
protected boolean |
validateXML
Flag whether we should validate the (XML) metadata files when parsing. |
Constructor Summary | |
---|---|
MetaDataManager(NucleusContext ctx)
Constructor, specifying the context used. |
Method Summary | |
---|---|
protected void |
addORMDataToClass(Class c,
ClassLoaderResolver clr)
Load up and add any O/R mapping info for the specified class to the stored ClassMetaData (if supported). |
void |
close()
Clear resources |
void |
deregisterListener(MetaDataListener listener)
Method to deregister a listener from being notified when metadata for a class/interface is initialised. |
boolean |
getAllowMetaDataLoad()
|
AnnotationManager |
getAnnotationManager()
|
ApiAdapter |
getApiAdapter()
Accessor for the API adapter being used by this MetaDataManager. |
String[] |
getClassesImplementingInterface(String interfaceName,
ClassLoaderResolver clr)
Accessor for the list of names of classes that are declared to implement the specified interface (using <implements> in the MetaData). |
Collection<String> |
getClassesWithMetaData()
Accessor for the names of the classes with MetaData currently registered with this manager. |
ClassMetaData |
getClassMetaDataForImplementationOfPersistentInterface(String interfaceName)
Accessor for the metadata for the implementation of the specified "persistent-interface". |
Collection<AbstractClassMetaData> |
getClassMetaDataWithApplicationId(String objectIdClassName)
Accessor for the metadata for the class(es) with the specified object-id class name as PK. |
String |
getClassNameForDiscriminatorValueWithRoot(AbstractClassMetaData rootCmd,
String discrimValue)
|
String |
getDiscriminatorValueForClass(AbstractClassMetaData cmd,
String discrimValue)
|
FileMetaData[] |
getFileMetaData()
Accessor for all FileMetaData currently managed here. |
String |
getImplementationNameForPersistentInterface(String interfaceName)
Accessor for the implementation name for the specified "persistent-interface". |
AbstractClassMetaData |
getMetaDataForClass(Class c,
ClassLoaderResolver clr)
Main accessor for the MetaData for a class. |
AbstractClassMetaData |
getMetaDataForClass(String className,
ClassLoaderResolver clr)
Accessor for the MetaData for a class given the name and a loader. |
abstract AbstractClassMetaData |
getMetaDataForClassInternal(Class c,
ClassLoaderResolver clr)
Internal convenience method for accessing the MetaData for a class. |
AbstractClassMetaData |
getMetaDataForDiscriminator(String discriminator)
Accessor for the MetaData for a class given the "discriminator". |
AbstractClassMetaData |
getMetaDataForEntityName(String entityName)
Accessor for the MetaData for a class given the "entity-name". |
FetchPlanMetaData |
getMetaDataForFetchPlan(String name)
Accessor for the MetaData for a named fetch plan. |
ClassMetaData |
getMetaDataForImplementationOfReference(Class referenceClass,
Object implValue,
ClassLoaderResolver clr)
Accessor for the MetaData for an implementation of a reference type. |
InterfaceMetaData |
getMetaDataForInterface(Class c,
ClassLoaderResolver clr)
Accessor for the MetaData for an interface. |
AbstractMemberMetaData |
getMetaDataForMember(Class c,
ClassLoaderResolver clr,
String memberName)
Accessor for the MetaData for a field/property of a class. |
AbstractMemberMetaData |
getMetaDataForMember(String className,
String memberName,
ClassLoaderResolver clr)
Accessor for the MetaData for a field/property of a class. |
PersistenceUnitMetaData |
getMetaDataForPersistenceUnit(String unitName)
Method to parse all available "persistence.xml" files and return the metadata for the persistence unit with the specified name. |
QueryMetaData |
getMetaDataForQuery(Class cls,
ClassLoaderResolver clr,
String queryName)
Accessor for the MetaData for a named query for a class. |
QueryResultMetaData |
getMetaDataForQueryResult(String name)
Accessor for the MetaData for a QueryResult. |
SequenceMetaData |
getMetaDataForSequence(ClassLoaderResolver clr,
String seqName)
Accessor for the MetaData for a Sequence in a package. |
StoredProcQueryMetaData |
getMetaDataForStoredProcQuery(Class cls,
ClassLoaderResolver clr,
String queryName)
Accessor for the MetaData for a named stored procedure query for a class. |
TableGeneratorMetaData |
getMetaDataForTableGenerator(ClassLoaderResolver clr,
String genName)
Accessor for the MetaData for a TableGenerator in a package. |
Set<String> |
getNamedQueryNames()
|
NucleusContext |
getNucleusContext()
Accessor for the NucleusContext that this manager is running in. |
List<AbstractClassMetaData> |
getReferencedClasses(String[] classNames,
ClassLoaderResolver clr)
Convenience method to get the MetaData for all referenced classes with the passed set of classes as root. |
protected List<AbstractClassMetaData> |
getReferencedClassMetaData(AbstractClassMetaData cmd,
ClassLoaderResolver clr)
Utility to return all ClassMetaData that is referenced from the supplier class. |
protected MetaDataScanner |
getScanner(ClassLoaderResolver clr)
Accessor for any scanner for metadata classes (optional). |
String[] |
getSubclassesForClass(String className,
boolean includeDescendents)
Accessor for the subclasses of a particular class |
boolean |
hasMetaDataForClass(String className)
Convenience method to check if we have metadata present for the specified class. |
protected void |
initialiseAbstractClassMetaData(AbstractClassMetaData acmd,
ClassLoaderResolver clr)
Convenience method to initialise the MetaData for the specified class/interface. |
protected void |
initialiseClassMetaData(ClassMetaData cmd,
Class cls,
ClassLoaderResolver clr)
Utility to initialise the MetaData for a class, using the specified class. |
protected void |
initialiseFileMetaData(FileMetaData filemd,
ClassLoaderResolver clr,
ClassLoader primary)
Initialise all classes/interfaces in a Meta-Data file. |
protected void |
initialiseFileMetaDataForUse(Collection fileMetaData,
ClassLoaderResolver clr)
Method to initialise the provided FileMetaData, ready for use. |
protected void |
initialiseInterfaceMetaData(InterfaceMetaData imd,
ClassLoaderResolver clr,
ClassLoader primary)
Utility to initialise the MetaData for a interface, using the specified class. |
boolean |
isAllowAnnotations()
|
boolean |
isAllowXML()
|
boolean |
isClassPersistable(String className)
Convenience method to return if the specified class is a known persistable class. |
protected boolean |
isClassWithoutPersistenceInfo(String className)
Accessor for whether a class doesn't have MetaData or annotations. |
boolean |
isEnhancing()
Accessor for whether we are managing the enhancement process. |
boolean |
isFieldTypePersistable(Class type)
Utility to return if this field is persistable. |
boolean |
isPersistentDefinitionImplementation(String implName)
Convenience method to return if the passed class name is an implementation of a "persistent definition". |
boolean |
isPersistentInterface(String name)
Convenience method to return if the passed class name is a "persistent-interface". |
boolean |
isPersistentInterfaceImplementation(String interfaceName,
String implName)
Convenience method to return if the passed class name is an implementation of the passed "persistent-interface". |
protected FileMetaData |
loadAnnotationsForClass(Class cls,
ClassLoaderResolver clr,
boolean register,
boolean populate)
Method to load the annotations for the specified class and return the FileMetaData containing the class. |
FileMetaData[] |
loadClasses(String[] classNames,
ClassLoader loader)
Method to load up all metadata for the specified classes. |
Collection<FileMetaData> |
loadFiles(String[] metadataFiles,
ClassLoaderResolver clr)
Method to load the metadata from the specified files. |
FileMetaData[] |
loadJar(String jarFileName,
ClassLoader loader)
Initialisation method to load the metadata provided by the specified jar. |
FileMetaData[] |
loadMetadataFiles(String[] metadataFiles,
ClassLoader loader)
Method to load up all metadata defined by the specified metadata files. |
FileMetaData[] |
loadPersistenceUnit(PersistenceUnitMetaData pumd,
ClassLoader loader)
Initialisation method to to load all class metadata defined by the "persistence-unit". |
void |
loadUserMetaData(FileMetaData fileMetaData,
ClassLoader loader)
Method to load user-provided metadata. |
protected abstract FileMetaData |
parseFile(URL file_url)
Utility to parse an XML metadata file. |
protected void |
populateAbstractClassMetaData(AbstractClassMetaData acmd,
ClassLoaderResolver clr,
ClassLoader loader)
Convenience method to populate the MetaData for the specified class/interface. |
protected void |
populateFileMetaData(FileMetaData filemd,
ClassLoaderResolver clr,
ClassLoader primary)
Convenience method to populate all classes/interfaces in a Meta-Data file. |
protected void |
postProcessClassMetaData(AbstractClassMetaData cmd,
ClassLoaderResolver clr)
Method that will perform any necessary post-processing on metadata. |
protected void |
processListenerLoadingCall()
|
AbstractClassMetaData |
readMetaDataForClass(String className)
Method to access the (already known) metadata for the specified class. |
AbstractMemberMetaData |
readMetaDataForMember(String className,
String memberName)
Method to access the (already known) metadata for the field/property of the specified class. |
void |
registerDiscriminatorValueForClass(AbstractClassMetaData cmd,
String discrimValue)
Method to register a discriminator value (when using VALUE_MAP strategy) for the specified class. |
protected void |
registerFetchPlansForFile(FileMetaData filemd)
Convenience method to register all FetchPlans found in the passed file. |
abstract void |
registerFile(String fileURLString,
FileMetaData filemd,
ClassLoaderResolver clr)
Method to take the FileMetaData and register the relevant parts of it with the assorted caches provided. |
void |
registerImplementationOfAbstractClass(ClassMetaData cmd,
Class implClass,
ClassLoaderResolver clr)
Method to register the metadata for an implementation of a persistent abstract class. |
void |
registerListener(MetaDataListener listener)
Method to register a listener to be notified when metadata for a class/interface is initialised. |
protected void |
registerMetaDataForClass(String fullClassName,
AbstractClassMetaData cmd)
Internal method called when we want to register the metadata for a class/interface. |
void |
registerPersistentInterface(InterfaceMetaData imd,
Class implClass,
ClassLoaderResolver clr)
Method to register a persistent interface and its implementation with the MetaData system. |
protected void |
registerQueriesForFile(FileMetaData filemd)
Convenience method to register all queries found in the passed file. |
protected void |
registerQueryResultMetaDataForFile(FileMetaData filemd)
Convenience method to register all table generators found in the passed file. |
protected void |
registerSequencesForFile(FileMetaData filemd)
Convenience method to register all sequences found in the passed file. |
protected void |
registerStoredProcQueriesForFile(FileMetaData filemd)
Convenience method to register all stored proc queries found in the passed file. |
protected void |
registerTableGeneratorsForFile(FileMetaData filemd)
Convenience method to register all table generators found in the passed file. |
void |
setAllowAnnotations(boolean allow)
Method to set if we are allowing annotations metadata. |
void |
setAllowMetaDataLoad(boolean allow)
Method to set if we are allowing any further load of metadata beyond this point |
void |
setAllowXML(boolean allow)
Method to set if we are allowing XML metadata. |
void |
setValidate(boolean validate)
Mutator for whether to validate the MetaData files for XML compliance. |
void |
setXmlNamespaceAware(boolean aware)
Mutator for whether to support XML namespaces. |
boolean |
supportsORM()
Accessor for whether the MetaData manager supports ORM concepts and metadata. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final Localiser LOCALISER
protected final NucleusContext nucleusContext
protected final AnnotationManager annotationManager
protected MetaDataParser metaDataParser
protected boolean validateXML
protected boolean supportXMLNamespaces
protected Collection<String> classesWithoutPersistenceInfo
protected Map<String,FileMetaData> fileMetaDataByURLString
protected Map<String,AbstractClassMetaData> classMetaDataByClass
protected Map<String,AbstractClassMetaData> classMetaDataByEntityName
protected Map<String,AbstractClassMetaData> classMetaDataByDiscriminatorName
protected Map<String,Set<String>> directSubclassesByClass
protected Map<String,QueryMetaData> queryMetaDataByName
protected Map<String,StoredProcQueryMetaData> storedProcQueryMetaDataByName
protected Map<String,FetchPlanMetaData> fetchPlanMetaDataByName
protected Map<String,SequenceMetaData> sequenceMetaDataByPackageSequence
protected Map<String,TableGeneratorMetaData> tableGeneratorMetaDataByPackageSequence
protected Map<String,QueryResultMetaData> queryResultMetaDataByName
protected MultiMap classMetaDataByAppIdClassName
protected Set<MetaDataListener> listeners
protected int userMetaDataNumber
protected boolean allowMetaDataLoad
protected boolean allowXML
protected boolean allowAnnotations
protected boolean allowORM
protected Map<String,org.datanucleus.metadata.MetaDataManager.DiscriminatorLookup> discriminatorLookupByRootClassName
protected ArrayList<FileMetaData> utilisedFileMetaData
protected List<AbstractClassMetaData> loadedMetaData
Constructor Detail |
---|
public MetaDataManager(NucleusContext ctx)
ctx
- context that this metadata manager operates inMethod Detail |
---|
public void close()
public void registerListener(MetaDataListener listener)
listener
- The listenerpublic void deregisterListener(MetaDataListener listener)
listener
- The listenerpublic void setAllowMetaDataLoad(boolean allow)
allow
- Whether to allow itpublic boolean getAllowMetaDataLoad()
public boolean isAllowXML()
public void setAllowXML(boolean allow)
allow
- Whether to allow itpublic boolean isAllowAnnotations()
public void setAllowAnnotations(boolean allow)
allow
- Whether to allow itpublic boolean supportsORM()
public boolean isEnhancing()
public void setValidate(boolean validate)
validate
- Whether to validatepublic void setXmlNamespaceAware(boolean aware)
aware
- Whether to be XML namespace awarepublic NucleusContext getNucleusContext()
public ApiAdapter getApiAdapter()
public AnnotationManager getAnnotationManager()
public FileMetaData[] loadMetadataFiles(String[] metadataFiles, ClassLoader loader)
metadataFiles
- The metadata filesloader
- ClassLoader to use in loading the metadata (if any)
NucleusUserException
- (with nested exceptions) if an error occurs parsing the filespublic FileMetaData[] loadClasses(String[] classNames, ClassLoader loader)
classNames
- The class namesloader
- ClassLoader to use in loading the classes (if any)
NucleusUserException
- (with nested exceptions) if an error occurs parsing the filespublic FileMetaData[] loadJar(String jarFileName, ClassLoader loader)
jarFileName
- Name of the jar fileloader
- ClassLoader to use in loading of the jar (if any)
NucleusUserException
- if an error occurs parsing the jar infopublic FileMetaData[] loadPersistenceUnit(PersistenceUnitMetaData pumd, ClassLoader loader)
pumd
- The MetaData for this "persistence-unit"loader
- ClassLoader to use in loading of the persistence unit (if any)
NucleusUserException
- if an error occurs parsing the persistence-unit infoprotected MetaDataScanner getScanner(ClassLoaderResolver clr)
clr
- The classloader resolver
public void loadUserMetaData(FileMetaData fileMetaData, ClassLoader loader)
fileMetaData
- FileMetaData to register/populate/initialiseloader
- ClassLoader to use in loading the metadata (if any)protected void initialiseFileMetaDataForUse(Collection fileMetaData, ClassLoaderResolver clr)
fileMetaData
- Collection of FileMetaDataclr
- ClassLoader resolver
NucleusUserException
- thrown if an error occurs during the populate/initialise
of the supplied metadata.public Collection<FileMetaData> loadFiles(String[] metadataFiles, ClassLoaderResolver clr)
metadataFiles
- array of MetaData filesclr
- ClassLoader resolver
public boolean isClassPersistable(String className)
className
- Name of the class
public FileMetaData[] getFileMetaData()
public Collection<String> getClassesWithMetaData()
public boolean hasMetaDataForClass(String className)
className
- The name of the class to check
protected boolean isClassWithoutPersistenceInfo(String className)
className
- Name of the class
public Collection<AbstractClassMetaData> getClassMetaDataWithApplicationId(String objectIdClassName)
objectIdClassName
- The object-id class name
public AbstractClassMetaData getMetaDataForClass(String className, ClassLoaderResolver clr)
className
- Name of the class to find MetaData forclr
- ClassLoaderResolver resolver for use in loading the class.
public AbstractClassMetaData getMetaDataForClass(Class c, ClassLoaderResolver clr)
c
- The class to find MetaData forclr
- the ClassLoaderResolver
protected void processListenerLoadingCall()
public AbstractClassMetaData getMetaDataForEntityName(String entityName)
entityName
- The entity name to find MetaData for
public AbstractClassMetaData getMetaDataForDiscriminator(String discriminator)
discriminator
- The discriminator name to find MetaData for
public AbstractClassMetaData readMetaDataForClass(String className)
className
- Name of the class
public AbstractMemberMetaData readMetaDataForMember(String className, String memberName)
className
- Name of the classmemberName
- Name of the field/property
public abstract AbstractClassMetaData getMetaDataForClassInternal(Class c, ClassLoaderResolver clr)
c
- The class to find MetaData for
protected void registerMetaDataForClass(String fullClassName, AbstractClassMetaData cmd)
fullClassName
- Name of the classcmd
- The metadatapublic String[] getSubclassesForClass(String className, boolean includeDescendents)
className
- Name of the class that we want the known subclasses for.includeDescendents
- Whether to include subclasses of subclasses etc
public String[] getClassesImplementingInterface(String interfaceName, ClassLoaderResolver clr)
interfaceName
- Name of the interfaceclr
- The ClassLoaderResolver
protected void addORMDataToClass(Class c, ClassLoaderResolver clr)
c
- The classclr
- ClassLoader resolverpublic ClassMetaData getMetaDataForImplementationOfReference(Class referenceClass, Object implValue, ClassLoaderResolver clr)
referenceClass
- The reference class to find MetaData forimplValue
- Object of an implementation class, to return if possible (null=ignore)clr
- ClassLoader resolver
public AbstractMemberMetaData getMetaDataForMember(String className, String memberName, ClassLoaderResolver clr)
className
- The name of the class owning the field/propertymemberName
- The name of the field to find MetaData forclr
- ClassLoaderResolver resolver for any loading of classes
public AbstractMemberMetaData getMetaDataForMember(Class c, ClassLoaderResolver clr, String memberName)
c
- The class owning the field/propertyclr
- the ClassLoaderResolvermemberName
- The name of the field/property to find MetaData for
public QueryMetaData getMetaDataForQuery(Class cls, ClassLoaderResolver clr, String queryName)
cls
- The class which has the query defined for itclr
- the ClassLoaderResolverqueryName
- Name of the query
public Set<String> getNamedQueryNames()
public StoredProcQueryMetaData getMetaDataForStoredProcQuery(Class cls, ClassLoaderResolver clr, String queryName)
cls
- The class which has the query defined for itclr
- the ClassLoaderResolverqueryName
- Name of the (stored proc) query
public FetchPlanMetaData getMetaDataForFetchPlan(String name)
name
- Name of the fetch plan
public SequenceMetaData getMetaDataForSequence(ClassLoaderResolver clr, String seqName)
clr
- the ClassLoaderResolverseqName
- Name of the package (fully qualified if necessary)
public TableGeneratorMetaData getMetaDataForTableGenerator(ClassLoaderResolver clr, String genName)
clr
- the ClassLoaderResolvergenName
- Name of the package (fully qualified if necessary)
public QueryResultMetaData getMetaDataForQueryResult(String name)
name
- Name of the query result
public InterfaceMetaData getMetaDataForInterface(Class c, ClassLoaderResolver clr)
c
- The interface to find MetaData forclr
- the ClassLoaderResolver
public boolean isPersistentInterface(String name)
name
- Name if the interface
public boolean isPersistentInterfaceImplementation(String interfaceName, String implName)
interfaceName
- Name of the persistent interfaceimplName
- The implementation name
public boolean isPersistentDefinitionImplementation(String implName)
implName
- The implementation name
public String getImplementationNameForPersistentInterface(String interfaceName)
interfaceName
- The name of the persistent interface
public ClassMetaData getClassMetaDataForImplementationOfPersistentInterface(String interfaceName)
interfaceName
- The name of the persistent interface
public void registerPersistentInterface(InterfaceMetaData imd, Class implClass, ClassLoaderResolver clr)
imd
- MetaData for the interfaceimplClass
- The implementation classclr
- ClassLoader Resolver to usepublic void registerImplementationOfAbstractClass(ClassMetaData cmd, Class implClass, ClassLoaderResolver clr)
cmd
- MetaData for the abstract classimplClass
- The implementation classclr
- ClassLoader resolverpublic PersistenceUnitMetaData getMetaDataForPersistenceUnit(String unitName)
unitName
- Name of the persistence-unit
NucleusUserException
- if no "persistence.xml" files are foundprotected abstract FileMetaData parseFile(URL file_url)
file_url
- URL of the file
public abstract void registerFile(String fileURLString, FileMetaData filemd, ClassLoaderResolver clr)
fileURLString
- URL of the metadata filefilemd
- The File MetaDatapublic void registerDiscriminatorValueForClass(AbstractClassMetaData cmd, String discrimValue)
cmd
- Metadata for the classdiscrimValue
- The value to register against this classpublic String getClassNameForDiscriminatorValueWithRoot(AbstractClassMetaData rootCmd, String discrimValue)
public String getDiscriminatorValueForClass(AbstractClassMetaData cmd, String discrimValue)
protected void registerSequencesForFile(FileMetaData filemd)
filemd
- MetaData for the fileprotected void registerTableGeneratorsForFile(FileMetaData filemd)
filemd
- MetaData for the fileprotected void registerQueryResultMetaDataForFile(FileMetaData filemd)
filemd
- MetaData for the fileprotected void registerQueriesForFile(FileMetaData filemd)
filemd
- MetaData for the fileprotected void registerStoredProcQueriesForFile(FileMetaData filemd)
filemd
- MetaData for the fileprotected void registerFetchPlansForFile(FileMetaData filemd)
filemd
- MetaData for the fileprotected void populateFileMetaData(FileMetaData filemd, ClassLoaderResolver clr, ClassLoader primary)
filemd
- The MetaData fileclr
- Class Loader to use in populationprimary
- the primary ClassLoader to use (or null)protected void initialiseFileMetaData(FileMetaData filemd, ClassLoaderResolver clr, ClassLoader primary)
filemd
- the FileMetaDataclr
- ClassLoader resolver to useprimary
- the primary ClassLoader to use (or null)protected void initialiseClassMetaData(ClassMetaData cmd, Class cls, ClassLoaderResolver clr)
cmd
- The classes metadatacls
- The class to use as a basis for initialisationclr
- ClassLoader resolver to use
NucleusUserException
- if the class is not enhancedprotected void initialiseInterfaceMetaData(InterfaceMetaData imd, ClassLoaderResolver clr, ClassLoader primary)
imd
- The interface metadataclr
- The loader of the interfaceprimary
- the primary ClassLoader to use (or null)protected FileMetaData loadAnnotationsForClass(Class cls, ClassLoaderResolver clr, boolean register, boolean populate)
cls
- The classclr
- ClassLoader resolverregister
- Whether to register the datapopulate
- Whether to populate the data
protected void postProcessClassMetaData(AbstractClassMetaData cmd, ClassLoaderResolver clr)
cmd
- Metadata for the classclr
- ClassLoader resolverprotected void populateAbstractClassMetaData(AbstractClassMetaData acmd, ClassLoaderResolver clr, ClassLoader loader)
acmd
- MetaDataclr
- ClassLoader resolverloader
- The primary class loaderprotected void initialiseAbstractClassMetaData(AbstractClassMetaData acmd, ClassLoaderResolver clr)
acmd
- MetaDataclr
- ClassLoaderResolverpublic List<AbstractClassMetaData> getReferencedClasses(String[] classNames, ClassLoaderResolver clr)
classNames
- Names of the root classesclr
- ClassLoader resolver
NoPersistenceInformationException
- thrown when one of the classes has no metadata.protected List<AbstractClassMetaData> getReferencedClassMetaData(AbstractClassMetaData cmd, ClassLoaderResolver clr)
cmd
- The origin class's MetaData.clr
- ClassLoaderResolver resolver for loading any classes.
public boolean isFieldTypePersistable(Class type)
type
- Type of the field (for when "type" is not yet set)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |