Java Doc for MetaDataManager.java in  » Database-ORM » JPOX » org » jpox » metadata » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database ORM » JPOX » org.jpox.metadata 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.jpox.metadata.MetaDataManager

All known Subclasses:   org.jpox.jdo.metadata.JDOMetaDataManager,
MetaDataManager
abstract public class MetaDataManager (Code)
Manager of MetaData information in JPOX having scope of an ObjectManagerFactory. Each PMF/EMF will effectively have a single MetaDataManager handling all XML/Annotations MetaData.

A MetaDataManager can be "initialised" to start with particular MetaData. This is typically performed when the operation has a "persistence-unit", which defines the classes/jars/mapping-files to use. Alternatively, it can be initialised using a set of classes and mapping-files (for use by SchemaTool and the Enhancer when specifying the files as input).

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.

TODO Update MetaDataManager to be able to share ClassMetaData with other MetaDataManager so we need a central (singleton/static) registry that allows such communication.
version:
   $Revision: 1.170 $


Field Summary
final protected static  LocaliserLOCALISER
     Localiser for messages.
protected  AnnotationManagerannotationManager
     Manager for annotations.
protected  MapclassMetaDataByClass
     Map of ClassMetaData, keyed by the class name.
protected  MapclassMetaDataByEntityName
     Map of ClassMetaData, keyed by the JPA "entity name".
protected  CollectionclassesWithoutPersistenceInfo
     Cache of class names that are known to not have MetaData/annotations.
protected  booleanenhancing
     Indicator for whether this manager is managing the enhancement process, else it's runtime.
protected  MapfetchPlanMetaDataByName
     Map of FetchPlanMetaData, keyed by the fetch plan name.
protected  MapfileMetaDataByURLString
     Map of FileMetaData for the parsed files, keyed by the URL string.
protected  booleaninitialised
     Flag for initialisation state when starting using a "persistence-unit".
protected  Listlisteners
     EventListeners.
protected  MetaDataParsermetaDataParser
     Parser for MetaData.
protected  OMFContextomfContext
     The ObjectManagerFactory Context that this metadata manager is operating in.
protected  MapqueryMetaDataByName
     Map of QueryMetaData, keyed by the (class name + query name).
protected  MapqueryResultMetaDataByName
     Map of QueryResultMetaData keyed by the name.
protected  MapsequenceMetaDataByPackageSequence
     Map of SequenceMetaData, keyed by the package name and sequence name.
protected  booleansupportsORM
     Whether the MetaData manager supports ORM concepts and metadata.
protected  MaptableGeneratorMetaDataByPackageSequence
     Map of TableGeneratorMetaData, keyed by the package name and generator name.
protected  ArrayListutilisedFileMetaData
     Temporary list of the FileMetaData objects utilised in this call for metadata.
protected  booleanvalidateMetaData
     Flag whether we should validate the metadata files when parsing.

Constructor Summary
public  MetaDataManager(OMFContext ctxt)
     Constructor, specifying the OMFContext used.

Method Summary
 voidaddAnnotationsDataToClass(Class c, AbstractClassMetaData cmd, ClassLoaderResolver clr)
     Load up and add any annotations mapping info for the specified class to the stored ClassMetaData.
protected  voidaddORMDataToClass(Class c, ClassLoaderResolver clr)
     Load up and add any O/R mapping info for the specified class to the stored ClassMetaData (if supported).
public  voidclose()
    
public  ApiAdaptergetApiAdapter()
     Accessor for the API adapter being used by this MetaDataManager.
public  ClassMetaDatagetClassMetaDataForImplementationOfPersistentInterface(String interfaceName)
     Accessor for the metadata for the implementation of the specified "persistent-interface".
public  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).
public  CollectiongetClassesWithMetaData()
     Accessor for the names of the classes with MetaData currently registered with this manager.
public  FileMetaData[]getFileMetaData()
     Accessor for all FileMetaData currently managed here.
public  StringgetImplementationNameForPersistentInterface(String interfaceName)
     Accessor for the implementation name for the specified "persistent-interface".
public  ListgetListeners()
    
public  MetaDataFactorygetMetaDataFactory()
     Accessor for a factory for MetaData objects.
