org.objectweb.jorm.metainfo.api

Interface CommonClassMapping

All Superinterfaces:
MappingStructure, MetaObject, Serializable
Known Subinterfaces:
ClassMapping, GenClassMapping

public interface CommonClassMapping
extends MappingStructure

This interface gather methods to the ClassMapping and GenClassMapping interfaces. It defines getter/setter for - mapping rule name: it defines how the class on the database structures. it is usefull when a class can be mapped in different ways. For instance, with a mapping to relational tables, a class can be mapped to one or more joined tables. Even though this method is shared by all class mapping implementation, values set and get are only meaningfull in those implementations - identifier mapping: it defines how the identifier of the class is mapped - primitive element mappings (PEMs): they defined how primitive elements are mapped at this level. Note that the referenced primitive element can be defined at an upper level in the inheritance hierarchy. Also note that PEMs are inherited and that inherited PEMs can be retrieved using the getAllPrimitiveElements() method - reference mappings (RMs): TODO: description - dependencies: TODO: description

Method Summary

void
addDependency(String jormClassName)
add a dependency to a given jorm class
void
addPrimitiveElementMapping(String fieldName, PrimitiveElementMapping pemapping)
Adds a PrimitiveElementMapping object.
void
addPrimitiveElementMapping(PrimitiveElementMapping pemapping)
Adds a PrimitiveElementMapping object.
IdentifierMapping
createIdentifierMapping(NameDef nd)
Creates a new IdentifierMapping object.
ReferenceMapping
createReferenceMapping(String ruleName, NameDef nd)
Creates a new ReferenceMapping object.
List
getAllPrimitiveElementMappings()
Returns the list of PEM of the current class and it super classes.
Collection
getDependencies()
Returns the set of class names (Strings) of which the class mapping is dependent
IdentifierMapping
getIdentifierMapping()
Returns the IdentifierMapping in this class mapping.
PrimitiveElementMapping
getPrimitiveElementMapping(String fieldName)
Returns the PrimitiveElementMapping objects (hidden or not) matching a given fieldName.
Collection
getPrimitiveElementMappings()
Returns the collection of PEM of the current class only defined at the inheritance level, that is, without the inherited ones.
String
getRuleName()
Returns the name of the rule used to map the class.
Iterator
primitiveElementMappingsIterator()
Returns an Iterator over PrimitiveElementMapping objects.
void
removeDependency(String jormClassName)
remove a dependency to a given jorm class
void
setIdentifierMapping(IdentifierMapping idmapping)
Sets the IdentifierMapping object.
void
setRuleName(String rulename)
Sets the name of the rule used to map the class.

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

addDependency

public void addDependency(String jormClassName)
add a dependency to a given jorm class

Parameters:
jormClassName - the name of the class to which depends the class mapping


addPrimitiveElementMapping

public void addPrimitiveElementMapping(String fieldName,
                                       PrimitiveElementMapping pemapping)
Adds a PrimitiveElementMapping object.

Parameters:
pemapping - the PrimitiveElementMapping object to add to the list.


addPrimitiveElementMapping

public void addPrimitiveElementMapping(PrimitiveElementMapping pemapping)
Adds a PrimitiveElementMapping object.

Parameters:
pemapping - the PrimitiveElementMapping object to add to the list.


createIdentifierMapping

public IdentifierMapping createIdentifierMapping(NameDef nd)
Creates a new IdentifierMapping object.

Parameters:
nd - the NameDef object that defines an object identifier.

Returns:
an IdentifierMapping object.


createReferenceMapping

public ReferenceMapping createReferenceMapping(String ruleName,
                                               NameDef nd)
Creates a new ReferenceMapping object.

Parameters:
ruleName - the name of the rule used to map the reference, nd the NameDef object that defines an object reference.

Returns:
a ReferenceMapping object.


getAllPrimitiveElementMappings

public List getAllPrimitiveElementMappings()
Returns the list of PEM of the current class and it super classes. The list is ordered by field names.

Returns:
a collection.


getDependencies

public Collection getDependencies()
Returns the set of class names (Strings) of which the class mapping is dependent

Returns:
the set of class names (Strings) of which the class mapping is dependent


getIdentifierMapping

public IdentifierMapping getIdentifierMapping()
Returns the IdentifierMapping in this class mapping.

Returns:
the IdentifierMapping in this class mapping.


getPrimitiveElementMapping

public PrimitiveElementMapping getPrimitiveElementMapping(String fieldName)
Returns the PrimitiveElementMapping objects (hidden or not) matching a given fieldName.

Parameters:
fieldName - the name of the primitivite field (hidden or not) of the class of which the PEM must be returned

Returns:
the PEM matching the given field name


getPrimitiveElementMappings

public Collection getPrimitiveElementMappings()
Returns the collection of PEM of the current class only defined at the inheritance level, that is, without the inherited ones.

Returns:
a collection.


getRuleName

public String getRuleName()
Returns the name of the rule used to map the class.

Returns:
the name of the class mapping rule.


primitiveElementMappingsIterator

public Iterator primitiveElementMappingsIterator()
Returns an Iterator over PrimitiveElementMapping objects.

Returns:
an Iterator.


removeDependency

public void removeDependency(String jormClassName)
remove a dependency to a given jorm class

Parameters:
jormClassName - the name of the class to which the class mapping does not depend anymore


setIdentifierMapping

public void setIdentifierMapping(IdentifierMapping idmapping)
Sets the IdentifierMapping object.

Parameters:
idmapping - the IdentifierMapping object.


setRuleName

public void setRuleName(String rulename)
Sets the name of the rule used to map the class.

Parameters:
rulename - the class mapping rule name.