SolarMetric Kodo JDO 3.3.5 generated on August 31 2005

kodo.jdbc.meta
Class MappingRepository

java.lang.Object
  |
  +--kodo.meta.DelegatingJDOMetaDataRepository
        |
        +--kodo.jdbc.meta.MappingRepository
All Implemented Interfaces:
ImplHelper.RegisterClassListener, JDOMetaDataRepository

public class MappingRepository
extends DelegatingJDOMetaDataRepository

Repository of class mapping information.


Constructor Summary
MappingRepository(JDBCConfiguration conf)
          Constructor.
MappingRepository(JDBCConfiguration conf, JDOMetaDataRepository repos)
          Constructor.
 
Method Summary
 void addMetaData(ClassMetaData meta)
          Add a metadata instance to the repository.
 void clear()
          Clear the cache of parsed metadata.
protected  void clearCache()
          Clear the caches of mappings and implementations.
 JDOConfiguration getConfiguration()
          Return the configuration supplied on construction.
 ClassMetaData getEmbeddedMetaData(ClassMetaData owner, int field)
          Return the class metadata for the embedded value of the given field.
 Log getLog()
          Return the log to use for messages.
 ClassMapping getMapping(Class cls, ClassLoader loader, boolean mustExist)
          Convenience method to make casting from getMetaData(Class,ClassLoader,boolean) unnecessary.
 ClassMapping getMapping(ClassMetaData meta, boolean mustExist)
          Returns the requested mapping after generating and caching it if necessary.
 ClassMapping getMapping(Object oid, ClassLoader loader, boolean mustExist)
          Convenience method to make casting from getMetaData(Object,ClassLoader,boolean) unnecessary.
protected  ClassMappingInfo getMappingInfo(ClassMetaData meta)
          Return the mapping info for the given class, or null if none exists.
 MappingInfoRepository getMappingInfoRepository()
          Return the system mappings.
 kodo.jdbc.meta.MappingProvider getMappingProvider()
          Return the mapping provider.
 ClassMapping[] getMappings()
          Convenience method to make casting from getMetaDatas() unnecessary.
 ClassMapping[] getMappings(Class cls, boolean impls, ClassLoader pmLoader, boolean mustExist)
          Convenience method to make casting from getMetaDatas(Class,boolean,ClassLoader,boolean) unnecessary.
 ClassMetaData getMetaData(Class cls, ClassLoader loader, boolean mustExist)
          Return the metadata for the given class.
 ClassMetaData getMetaData(Object oid, ClassLoader loader, boolean mustExist)
          Return the least-derived class metadata for the given application identity object.
 ClassMetaData[] getMetaDatas()
          Return all the metadata instances currently in the repository.
 ClassMetaData[] getMetaDatas(Class cls, boolean impls, ClassLoader pmLoader, boolean mustExist)
          Return all metadatas for the given class.
 SchemaGroup getSchemaGroup()
          Return the runtime schema.
 boolean getValidateExtensionKeys()
          Whether to validate extension keys against the known set.
 boolean hasMetaData(Class cls)
          Return true if the repository has metadata for the given class.
protected  boolean removeFromCache(Class cls)
          Remove a mapping from the cache.
 boolean removeMetaData(Class cls)
          Remove a metadata instance from the repository.
 boolean removeMetaData(ClassMetaData meta)
          Remove a metadata instance from the repository.
 void setMappingInfoRepository(MappingInfoRepository repos)
          Set the system mappings.
 void setMappingProvider(kodo.jdbc.meta.MappingProvider provider)
          Set the mapping provider to use.
 void setSchemaGroup(SchemaGroup schema)
          Set the runtime schema.
 void setValidateExtensionKeys(boolean validate)
          Whether to validate extension keys against the known set.
 
Methods inherited from class kodo.meta.DelegatingJDOMetaDataRepository
equals, getDelegate, getGenerator, getInnermostDelegate, getMetaDataLoader, getValidate, hashCode, registerClass, setGenerator, setMetaDataLoader, setValidate, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MappingRepository

public MappingRepository(JDBCConfiguration conf)
Constructor. Supply configuration.

MappingRepository

public MappingRepository(JDBCConfiguration conf,
                         JDOMetaDataRepository repos)
Constructor. Supply configuration and metadata repository.
Method Detail

getConfiguration

public JDOConfiguration getConfiguration()
Return the configuration supplied on construction.
Overrides:
getConfiguration in class DelegatingJDOMetaDataRepository

getLog

public Log getLog()
Return the log to use for messages.

getSchemaGroup

public SchemaGroup getSchemaGroup()
Return the runtime schema. If no schema has been explicitly set, the current SchemaFactory is asked to read the schema.

setSchemaGroup

public void setSchemaGroup(SchemaGroup schema)
Set the runtime schema.

getMappingInfoRepository

public MappingInfoRepository getMappingInfoRepository()
Return the system mappings.

setMappingInfoRepository

public void setMappingInfoRepository(MappingInfoRepository repos)
Set the system mappings.

getMappingProvider

public kodo.jdbc.meta.MappingProvider getMappingProvider()
Return the mapping provider.

setMappingProvider

public void setMappingProvider(kodo.jdbc.meta.MappingProvider provider)
Set the mapping provider to use.

getValidateExtensionKeys

public boolean getValidateExtensionKeys()
Description copied from interface: JDOMetaDataRepository
Whether to validate extension keys against the known set. Defaults to true.
Overrides:
getValidateExtensionKeys in class DelegatingJDOMetaDataRepository

setValidateExtensionKeys

