org.objectweb.jorm.metainfo.api

Interface ClassMapping

All Superinterfaces:
CommonClassMapping, MappingStructure, MetaObject, Serializable

public interface ClassMapping
extends CommonClassMapping

This interface gathers methods to the ClassMapping and GenClassMapping interfaces. It gives the notion of reference

Author:
X. Spengler

Method Summary

void
addImplicitDependencies()
Add implicit dependencies of mapping structure creation to mapping structure definition.
void
addReferenceMapping(ReferenceMapping refMapping)
Adds a ReferenceMapping object.
ParentClassMapping
createImplicitParentClassMapping(Class superClass)
Creates a implicit parent class mapping.
ParentClassMapping
getParentClassMapping(String className)
Collection
getParentClassMappings()
PrimitiveElementMapping
getPrimitiveElementMapping(String fieldName, boolean searchInSuper)
Get the primitive element mapping corresponding to a field name by searching recursively in the super classes until it is found (if requested)
ReferenceMapping
getReferenceMapping(String referenceName)
Retrieves the ReferenceMapping instance corresponding to the name of a reference field.
Collection
getReferenceMappings()
Returns a collection of ReferenceMapping objects.
Iterator
iterateReferenceMappings()
Returns an Iterator over ReferenceMapping objects.

Methods inherited from interface org.objectweb.jorm.metainfo.api.CommonClassMapping

addDependency, addPrimitiveElementMapping, addPrimitiveElementMapping, createIdentifierMapping, createReferenceMapping, getAllPrimitiveElementMappings, getDependencies, getIdentifierMapping, getPrimitiveElementMapping, getPrimitiveElementMappings, getRuleName, primitiveElementMappingsIterator, removeDependency, setIdentifierMapping, setRuleName

Methods inherited from interface org.objectweb.jorm.metainfo.api.MappingStructure

getLinkedMO, getMapperName, getProjectName, setLinkedMO

Methods inherited from interface org.objectweb.jorm.metainfo.api.MetaObject

getParent, setParent

Method Details

addImplicitDependencies

public void addImplicitDependencies()
Add implicit dependencies of mapping structure creation to mapping structure definition. For example, in the case of relational mappings, the creation of tables cannot be known until all the columns of the table is known and those columns may not be known until the mapping of super/sub classes is known.


addReferenceMapping

public void addReferenceMapping(ReferenceMapping refMapping)
Adds a ReferenceMapping object.

Parameters:
refMapping - the ReferenceMapping object to add to the list.


createImplicitParentClassMapping

public ParentClassMapping createImplicitParentClassMapping(Class superClass)
Creates a implicit parent class mapping. This method is called to create parent class mapping to super classes for which there is no parent class mapping defined, which means that an implicit inheritance rule of mapping should be applied. For example, with the rdb mapper, this implicit rule is to inherit all the mappings defined in the super class.

Parameters:
superClass - the super class that will be referenced by this parent class mapping

Returns:
a parent class mapping with in implicit rule to the super class


getParentClassMapping

public ParentClassMapping getParentClassMapping(String className)


getParentClassMappings

public Collection getParentClassMappings()


getPrimitiveElementMapping

public PrimitiveElementMapping getPrimitiveElementMapping(String fieldName,
                                                          boolean searchInSuper)
Get the primitive element mapping corresponding to a field name by searching recursively in the super classes until it is found (if requested)

Parameters:
fieldName - the name of the field of which the primitive element mapping must be returned
searchInSuper - if true search recursively in super classes

Returns:
the primitive element mapping if found, null otherwise


getReferenceMapping

public ReferenceMapping getReferenceMapping(String referenceName)
Retrieves the ReferenceMapping instance corresponding to the name of a reference field.

Parameters:
referenceName - is the name of a reference field

Returns:
a ReferenceMapping instance or a null value if no mapping is defined for the reference name


getReferenceMappings

public Collection getReferenceMappings()
Returns a collection of ReferenceMapping objects.

Returns:
a collection.


iterateReferenceMappings

public Iterator iterateReferenceMappings()
Returns an Iterator over ReferenceMapping objects.

Returns:
an Iterator.