public synchronized  AbstractClassMetaDatagetMetaDataForClass(String className, ClassLoaderResolver clr)
     Accessor for the MetaData for a class given the name and a loader. All MetaData returned from this method will be initialised and ready for full use. If the class can't be loaded, null will be returned.
public synchronized  AbstractClassMetaDatagetMetaDataForClass(Class c, ClassLoaderResolver clr)
     Main accessor for the MetaData for a class.
abstract public  AbstractClassMetaDatagetMetaDataForClassInternal(Class c, ClassLoaderResolver clr)
     Internal convenience method for accessing the MetaData for a class.
public synchronized  AbstractClassMetaDatagetMetaDataForEntityName(String entityName)
     Accessor for the MetaData for a class given the "entity-name".
public  FetchPlanMetaDatagetMetaDataForFetchPlan(String name)
     Accessor for the MetaData for a named fetch plan.
public  ClassMetaDatagetMetaDataForImplementationOfReference(Class referenceClass, Object implValue, ClassLoaderResolver clr)
     Accessor for the MetaData for an implementation of a reference type.
public  InterfaceMetaDatagetMetaDataForInterface(Class c, ClassLoaderResolver clr)
     Accessor for the MetaData for an interface.
public  AbstractMemberMetaDatagetMetaDataForMember(String className, String memberName, ClassLoaderResolver clr)
     Accessor for the MetaData for a field/property of a class.
public  AbstractMemberMetaDatagetMetaDataForMember(Class c, ClassLoaderResolver clr, String memberName)
     Accessor for the MetaData for a field/property of a class.
public  PersistenceUnitMetaDatagetMetaDataForPersistenceUnit(String unitName)
     Method to parse all available "persistence.xml" files and return the metadata for the persistence unit with the specified name.
public  QueryMetaDatagetMetaDataForQuery(Class cls, ClassLoaderResolver clr, String queryName)
     Accessor for the MetaData for a named query for a class.
public  QueryResultMetaDatagetMetaDataForQueryResult(String name)
     Accessor for the MetaData for a QueryResult.
public  SequenceMetaDatagetMetaDataForSequence(ClassLoaderResolver clr, String seqName)
     Accessor for the MetaData for a Sequence in a package.
public  TableGeneratorMetaDatagetMetaDataForTableGenerator(ClassLoaderResolver clr, String genName)
     Accessor for the MetaData for a TableGenerator in a package.
public  OMFContextgetOMFContext()
     Accessor for the ObjectManagerFactory Context that this manager is running in.
public  ListgetReferencedClassMetaData(AbstractClassMetaData cmd, String dba_vendor_id, ClassLoaderResolver clr)
     Utility to return all ClassMetaData that is referenced from the supplier class.
Parameters:
  cmd - The origin class's MetaData.
Parameters:
  dba_vendor_id - The Vendor id of the database adapter in use.(Used in handling "views" support)
Parameters:
  clr - ClassLoaderResolver resolver for loading any classes.
public  String[]getSubclassesForClass(String className, boolean includeDescendents)
     Accessor for the subclasses of a particular class
Parameters:
  className - Name of the class that we want the known subclasses for.
Parameters:
  includeDescendents - Whether to include subclasses of subclasses etc Names of the subclasses.
public  booleanhasMetaDataForClass(String className)
     Convenience method to check if we have metadata present for the specified class.
public  FileMetaData[]initialise(String[] metadataFiles, String[] classNames, ClassLoaderResolver clr)
     Initialisation method to define the initial metadata files and class names being handled by this MetaDataManager.
public  FileMetaData[]initialise(String persistenceUnitName, ClassLoaderResolver clr)
     Initialisation method to define the "persistence-unit" being handled by this MetaDataManager.
public  FileMetaData[]initialise(PersistenceUnitMetaData pumd, ClassLoaderResolver clr)
     Initialisation method to define the "persistence-unit" being handled by this MetaDataManager.
protected  voidinitialiseClassMetaData(ClassMetaData cmd, Class cls, ClassLoaderResolver clr)
     Utility to initialise the MetaData for a class, using the specified class.
protected  voidinitialiseFileMetaData(FileMetaData filemd, ClassLoaderResolver clr, ClassLoader primary)
     Initialise all classes/interfaces in a Meta-Data file.
protected  voidinitialiseInterfaceMetaData(InterfaceMetaData imd, ClassLoaderResolver clr, ClassLoader primary)
     Utility to initialise the MetaData for a interface, using the specified class.
public  booleanisClassPersistable(String className)
     Convenience method to return if the specified class is a known persistable class.
protected  booleanisClassWithoutPersistenceInfo(String className)
     Accessor for whether a class doesn't have MetaData or annotations.
public  booleanisEnhancing()
     Accessor for whether we are managing the enhancement process.
public  booleanisPersistentDefinitionImplementation(String implName)
     Convenience method to return if the passed class name is an implementation of a "persistent definition".
public  booleanisPersistentInterface(String name)
     Convenience method to return if the passed class name is a "persistent-interface".
public  booleanisPersistentInterfaceImplementation(String interfaceName, String implName)
     Convenience method to return if the passed class name is an implementation of the passed "persistent-interface".
protected  FileMetaDataloadAnnotationsForClass(Class cls, ClassLoaderResolver clr, boolean register, boolean populate)
     Method to load the annotations for the specified class and return the FileMetaData containing the class.
protected  voidlogConfiguration()
     Method to log the configuration of this manager.
abstract protected  FileMetaDataparseFile(URL file_url)
     Utility to parse a MetaData file.
public  PersistenceFileMetaData[]parsePersistenceFiles()
     Method to parse the available "persistence.xml" files returning the metadata for all found.
protected  voidpopulateFileMetaData(FileMetaData filemd, ClassLoaderResolver clr, ClassLoader primary)
     Convenience method to populate all classes/interfaces in a Meta-Data file.
public  AbstractClassMetaDatareadMetaDataForClass(String className)
     Method to access the (already known) metadata for the specified class.
public  AbstractMemberMetaDatareadMetaDataForMember(String className, String memberName)
     Method to access the (already known) metadata for the field/property of the specified class.
protected  voidregisterFetchPlansForFile(FileMetaData filemd)
     Convenience method to register all FetchPlans found in the passed file.
abstract public  voidregisterFile(String fileURLString, FileMetaData filemd, ClassLoaderResolver clr)
     Method to take the FileMetaData and register the relevant parts of it with the assorted caches provided.
public  voidregisterImplementationOfAbstractClass(ClassMetaData cmd, Class implClass, ClassLoaderResolver clr)
     Method to register the metadata for an implementation of a persistent abstract class.
public  voidregisterPersistentInterface(InterfaceMetaData imd, Class implClass, ClassLoaderResolver clr)
     Method to register a persistent interface and its implementation with the MetaData system.
protected  voidregisterQueriesForFile(FileMetaData filemd)
     Convenience method to register all queries found in the passed file.
protected  voidregisterQueryResultMetaDataForFile(FileMetaData filemd)
     Convenience method to register all table generators found in the passed file.
protected  voidregisterSequencesForFile(FileMetaData filemd)
     Convenience method to register all sequences found in the passed file.
protected  voidregisterTableGeneratorsForFile(FileMetaData filemd)
     Convenience method to register all table generators found in the passed file.
public  voidsetEnhancing()
     Method to set that the Manager is enhancing classes.
public  voidsetMetaDataFactory(MetaDataFactory factory)
     Method to set the Factory for MetaData objects.
public  voidsetValidate(boolean validate)
     Mutator for whether to validate the MetaData files for XML compliance.
public  booleansupportsORM()
     Accessor for whether the MetaData manager supports ORM concepts and metadata.
public  voidunsetEnhancing()
     Method to set that the Manager is not enhancing classes.

Field Detail
LOCALISER
final protected static Localiser LOCALISER(Code)
Localiser for messages.



annotationManager
protected AnnotationManager annotationManager(Code)
Manager for annotations.



classMetaDataByClass
protected Map classMetaDataByClass(Code)
Map of ClassMetaData, keyed by the class name.



classMetaDataByEntityName
protected Map classMetaDataByEntityName(Code)
Map of ClassMetaData, keyed by the JPA "entity name".



classesWithoutPersistenceInfo
protected Collection classesWithoutPersistenceInfo(Code)
Cache of class names that are known to not have MetaData/annotations.