public void setValidateExtensionKeys(boolean validate)
Description copied from interface: JDOMetaDataRepository
Whether to validate extension keys against the known set. Defaults to true.
Overrides:
setValidateExtensionKeys in class DelegatingJDOMetaDataRepository

getMetaData

public ClassMetaData getMetaData(Class cls,
                                 ClassLoader loader,
                                 boolean mustExist)
Description copied from interface: JDOMetaDataRepository
Return the metadata for the given class.
Overrides:
getMetaData in class DelegatingJDOMetaDataRepository
Following copied from interface: kodo.meta.JDOMetaDataRepository
Parameters:
cls - the class to retrieve metadata for
pmLoader - the persistence manager's class loader, if any
mustExist - if true, throws a JDOMetaDataNotFoundException if no metadata is found

getMapping

public ClassMapping getMapping(Class cls,
                               ClassLoader loader,
                               boolean mustExist)
Convenience method to make casting from getMetaData(Class,ClassLoader,boolean) unnecessary.

getEmbeddedMetaData

public ClassMetaData getEmbeddedMetaData(ClassMetaData owner,
                                         int field)
Description copied from interface: JDOMetaDataRepository
Return the class metadata for the embedded value of the given field.
Overrides:
getEmbeddedMetaData in class DelegatingJDOMetaDataRepository

getMetaDatas

public ClassMetaData[] getMetaDatas()
Description copied from interface: JDOMetaDataRepository
Return all the metadata instances currently in the repository.
Overrides:
getMetaDatas in class DelegatingJDOMetaDataRepository

getMappings

public ClassMapping[] getMappings()
Convenience method to make casting from getMetaDatas() unnecessary.

hasMetaData

public boolean hasMetaData(Class cls)
Description copied from interface: JDOMetaDataRepository
Return true if the repository has metadata for the given class.
Overrides:
hasMetaData in class DelegatingJDOMetaDataRepository

addMetaData

public void addMetaData(ClassMetaData meta)
Description copied from interface: JDOMetaDataRepository
Add a metadata instance to the repository.
Overrides:
addMetaData in class DelegatingJDOMetaDataRepository

removeMetaData

public boolean removeMetaData(ClassMetaData meta)
Description copied from interface: JDOMetaDataRepository
Remove a metadata instance from the repository.
Overrides:
removeMetaData in class DelegatingJDOMetaDataRepository
Following copied from interface: kodo.meta.JDOMetaDataRepository
Returns:
true if removed, false if not in this repository

removeMetaData

public boolean removeMetaData(Class cls)
Description copied from interface: JDOMetaDataRepository
Remove a metadata instance from the repository.
Overrides:
removeMetaData in class DelegatingJDOMetaDataRepository
Following copied from interface: kodo.meta.JDOMetaDataRepository
Returns:
true if removed, false if not in this repository

getMetaData

public ClassMetaData getMetaData(Object oid,
                                 ClassLoader loader,
                                 boolean mustExist)
Description copied from interface: JDOMetaDataRepository
Return the least-derived class metadata for the given application identity object.
Overrides:
getMetaData in class DelegatingJDOMetaDataRepository
Following copied from interface: kodo.meta.JDOMetaDataRepository
Parameters:
oid - the oid to get the metadata for
pmLoader - the persistence manager's class loader, if any
mustExist - if true, throws a JDOMetaDataNotFoundException if no metadata is found

getMapping

public ClassMapping getMapping(Object oid,
                               ClassLoader loader,
                               boolean mustExist)
Convenience method to make casting from getMetaData(Object,ClassLoader,boolean) unnecessary.

getMetaDatas

public ClassMetaData[] getMetaDatas(Class cls,
                                    boolean impls,
                                    ClassLoader pmLoader,
                                    boolean mustExist)
Description copied from interface: JDOMetaDataRepository
Return all metadatas for the given class. If the class is concrete, only the class metadata will be returned. If the class is an interface or is abstract, metadata for all least-derived classes that implement/ extend the class will be returned.
Overrides:
getMetaDatas in class DelegatingJDOMetaDataRepository
Following copied from interface: kodo.meta.JDOMetaDataRepository
Parameters:
cls - the class or interface to retrieve metadata for
impls - true to include implementations of the given class if it is non-persistent type, or false to consider the given class only
pmLoader - the persistence manager's class loader, if any
mustExist - if true, throws a JDOMetaDataNotFoundException if impls are not included and no metadata is found

getMappings

public ClassMapping[] getMappings(Class cls,
                                  boolean impls,
                                  ClassLoader pmLoader,
                                  boolean mustExist)
Convenience method to make casting from getMetaDatas(Class,boolean,ClassLoader,boolean) unnecessary.

getMapping

public ClassMapping getMapping(ClassMetaData meta,
                               boolean mustExist)
Returns the requested mapping after generating and caching it if necessary. If the mustExist is true, throws a MappingInfoNotFoundException if no mapping exists.

getMappingInfo

protected ClassMappingInfo getMappingInfo(ClassMetaData meta)
Return the mapping info for the given class, or null if none exists.

clear

public void clear()
Description copied from interface: JDOMetaDataRepository
Clear the cache of parsed metadata. This method also clears the internal loader's cache.
Overrides:
clear in class DelegatingJDOMetaDataRepository

clearCache

protected void clearCache()
Clear the caches of mappings and implementations.

removeFromCache

protected boolean removeFromCache(Class cls)
Remove a mapping from the cache.

SolarMetric Kodo JDO 3.3.5 generated on August 31 2005

Copyright 2001,2002 SolarMetric, Inc. All Rights Reserved.