Save This Page
Home » apache-openjpa-1.1.0-source » org.apache.openjpa » meta » [javadoc | source]
org.apache.openjpa.meta
public class: MetaDataRepository [javadoc | source]
java.lang.Object
   org.apache.openjpa.meta.MetaDataRepository

All Implemented Interfaces:
    MetaDataModes, org.apache.openjpa.enhance.PCRegistry.RegisterClassListener, Serializable, Closeable, Configurable

Direct Known Subclasses:
    MappingRepository

Repository of and factory for persistent metadata.
Field Summary
public static final  int VALIDATE_NONE    Constant to not validate any metadata. 
public static final  int VALIDATE_META    Bit flag to validate metadata. 
public static final  int VALIDATE_MAPPING    Bit flag to validate mappings. 
public static final  int VALIDATE_UNENHANCED    Bit flag to validate unenhanced metadata only. 
public static final  int VALIDATE_RUNTIME    Bit flag for runtime validation. Requires that all classes are enhanced, and performs extra field resolution steps. 
protected static final  Class[] EMPTY_CLASSES     
protected static final  NonPersistentMetaData[] EMPTY_NON_PERSISTENT     
protected final  ClassMetaData[] EMPTY_METAS     
protected final  FieldMetaData[] EMPTY_FIELDS     
protected final  Order[] EMPTY_ORDERS     
protected final  XMLMetaData[] EMPTY_XMLMETAS     
Constructor:
 public MetaDataRepository() 
Method from org.apache.openjpa.meta.MetaDataRepository Summary:
addDeclaredInterfaceImpl,   addMetaData,   addMetaData,   addNonMappedInterface,   addPersistenceAware,   addQueryMetaData,   addSequenceMetaData,   addSystemListener,   addXMLMetaData,   clear,   close,   endConfiguration,   getAliasNames,   getCachedMetaData,   getCachedQueryMetaData,   getCachedSequenceMetaData,   getCachedXMLMetaData,   getClosestAliasName,   getConfiguration,   getImplGenerator,   getImplementorMetaDatas,   getLog,   getMetaData,   getMetaData,   getMetaData,   getMetaDataFactory,   getMetaDatas,   getNonMappedInterface,   getNonMappedInterfaces,   getPCSubclasses,   getPersistenceAware,   getPersistenceAwares,   getPersistentTypeNames,   getQueryKey,   getQueryMetaData,   getQueryMetaDatas,   getResolve,   getSequenceMetaData,   getSequenceMetaData,   getSequenceMetaDatas,   getSourceMode,   getSystemListeners,   getValidate,   getXMLMetaData,   loadPersistentTypes,   newClassMetaData,   newClassMetaDataArray,   newEmbeddedClassMetaData,   newFieldMetaData,   newFieldMetaDataArray,   newOrder,   newOrderArray,   newQueryMetaData,   newRelatedFieldOrder,   newSequenceMetaData,   newValueMetaData,   newValueOrder,   newXMLClassMetaData,   newXMLClassMetaDataArray,   newXMLFieldMetaData,   prepareMapping,   processRegisteredClasses,   register,   removeMetaData,   removeMetaData,   removeNonMappedInterface,   removePersistenceAware,   removeQueryMetaData,   removeQueryMetaData,   removeSequenceMetaData,   removeSequenceMetaData,   removeSystemListener,   setConfiguration,   setInterfaceImpl,   setMetaDataFactory,   setResolve,   setResolve,   setSourceMode,   setSourceMode,   setValidate,   setValidate,   startConfiguration
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.openjpa.meta.MetaDataRepository Detail:
  void addDeclaredInterfaceImpl(ClassMetaData meta,
    Class iface) 
    Add the given metadata as declared interface implementation.
 public ClassMetaData addMetaData(Class cls) 
    Create a new metadata, populate it with default information, add it to the repository, and return it. Use the default access type.
 public ClassMetaData addMetaData(Class cls,
    int access) 
    Create a new metadata, populate it with default information, add it to the repository, and return it.
 public NonPersistentMetaData addNonMappedInterface(Class iface) 
    Add the given non-mapped interface to the repository.
 public NonPersistentMetaData addPersistenceAware(Class cls) 
    Add the given class as persistence-aware.
 public synchronized QueryMetaData addQueryMetaData(Class cls,
    String name) 
    Add a new query metadata to the repository and return it.
 public synchronized SequenceMetaData addSequenceMetaData(String name) 
    Add a new sequence metadata to the repository and return it.
 public synchronized  void addSystemListener(Object listener) 
    Add the given system lifecycle listener.
 public XMLClassMetaData addXMLMetaData(Class type,
    String name) 
    Create a new metadata, populate it with default information, add it to the repository, and return it.
 public synchronized  void clear() 
    Clear the cache of parsed metadata. This method also clears the internal MetaDataFactory 's cache.
 public synchronized  void close() 
    Free the resources used by this repository. Closes all user sequences.
 public  void endConfiguration() 
 public Collection getAliasNames() 
 public ClassMetaData getCachedMetaData(Class cls) 
    Return the cached metadata for the given class, without any resolution. Return null if none.
 public synchronized QueryMetaData getCachedQueryMetaData(Class cls,
    String name) 
    Return the cached query metadata for the given name.
 public synchronized SequenceMetaData getCachedSequenceMetaData(String name) 
    Return the cached a sequence metadata for the given name.
 public XMLMetaData getCachedXMLMetaData(Class cls) 
    Return the cached XMLClassMetaData for the given class Return null if none.
 public String getClosestAliasName(String alias) 
 public OpenJPAConfiguration getConfiguration() 
    Return the configuration for the repository.
 InterfaceImplGenerator getImplGenerator() 
 public ClassMetaData[] getImplementorMetaDatas(Class cls,
    ClassLoader envLoader,
    boolean mustExist) 
    Return all least-derived metadatas with some mapped assignable type that implement the given class.
 public Log getLog() 
    Return the metadata log.
 public synchronized ClassMetaData getMetaData(Class cls,
    ClassLoader envLoader,
    boolean mustExist) 
    Return the metadata for the given class.
 public ClassMetaData getMetaData(String alias,
    ClassLoader envLoader,
    boolean mustExist) 
    Return the metadata for the given alias name.
 public ClassMetaData getMetaData(Object oid,
    ClassLoader envLoader,
    boolean mustExist) 
    Return the least-derived class metadata for the given application identity object.
 public MetaDataFactory getMetaDataFactory() 
    The I/O used to load metadata.
 public synchronized ClassMetaData[] getMetaDatas() 
    Return all the metadata instances currently in the repository.
 public NonPersistentMetaData getNonMappedInterface(Class iface) 
    Gets the metadata corresponding to the given non-mapped interface. Returns null, if the given interface is not registered as persistence-aware.
 public NonPersistentMetaData[] getNonMappedInterfaces() 
    Gets the corresponding metadatas for all registered, non-mapped interfaces
 Collection getPCSubclasses(Class cls) 
    Return all known subclasses for the given class mapping. Note that this method only works during runtime when the repository is registered as a RegisterClassListener .
 public NonPersistentMetaData getPersistenceAware(Class cls) 
    Gets the metadata corresponding to the given persistence-aware class. Returns null, if the given class is not registered as persistence-aware.
 public NonPersistentMetaData[] getPersistenceAwares() 
    Gets all the metadatas for persistence-aware classes
 public synchronized Set getPersistentTypeNames(boolean devpath,
    ClassLoader envLoader) 
    Return the set of configured persistent classes, or null if the user did not configure any.
 protected static Object getQueryKey(Class cls,
    String name) 
    Return a unique key for a given class / name. The class argument can be null.
 public synchronized QueryMetaData getQueryMetaData(Class cls,
    String name,
    ClassLoader envLoader,
    boolean mustExist) 
    Return query metadata for the given class, name, and classloader.
 public synchronized QueryMetaData[] getQueryMetaDatas() 
    Return the cached query metadata.
 public int getResolve() 
    The metadata resolution mode. Defaults to MODE_META | MODE_MAPPING.
 public synchronized SequenceMetaData getSequenceMetaData(String name,
    ClassLoader envLoader,
    boolean mustExist) 
    Return sequence metadata for the given name and classloader.
 SequenceMetaData getSequenceMetaData(ClassMetaData context,
    String name,
    boolean mustExist) 
    Used internally by metadata to retrieve sequence metadatas based on possibly-unqualified sequence name.
 public synchronized SequenceMetaData[] getSequenceMetaDatas() 
    Return the cached sequence metadata.
 public int getSourceMode() 
    The source mode determining what metadata to load. Defaults to MODE_META | MODE_MAPPING | MODE_QUERY.
 public LifecycleEventManager.ListenerList getSystemListeners() 
    Return the system lifecycle listeners
 public int getValidate() 
    The metadata validation level. Defaults to VALIDATE_META | VALIDATE_UNENHANCED.
 public synchronized XMLMetaData getXMLMetaData(FieldMetaData fmd) 
    Return XML metadata for a given field metadata
 public synchronized Collection loadPersistentTypes(boolean devpath,
    ClassLoader envLoader) 
    Load the persistent classes named in configuration. This ensures that all subclasses and application identity classes of each type are known in advance, without having to rely on the application loading the classes before performing operations that might involve them.
 protected ClassMetaData newClassMetaData(Class type) 
    Create a new class metadata instance.
 protected ClassMetaData[] newClassMetaDataArray(int length) 
    Create a new array of the proper class metadata subclass.
 protected ClassMetaData newEmbeddedClassMetaData(ValueMetaData owner) 
    Create a new embedded class metadata instance.
 protected FieldMetaData newFieldMetaData(String name,
    Class type,
    ClassMetaData owner) 
    Create a new field metadata instance.
 protected FieldMetaData[] newFieldMetaDataArray(int length) 
    Create a new array of the proper field metadata subclass.
 protected Order newOrder(FieldMetaData owner,
    String name,
    boolean asc) 
 protected Order[] newOrderArray(int size) 
    Create an array of orders of the given size.
 protected QueryMetaData newQueryMetaData(Class cls,
    String name) 
    Create a new query metadata instance.
 protected Order newRelatedFieldOrder(FieldMetaData owner,
    FieldMetaData rel,
    boolean asc) 
    Order by a field of the related type.
 protected SequenceMetaData newSequenceMetaData(String name) 
    Create a new sequence metadata instance.
 protected ValueMetaData newValueMetaData(FieldMetaData owner) 
    Create a new value metadata instance.
 protected Order newValueOrder(FieldMetaData owner,
    boolean asc) 
    Order by the field value.
 protected XMLClassMetaData newXMLClassMetaData(Class type,
    String name) 
    Create a new xml class metadata
 protected XMLMetaData[] newXMLClassMetaDataArray(int length) 
    Create a new array of the proper xml class metadata subclass.
 public XMLFieldMetaData newXMLFieldMetaData(Class type,
    String name) 
    Create a new xml field meta, add it to the fieldMap in the given xml class metadata
 protected  void prepareMapping(ClassMetaData meta) 
    Prepare metadata for mapping resolution. This method might map parts of the metadata that don't rely on other classes being mapped, but that other classes might rely on during their own mapping (for example, primary key fields). By default, this method only calls ClassMetaData#defineSuperclassFields .
 Class[] processRegisteredClasses(ClassLoader envLoader) 
    Updates our datastructures with the latest registered classes.
 public  void register(Class cls) 
 public boolean removeMetaData(ClassMetaData meta) 
    Remove a metadata instance from the repository.
 public synchronized boolean removeMetaData(Class cls) 
    Remove a metadata instance from the repository.
 public boolean removeNonMappedInterface(Class iface) 
    Remove a non-mapped interface from the repository
 public boolean removePersistenceAware(Class cls) 
    Remove a persitence-aware class from the repository
 public synchronized boolean removeQueryMetaData(QueryMetaData meta) 
    Remove the given query metadata from the repository.
 public synchronized boolean removeQueryMetaData(Class cls,
    String name) 
    Remove query metadata for the given class name if in the repository.
 public synchronized boolean removeSequenceMetaData(SequenceMetaData meta) 
    Remove the given sequence metadata from the repository.
 public synchronized boolean removeSequenceMetaData(String name) 
    Remove sequence metadata for the name if in the repository.
 public synchronized boolean removeSystemListener(Object listener) 
    Remove the given system lifecycle listener.
 public  void setConfiguration(Configuration conf) 
 synchronized  void setInterfaceImpl(ClassMetaData meta,
    Class impl) 
    Set the implementation for the given managed interface.
 public  void setMetaDataFactory(MetaDataFactory factory) 
    The I/O used to load metadata.
 public  void setResolve(int mode) 
    The metadata resolution mode. Defaults to MODE_META | MODE_MAPPING.
 public  void setResolve(int mode,
    boolean on) 
    The metadata resolution mode. Defaults to MODE_META | MODE_MAPPING.
 public  void setSourceMode(int mode) 
    The source mode determining what metadata to load. Defaults to MODE_META | MODE_MAPPING | MODE_QUERY.
 public  void setSourceMode(int mode,
    boolean on) 
    The source mode determining what metadata to load. Defaults to MODE_META | MODE_MAPPING | MODE_QUERY.
 public  void setValidate(int validate) 
    The metadata validation level. Defaults to VALIDATE_META | VALIDATE_UNENHANCED.
 public  void setValidate(int validate,
    boolean on) 
    The metadata validation level. Defaults to VALIDATE_META | VALIDATE_MAPPING | VALIDATE_UNENHANCED.
 public  void startConfiguration()