enhancing
protected boolean enhancing(Code)
Indicator for whether this manager is managing the enhancement process, else it's runtime.



fetchPlanMetaDataByName
protected Map fetchPlanMetaDataByName(Code)
Map of FetchPlanMetaData, keyed by the fetch plan name.



fileMetaDataByURLString
protected Map fileMetaDataByURLString(Code)
Map of FileMetaData for the parsed files, keyed by the URL string.



initialised
protected boolean initialised(Code)
Flag for initialisation state when starting using a "persistence-unit". Used to prevent double initialise.



listeners
protected List listeners(Code)
EventListeners. Use a list to preserve ordering.



metaDataParser
protected MetaDataParser metaDataParser(Code)
Parser for MetaData.



omfContext
protected OMFContext omfContext(Code)
The ObjectManagerFactory Context that this metadata manager is operating in.



queryMetaDataByName
protected Map queryMetaDataByName(Code)
Map of QueryMetaData, keyed by the (class name + query name).



queryResultMetaDataByName
protected Map queryResultMetaDataByName(Code)
Map of QueryResultMetaData keyed by the name.



sequenceMetaDataByPackageSequence
protected Map sequenceMetaDataByPackageSequence(Code)
Map of SequenceMetaData, keyed by the package name and sequence name.



supportsORM
protected boolean supportsORM(Code)
Whether the MetaData manager supports ORM concepts and metadata. When using an object datastore this will be false.



tableGeneratorMetaDataByPackageSequence
protected Map tableGeneratorMetaDataByPackageSequence(Code)
Map of TableGeneratorMetaData, keyed by the package name and generator name.



utilisedFileMetaData
protected ArrayList utilisedFileMetaData(Code)
Temporary list of the FileMetaData objects utilised in this call for metadata.



validateMetaData
protected boolean validateMetaData(Code)
Flag whether we should validate the metadata files when parsing.




Constructor Detail
MetaDataManager
public MetaDataManager(OMFContext ctxt)(Code)
Constructor, specifying the OMFContext used.
Parameters:
  ctxt - OMF Context that this metadata manager operates in




Method Detail
addAnnotationsDataToClass
void addAnnotationsDataToClass(Class c, AbstractClassMetaData cmd, ClassLoaderResolver clr)(Code)
Load up and add any annotations mapping info for the specified class to the stored ClassMetaData. Is package-access so that is only accessable by MetaData classes
Parameters:
  c - The class
Parameters:
  cmd - the metadata to add annotation to
Parameters:
  clr - ClassLoader resolver



addORMDataToClass
protected void addORMDataToClass(Class c, ClassLoaderResolver clr)(Code)
Load up and add any O/R mapping info for the specified class to the stored ClassMetaData (if supported). This implementation does nothing so if ORM files are supported then this should be overridden by subclasses. Is package-access so that is only accessable by MetaData classes
Parameters:
  c - The class
Parameters:
  clr - ClassLoader resolver



close
public void close()(Code)
Clear resources



getApiAdapter
public ApiAdapter getApiAdapter()(Code)
Accessor for the API adapter being used by this MetaDataManager. API adapter.



getClassMetaDataForImplementationOfPersistentInterface
public ClassMetaData getClassMetaDataForImplementationOfPersistentInterface(String interfaceName)(Code)
Accessor for the metadata for the implementation of the specified "persistent-interface".
Parameters:
  interfaceName - The name of the persistent interface The ClassMetaData of the implementation class



getClassesImplementingInterface
public String[] getClassesImplementingInterface(String interfaceName, ClassLoaderResolver clr)(Code)
Accessor for the list of names of classes that are declared to implement the specified interface (using <implements> in the MetaData). This will include subclasses of declared classes. Ignore abstract classes. The array of implementation class names will have the initial implementations first followed by the subclass implementations etc. So for example if we look for all implementations of I and A implements I and B extends A, then it will return [A, B] in that order.
Parameters:
  interfaceName - Name of the interface
Parameters:
  clr - The ClassLoaderResolver The names of the classes declared as implementing that interface. return null if no classes



getClassesWithMetaData
public Collection getClassesWithMetaData()(Code)
Accessor for the names of the classes with MetaData currently registered with this manager. Names of classes with MetaData



