|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.openjpa.meta.MetaDataRepository org.apache.openjpa.jdbc.meta.MappingRepository
public class MappingRepository
Repository of object/relational mapping information.
Field Summary |
---|
Fields inherited from class org.apache.openjpa.meta.MetaDataRepository |
---|
EMPTY_CLASSES, EMPTY_FIELDS, EMPTY_METAS, EMPTY_NON_PERSISTENT, EMPTY_ORDERS, EMPTY_XMLMETAS, VALIDATE_MAPPING, VALIDATE_META, VALIDATE_NONE, VALIDATE_RUNTIME, VALIDATE_UNENHANCED |
Fields inherited from interface org.apache.openjpa.meta.MetaDataModes |
---|
MODE_ALL, MODE_ANN_MAPPING, MODE_MAPPING, MODE_MAPPING_INIT, MODE_META, MODE_NONE, MODE_QUERY |
Constructor Summary | |
---|---|
MappingRepository()
Default constructor. |
Method Summary | |
---|---|
QueryResultMapping |
addQueryResultMapping(Class cls,
String name)
Add a query result mapping. |
void |
clear()
Clear the cache of parsed metadata. |
protected ValueHandler |
defaultHandler(ValueMapping val)
Determine the default handler to use for the given value. |
protected ValueHandler |
defaultHandler(ValueMapping val,
boolean adapting)
Determine the default handler to use for the given value. |
protected ClassStrategy |
defaultStrategy(ClassMapping cls)
Determine the default strategy to use for the given class. |
protected ClassStrategy |
defaultStrategy(ClassMapping cls,
boolean adapting)
Determine the default strategy to use for the given class. |
protected DiscriminatorStrategy |
defaultStrategy(Discriminator discrim)
Determine the default strategy to use for the given discriminator. |
protected DiscriminatorStrategy |
defaultStrategy(Discriminator discrim,
boolean adapting)
Determine the default strategy to use for the given discriminator. |
protected FieldStrategy |
defaultStrategy(FieldMapping field,
boolean installHandlers)
Determine the default strategy to use for the given field. |
protected FieldStrategy |
defaultStrategy(FieldMapping field,
boolean installHandlers,
boolean adapting)
Determine the default strategy to use for the given field. |
protected VersionStrategy |
defaultStrategy(Version version)
Determine the default strategy to use for the given version. |
protected VersionStrategy |
defaultStrategy(Version version,
boolean adapting)
Determine the default strategy to use for the given version. |
protected VersionStrategy |
defaultStrategy(Version vers,
FieldMapping vfield)
Return the default version strategy, given a version field. |
protected FieldStrategy |
defaultTypeStrategy(FieldMapping field,
boolean installHandlers,
boolean adapting)
Return the built-in strategy for the field's type, or null if none. |
void |
endConfiguration()
Invoked upon completion of bean property configuration for this object. |
protected ClassMapping |
findBaseClassMapping(ClassMapping mapping)
Finds the base class mapping for the specified mapping. |
QueryResultMapping |
getCachedQueryResultMapping(Class cls,
String name)
Return the cached query result mapping with the given name, or null if none. |
DBDictionary |
getDBDictionary()
Convenient access to dictionary for mappings. |
ClassMapping[] |
getImplementorMappings(Class cls,
ClassLoader envLoader,
boolean mustExist)
|
ClassMapping |
getMapping(Class cls,
ClassLoader envLoader,
boolean mustExist)
|
ClassMapping |
getMapping(Object oid,
ClassLoader envLoader,
boolean mustExist)
|
MappingDefaults |
getMappingDefaults()
Mapping defaults. |
ClassMapping[] |
getMappings()
|
QueryResultMapping |
getQueryResultMapping(Class cls,
String name,
ClassLoader envLoader,
boolean mustExist)
Return the query result mapping for the given name. |
QueryResultMapping[] |
getQueryResultMappings()
Return all cached query result mappings. |
SchemaGroup |
getSchemaGroup()
Representation of the database schema. |
StrategyInstaller |
getStrategyInstaller()
Installs mapping strategies on components. |
protected FieldStrategy |
handlerCollectionStrategy(FieldMapping field,
ValueHandler ehandler,
boolean installHandlers)
Return the collection strategy for the given element handler, or null if none. |
protected FieldStrategy |
handlerMapStrategy(FieldMapping field,
ValueHandler khandler,
ValueHandler vhandler,
boolean krel,
boolean vrel,
boolean installHandlers)
Return the map strategy for the given key and value handlers / relations, or null if none. |
protected boolean |
hasInheritanceStrategy(ClassMapping mapping)
Determines whether an inhertance strategy has been set on the specified mapping. |
protected ClassStrategy |
instantiateClassStrategy(String name,
ClassMapping cls)
Return the strategy for the given name. |
protected DiscriminatorStrategy |
instantiateDiscriminatorStrategy(String name,
Discriminator discrim)
Instantiate the given discriminator strategy. |
protected VersionStrategy |
instantiateVersionStrategy(Class strat,
Version version,
String props)
Instantiate the given version strategy. |
protected VersionStrategy |
instantiateVersionStrategy(String name,
Version version)
Instantiate the given version strategy. |
protected ValueHandler |
namedHandler(ValueMapping val)
Instantiate the given value's named handler, or return null if no named handler. |
protected ClassStrategy |
namedStrategy(ClassMapping cls)
Instantiate the given class' named strategy, or return null if no named strategy. |
protected DiscriminatorStrategy |
namedStrategy(Discriminator discrim)
Instantiate the given discriminator's named strategy, or return null if no named strategy. |
protected FieldStrategy |
namedStrategy(FieldMapping field,
boolean installHandlers)
Instantiate the given field's named strategy, or return null if no named strategy. |
protected VersionStrategy |
namedStrategy(Version version)
Instantiate the given version's named strategy, or return null if no named strategy. |
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 Discriminator |
newDiscriminator(ClassMapping cls)
Create discriminator metadata for the given class. |
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 ClassMappingInfo |
newMappingInfo(ClassMapping cls)
Create raw mapping info for the given instance. |
protected DiscriminatorMappingInfo |
newMappingInfo(Discriminator disc)
Create raw mapping info for the given instance. |
protected FieldMappingInfo |
newMappingInfo(FieldMapping fm)
Create raw mapping info for the given instance. |
protected ValueMappingInfo |
newMappingInfo(ValueMapping vm)
Create raw mapping info for the given instance. |
protected VersionMappingInfo |
newMappingInfo(Version version)
Create raw mapping info for the given instance. |
protected Order[] |
newOrderArray(int size)
Create an array of orders of the given size. |
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 Version |
newVersion(ClassMapping cls)
Create version metadata for the given class. |
protected void |
prepareMapping(ClassMetaData meta)
Prepare metadata for mapping resolution. |
boolean |
removeQueryResultMapping(Class cls,
String name)
Remove a query result mapping. |
boolean |
removeQueryResultMapping(QueryResultMapping res)
Remove a query result mapping. |
protected void |
setDefaultInheritanceStrategy(ClassMapping mapping)
If an inheritance strategy has not been set on this mapping, set it to the default (flat). |
void |
setMappingDefaults(MappingDefaults defaults)
Mapping default. |
void |
setSchemaGroup(SchemaGroup schema)
Representation of the database schema. |
void |
setStrategyInstaller(StrategyInstaller installer)
Installs mapping strategies on components. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MappingRepository()
Configurable
.
Method Detail |
---|
public DBDictionary getDBDictionary()
public MappingDefaults getMappingDefaults()
public void setMappingDefaults(MappingDefaults defaults)
public SchemaGroup getSchemaGroup()
public void setSchemaGroup(SchemaGroup schema)
public StrategyInstaller getStrategyInstaller()
public void setStrategyInstaller(StrategyInstaller installer)
public QueryResultMapping getQueryResultMapping(Class cls, String name, ClassLoader envLoader, boolean mustExist)
public QueryResultMapping[] getQueryResultMappings()
public QueryResultMapping getCachedQueryResultMapping(Class cls, String name)
public QueryResultMapping addQueryResultMapping(Class cls, String name)
public boolean removeQueryResultMapping(QueryResultMapping res)
public boolean removeQueryResultMapping(Class cls, String name)
public ClassMapping getMapping(Class cls, ClassLoader envLoader, boolean mustExist)
public ClassMapping[] getMappings()
public ClassMapping getMapping(Object oid, ClassLoader envLoader, boolean mustExist)
public ClassMapping[] getImplementorMappings(Class cls, ClassLoader envLoader, boolean mustExist)
public void clear()
MetaDataRepository
MetaDataFactory
's cache.
clear
in class MetaDataRepository
protected void prepareMapping(ClassMetaData meta)
MetaDataRepository
ClassMetaData.defineSuperclassFields(boolean)
.
prepareMapping
in class MetaDataRepository
protected ClassMetaData newClassMetaData(Class type)
MetaDataRepository
newClassMetaData
in class MetaDataRepository
protected ClassMetaData[] newClassMetaDataArray(int length)
MetaDataRepository
newClassMetaDataArray
in class MetaDataRepository
protected FieldMetaData newFieldMetaData(String name, Class type, ClassMetaData owner)
MetaDataRepository
newFieldMetaData
in class MetaDataRepository
protected FieldMetaData[] newFieldMetaDataArray(int length)
MetaDataRepository
newFieldMetaDataArray
in class MetaDataRepository
protected ClassMetaData newEmbeddedClassMetaData(ValueMetaData owner)
MetaDataRepository
newEmbeddedClassMetaData
in class MetaDataRepository
protected ValueMetaData newValueMetaData(FieldMetaData owner)
MetaDataRepository
newValueMetaData
in class MetaDataRepository
protected SequenceMetaData newSequenceMetaData(String name)
MetaDataRepository
newSequenceMetaData
in class MetaDataRepository
protected Order newValueOrder(FieldMetaData owner, boolean asc)
MetaDataRepository
newValueOrder
in class MetaDataRepository
protected Order newRelatedFieldOrder(FieldMetaData owner, FieldMetaData rel, boolean asc)
MetaDataRepository
newRelatedFieldOrder
in class MetaDataRepository
protected Order[] newOrderArray(int size)
MetaDataRepository
newOrderArray
in class MetaDataRepository
protected Version newVersion(ClassMapping cls)
protected Discriminator newDiscriminator(ClassMapping cls)
protected ClassMappingInfo newMappingInfo(ClassMapping cls)
protected FieldMappingInfo newMappingInfo(FieldMapping fm)
protected ValueMappingInfo newMappingInfo(ValueMapping vm)
protected VersionMappingInfo newMappingInfo(Version version)
protected DiscriminatorMappingInfo newMappingInfo(Discriminator disc)
protected ClassStrategy namedStrategy(ClassMapping cls)
protected ClassStrategy instantiateClassStrategy(String name, ClassMapping cls)
protected FieldStrategy namedStrategy(FieldMapping field, boolean installHandlers)
protected DiscriminatorStrategy namedStrategy(Discriminator discrim)
protected DiscriminatorStrategy instantiateDiscriminatorStrategy(String name, Discriminator discrim)
protected VersionStrategy namedStrategy(Version version)
protected VersionStrategy instantiateVersionStrategy(String name, Version version)
protected VersionStrategy instantiateVersionStrategy(Class strat, Version version, String props)
protected ClassStrategy defaultStrategy(ClassMapping cls)
protected ClassStrategy defaultStrategy(ClassMapping cls, boolean adapting)
protected FieldStrategy defaultStrategy(FieldMapping field, boolean installHandlers)
protected FieldStrategy defaultStrategy(FieldMapping field, boolean installHandlers, boolean adapting)
protected FieldStrategy defaultTypeStrategy(FieldMapping field, boolean installHandlers, boolean adapting)
protected FieldStrategy handlerCollectionStrategy(FieldMapping field, ValueHandler ehandler, boolean installHandlers)
protected FieldStrategy handlerMapStrategy(FieldMapping field, ValueHandler khandler, ValueHandler vhandler, boolean krel, boolean vrel, boolean installHandlers)
protected ValueHandler namedHandler(ValueMapping val)
protected ValueHandler defaultHandler(ValueMapping val)
protected ValueHandler defaultHandler(ValueMapping val, boolean adapting)
protected DiscriminatorStrategy defaultStrategy(Discriminator discrim)
protected DiscriminatorStrategy defaultStrategy(Discriminator discrim, boolean adapting)
protected VersionStrategy defaultStrategy(Version version)
protected VersionStrategy defaultStrategy(Version version, boolean adapting)
protected VersionStrategy defaultStrategy(Version vers, FieldMapping vfield)
public void endConfiguration()
Configurable
endConfiguration
in interface Configurable
endConfiguration
in class MetaDataRepository
protected ClassMapping findBaseClassMapping(ClassMapping mapping)
protected void setDefaultInheritanceStrategy(ClassMapping mapping)
protected boolean hasInheritanceStrategy(ClassMapping mapping)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |