org.objectweb.jorm.metainfo.api
Interface ClassMapping

All Superinterfaces:
CommonClassMapping, MappingStructure, MetaObject, java.io.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.
 Class getJormClass()
           
 ParentClassMapping getParentClassMapping(java.lang.String className)
           
 java.util.Collection getParentClassMappings()
           
 PrimitiveElementMapping getPrimitiveElementMapping(java.lang.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(java.lang.String referenceName)
          Retrieves the ReferenceMapping instance corresponding to the name of a reference field.
 java.util.Collection getReferenceMappings()
          Returns a collection of ReferenceMapping objects.
 java.util.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 Detail

getJormClass

public Class getJormClass()
Returns:
the JORM Class linked to the ClassMapping. This JORM class is also the linkedMO. The getLinkedMO() method returns a MetaObject and not a Class object.

addReferenceMapping

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

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

getReferenceMapping

public ReferenceMapping getReferenceMapping(java.lang.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

iterateReferenceMappings

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

Returns:
an Iterator.

getReferenceMappings

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

Returns:
a collection.

getParentClassMappings

public java.util.Collection getParentClassMappings()

getParentClassMapping

public ParentClassMapping getParentClassMapping(java.lang.String className)

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

getPrimitiveElementMapping

public PrimitiveElementMapping getPrimitiveElementMapping(java.lang.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

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.