getFileMetaData
public FileMetaData[] getFileMetaData()(Code)
Accessor for all FileMetaData currently managed here. FileMetaData managed here currently



getImplementationNameForPersistentInterface
public String getImplementationNameForPersistentInterface(String interfaceName)(Code)
Accessor for the implementation name for the specified "persistent-interface".
Parameters:
  interfaceName - The name of the persistent interface The name of the implementation class



getListeners
public List getListeners()(Code)
Get the event listeners the event listeners



getMetaDataFactory
public MetaDataFactory getMetaDataFactory()(Code)
Accessor for a factory for MetaData objects. The factory of objects



getMetaDataForClass
public synchronized AbstractClassMetaData getMetaDataForClass(String className, ClassLoaderResolver clr)(Code)
Accessor for the MetaData for a class given the name and a loader. All MetaData returned from this method will be initialised and ready for full use. If the class can't be loaded, null will be returned.
Parameters:
  className - Name of the class to find MetaData for
Parameters:
  clr - ClassLoaderResolver resolver for use in loading the class. The ClassMetaData for this class (or null if not found)



getMetaDataForClass
public synchronized AbstractClassMetaData getMetaDataForClass(Class c, ClassLoaderResolver clr)(Code)
Main accessor for the MetaData for a class. All MetaData returned from this method will be initialised and ready for full use.
Parameters:
  c - The class to find MetaData for
Parameters:
  clr - the ClassLoaderResolver The ClassMetaData for this class (or null if not found)



getMetaDataForClassInternal
abstract public AbstractClassMetaData getMetaDataForClassInternal(Class c, ClassLoaderResolver clr)(Code)
Internal convenience method for accessing the MetaData for a class. MetaData returned by this method may be uninitialised so should only really be used in initialisation processes. To be implemented by the implementing class.
Parameters:
  c - The class to find MetaData for The ClassMetaData for this class (or null if not found)



getMetaDataForEntityName
public synchronized AbstractClassMetaData getMetaDataForEntityName(String entityName)(Code)
Accessor for the MetaData for a class given the "entity-name".
Parameters:
  entityName - The entity name to find MetaData for The ClassMetaData for this entity name (or null if not found)



getMetaDataForFetchPlan
public FetchPlanMetaData getMetaDataForFetchPlan(String name)(Code)
Accessor for the MetaData for a named fetch plan.
Parameters:
  name - Name of the fetch plan The FetchPlanMetaData for this name (if any)



getMetaDataForImplementationOfReference
public ClassMetaData getMetaDataForImplementationOfReference(Class referenceClass, Object implValue, ClassLoaderResolver clr)(Code)
Accessor for the MetaData for an implementation of a reference type. Finds the metadata for the implementation of this reference.
Parameters:
  referenceClass - The reference class to find MetaData for
Parameters:
  implValue - Object of an implementation class, to return if possible (null=ignore)
Parameters:
  clr - ClassLoader resolver The ClassMetaData for an implementation of a reference type



getMetaDataForInterface
public InterfaceMetaData getMetaDataForInterface(Class c, ClassLoaderResolver clr)(Code)
Accessor for the MetaData for an interface. Part of the support for "persistent-interface". This defaults to returning null since interfaces are only supported by JDO.
Parameters:
  c - The interface to find MetaData for
Parameters:
  clr - the ClassLoaderResolver The InterfaceMetaData for this interface (or null if not found)



getMetaDataForMember
public AbstractMemberMetaData getMetaDataForMember(String className, String memberName, ClassLoaderResolver clr)(Code)
Accessor for the MetaData for a field/property of a class. Utilises getMetaDataForClass, and then finds the relevant field/property.
Parameters:
  className - The name of the class owning the field/property
Parameters:
  memberName - The name of the field to find MetaData for
Parameters:
  clr - ClassLoaderResolver resolver for any loading of classes The metadata for this field/property (or null if not found)



getMetaDataForMember
public AbstractMemberMetaData getMetaDataForMember(Class c, ClassLoaderResolver clr, String memberName)(Code)
Accessor for the MetaData for a field/property of a class. Utilises getMetaDataForClass, and then finds the relevant field/property.
Parameters:
  c - The class owning the field/property
