org.objectweb.jorm.metainfo.api
Interface CommonClassMapping

All Superinterfaces:
MappingStructure, MetaObject, java.io.Serializable
All 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(java.lang.String jormClassName)
          add a dependency to a given jorm class
 void addPrimitiveElementMapping(PrimitiveElementMapping pemapping)
          Adds a PrimitiveElementMapping object.
 void addPrimitiveElementMapping(java.lang.String fieldName, PrimitiveElementMapping pemapping)
          Adds a PrimitiveElementMapping object.
 IdentifierMapping createIdentifierMapping(NameDef nd)
          Creates a new IdentifierMapping object.
 ReferenceMapping createReferenceMapping(java.lang.String ruleName, NameDef nd)
          Creates a new ReferenceMapping object.
 java.util.List getAllPrimitiveElementMappings()
          Returns the list of PEM of the current class and its super classes.
 java.util.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(java.lang.String fieldName)
          Returns the PrimitiveElementMapping objects (hidden or not) matching a given fieldName.
 java.util.Collection getPrimitiveElementMappings()
          Returns the collection of PEM of the current class only defined at the inheritance level, that is, without the inherited ones.
 java.lang.String getRuleName()
          Returns the name of the rule used to map the class.
 java.util.Iterator primitiveElementMappingsIterator()
          Returns an Iterator over PrimitiveElementMapping objects.
 void removeDependency(java.lang.String jormClassName)
          remove a dependency to a given jorm class
 void setIdentifierMapping(IdentifierMapping idmapping)
          Sets the IdentifierMapping object.
 void setRuleName(java.lang.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 Detail

getRuleName

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

Returns:
the name of the class mapping rule.

setRuleName

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

Parameters:
rulename - the class mapping rule name.

getIdentifierMapping

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

Returns:
the IdentifierMapping in this class mapping.

setIdentifierMapping

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

Parameters:
idmapping - the IdentifierMapping object.

getPrimitiveElementMappings

public java.util.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.

getAllPrimitiveElementMappings

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

Returns:
a collection.

getPrimitiveElementMapping

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

addPrimitiveElementMapping

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

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

addPrimitiveElementMapping

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

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

primitiveElementMappingsIterator

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

Returns:
an Iterator.

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

addDependency

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

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

removeDependency

public void removeDependency(java.lang.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

getDependencies

public java.util.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