Parameters:
  clr - the ClassLoaderResolver
Parameters:
  memberName - The name of the field/property to find MetaData for The metadata for this field/property (or null if not found)



getMetaDataForPersistenceUnit
public PersistenceUnitMetaData getMetaDataForPersistenceUnit(String unitName)(Code)
Method to parse all available "persistence.xml" files and return the metadata for the persistence unit with the specified name.
Parameters:
  unitName - Name of the persistence-unit MetaData for the persistence-unit of the specified name (or null if not found)
throws:
  JPOXUserException - if no "persistence.xml" files are found



getMetaDataForQuery
public QueryMetaData getMetaDataForQuery(Class cls, ClassLoaderResolver clr, String queryName)(Code)
Accessor for the MetaData for a named query for a class. If the class is not specified, searches for the query with this name for any class. Will only return metadata for queries already registered in this implementation.
Parameters:
  cls - The class which has the query defined for it
Parameters:
  clr - the ClassLoaderResolver
Parameters:
  queryName - Name of the query The QueryMetaData for the query for this class



getMetaDataForQueryResult
public QueryResultMetaData getMetaDataForQueryResult(String name)(Code)
Accessor for the MetaData for a QueryResult.
Parameters:
  name - Name of the query result The QueryResultMetaData under this name



getMetaDataForSequence
public SequenceMetaData getMetaDataForSequence(ClassLoaderResolver clr, String seqName)(Code)
Accessor for the MetaData for a Sequence in a package. This implementation simply checks what is already loaded and returns if found
Parameters:
  clr - the ClassLoaderResolver
Parameters:
  seqName - Name of the package (fully qualified if necessary) The SequenceMetaData for this named sequence



getMetaDataForTableGenerator
public TableGeneratorMetaData getMetaDataForTableGenerator(ClassLoaderResolver clr, String genName)(Code)
Accessor for the MetaData for a TableGenerator in a package. This implementation simply checks what is already loaded and returns if found
Parameters:
  clr - the ClassLoaderResolver
Parameters:
  genName - Name of the package (fully qualified if necessary) The TableGenerator for this named generator



getOMFContext
public OMFContext getOMFContext()(Code)
Accessor for the ObjectManagerFactory Context that this manager is running in. The ObjectManagerFactory Context



getReferencedClassMetaData
public List getReferencedClassMetaData(AbstractClassMetaData cmd, String dba_vendor_id, ClassLoaderResolver clr)(Code)
Utility to return all ClassMetaData that is referenced from the supplier class.
Parameters:
  cmd - The origin class's MetaData.
Parameters:
  dba_vendor_id - The Vendor id of the database adapter in use.(Used in handling "views" support)
Parameters:
  clr - ClassLoaderResolver resolver for loading any classes. List of ClassMetaData referenced by the origin



getSubclassesForClass
public String[] getSubclassesForClass(String className, boolean includeDescendents)(Code)
Accessor for the subclasses of a particular class
Parameters:
  className - Name of the class that we want the known subclasses for.
Parameters:
  includeDescendents - Whether to include subclasses of subclasses etc Names of the subclasses. return null if there are no subclasses



hasMetaDataForClass
public boolean hasMetaDataForClass(String className)(Code)
Convenience method to check if we have metadata present for the specified class.
Parameters:
  className - The name of the class to check Whether the metadata is already registered for this class



initialise
public FileMetaData[] initialise(String[] metadataFiles, String[] classNames, ClassLoaderResolver clr)(Code)
Initialisation method to define the initial metadata files and class names being handled by this MetaDataManager.
Parameters:
  metadataFiles - The metadata files
Parameters:
  classNames - The class names
Parameters:
  clr - ClassLoader Resolver Array of the FileMetaData that is managed
throws:
  JPOXUserException - (with nested exceptions) if an error occurs parsing the files



initialise
public FileMetaData[] initialise(String persistenceUnitName, ClassLoaderResolver clr)(Code)
Initialisation method to define the "persistence-unit" being handled by this MetaDataManager.
Parameters:
  persistenceUnitName - name of the "persistence-unit"
Parameters:
  clr - ClassLoader Resolver Array of the FileMetaData that is managed
throws:
  JPOXUserException - if an error occurs parsing the persistence-unit info



initialise
public FileMetaData[] initialise(PersistenceUnitMetaData pumd, ClassLoaderResolver clr)(Code)
Initialisation method to define the "persistence-unit" being handled by this MetaDataManager.
Parameters:
  pumd - The MetaData for this "persistence-unit"
Parameters:
  clr - ClassLoader Resolver Array of the FileMetaData that is managed
throws:
  JPOXUserException - if an error occurs parsing the persistence-unit info



initialiseClassMetaData
protected void initialiseClassMetaData(ClassMetaData cmd, Class cls, ClassLoaderResolver clr)(Code)
Utility to initialise the MetaData for a class, using the specified class. This assigns defaults to tags that haven't been assigned. If the class that is being used to populate the MetaData is not enhanced, this will throw a JPOXUserException informing them of this.
Parameters:
  cmd - The classes metadata
Parameters:
  cls - The class to use as a basis for initialisation
Parameters:
  clr - ClassLoader resolver to use
throws:
  JPOXUserException - if the class is not enhanced



initialiseFileMetaData
protected void initialiseFileMetaData(FileMetaData filemd, ClassLoaderResolver clr, ClassLoader primary)(Code)
Initialise all classes/interfaces in a Meta-Data file.
Parameters:
  filemd - the FileMetaData
Parameters:
  clr - ClassLoader resolver to use
Parameters:
  primary - the primary ClassLoader to use (or null)



initialiseInterfaceMetaData
protected void initialiseInterfaceMetaData(InterfaceMetaData imd, ClassLoaderResolver clr, ClassLoader primary)(Code)
Utility to initialise the MetaData for a interface, using the specified class. This assigns defaults to tags that haven't been assigned. If the class that is being used to populate the MetaData is not enhanced, this will throw a JPOXUserException informing them of this.
Parameters:
  imd - The interface metadata
Parameters:
  clr - The loader of the interface
Parameters:
  primary - the primary ClassLoader to use (or null)



isClassPersistable
public boolean isClassPersistable(String className)(Code)
Convenience method to return if the specified class is a known persistable class.
Parameters:
  className - Name of the class Whether it is persistable



isClassWithoutPersistenceInfo
protected boolean isClassWithoutPersistenceInfo(String className)(Code)
Accessor for whether a class doesn't have MetaData or annotations.
Parameters:
  className - Name of the class Whether it has no metadata and annotations



isEnhancing
public boolean isEnhancing()(Code)
Accessor for whether we are managing the enhancement process. Whether we are enhancing



isPersistentDefinitionImplementation
public boolean isPersistentDefinitionImplementation(String implName)(Code)
Convenience method to return if the passed class name is an implementation of a "persistent definition".
Parameters:
  implName - The implementation name Whether it is a (JPOX-generated) impl of the persistent interface or abstract class



isPersistentInterface
public boolean isPersistentInterface(String name)(Code)
Convenience method to return if the passed class name is a "persistent-interface".
Parameters:
  name - Name if the interface Whether it is a "persistent-interface"



isPersistentInterfaceImplementation
public boolean isPersistentInterfaceImplementation(String interfaceName, String implName)(Code)
Convenience method to return if the passed class name is an implementation of the passed "persistent-interface".
Parameters:
  interfaceName - Name of the persistent interface
Parameters:
  implName - The implementation name Whether it is a (JPOX-generated) impl of the persistent interface



loadAnnotationsForClass
protected FileMetaData loadAnnotationsForClass(Class cls, ClassLoaderResolver clr, boolean register, boolean populate)(Code)
Method to load the annotations for the specified class and return the FileMetaData containing the class. The FileMetaData, PackageMetaData will be dummy records.
Parameters:
  cls - The class
Parameters:
  clr - ClassLoader resolver
Parameters:
  register - Whether to register the data
Parameters:
  populate - Whether to populate the data The FileMetaData



logConfiguration
protected void logConfiguration()(Code)
Method to log the configuration of this manager.



parseFile
abstract protected FileMetaData parseFile(URL file_url)(Code)
Utility to parse a MetaData file.
Parameters:
  file_url - URL of the file The FileMetaData for this file



parsePersistenceFiles
public PersistenceFileMetaData[] parsePersistenceFiles()(Code)
Method to parse the available "persistence.xml" files returning the metadata for all found. Searches for all files "META-INF/persistence.xml" in the CLASSPATH of the current thread. The metadata for all "persistence.xml" files



populateFileMetaData
protected void populateFileMetaData(FileMetaData filemd, ClassLoaderResolver clr, ClassLoader primary)(Code)
Convenience method to populate all classes/interfaces in a Meta-Data file.
Parameters:
  filemd - The MetaData file
Parameters:
  clr - Class Loader to use in population
Parameters:
  primary - the primary ClassLoader to use (or null)



readMetaDataForClass
public AbstractClassMetaData readMetaDataForClass(String className)(Code)
Method to access the (already known) metadata for the specified class. If the class is not yet known about it returns null.
Parameters:
  className - Name of the class MetaData for the class



readMetaDataForMember
public AbstractMemberMetaData readMetaDataForMember(String className, String memberName)(Code)
Method to access the (already known) metadata for the field/property of the specified class. If the class (or this field/property) is not yet known about it returns null.
Parameters:
  className - Name of the class
Parameters:
  memberName - Name of the field/property MetaData for the field/property



registerFetchPlansForFile
protected void registerFetchPlansForFile(FileMetaData filemd)(Code)
Convenience method to register all FetchPlans found in the passed file.
Parameters:
  filemd - MetaData for the file



registerFile
abstract public void registerFile(String fileURLString, FileMetaData filemd, ClassLoaderResolver clr)(Code)
Method to take the FileMetaData and register the relevant parts of it with the assorted caches provided.
Parameters:
  fileURLString - URL of the metadata file
Parameters:
  filemd - The File MetaData



registerImplementationOfAbstractClass
public void registerImplementationOfAbstractClass(ClassMetaData cmd, Class implClass, ClassLoaderResolver clr)(Code)
Method to register the metadata for an implementation of a persistent abstract class.
Parameters:
  cmd - MetaData for the abstract class
Parameters:
  implClass - The implementation class
Parameters:
  clr - ClassLoader resolver



registerPersistentInterface
public void registerPersistentInterface(InterfaceMetaData imd, Class implClass, ClassLoaderResolver clr)(Code)
Method to register a persistent interface and its implementation with the MetaData system.
Parameters:
  imd - MetaData for the interface
Parameters:
  implClass - The implementation class
Parameters:
  clr - ClassLoader Resolver to use



registerQueriesForFile
protected void registerQueriesForFile(FileMetaData filemd)(Code)
Convenience method to register all queries found in the passed file.
Parameters:
  filemd - MetaData for the file



registerQueryResultMetaDataForFile
protected void registerQueryResultMetaDataForFile(FileMetaData filemd)(Code)
Convenience method to register all table generators found in the passed file.
Parameters:
  filemd - MetaData for the file



registerSequencesForFile
protected void registerSequencesForFile(FileMetaData filemd)(Code)
Convenience method to register all sequences found in the passed file.
Parameters:
  filemd - MetaData for the file



registerTableGeneratorsForFile
protected void registerTableGeneratorsForFile(FileMetaData filemd)(Code)
Convenience method to register all table generators found in the passed file.
Parameters:
  filemd - MetaData for the file



setEnhancing
public void setEnhancing()(Code)
Method to set that the Manager is enhancing classes. This implies using slightly weaker checks during read/populate/initialise of MetaData.



setMetaDataFactory
public void setMetaDataFactory(MetaDataFactory factory)(Code)
Method to set the Factory for MetaData objects. This is used to create Class, Field, Property, Interface objects.
Parameters:
  factory - The factory



setValidate
public void setValidate(boolean validate)(Code)
Mutator for whether to validate the MetaData files for XML compliance.
Parameters:
  validate - Whether to validate



supportsORM
public boolean supportsORM()(Code)
Accessor for whether the MetaData manager supports ORM concepts and metadata. With object datastores this will return false. Whether we support ORM



unsetEnhancing
public void unsetEnhancing()(Code)
Method to set that the Manager is not enhancing classes. This implies reverting to the normal checks during read/populate/initialise of MetaData.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.