org.objectweb.jorm.metainfo.api
Interface ClassMapping
- CommonClassMapping, MappingStructure, MetaObject, Serializable
public interface ClassMapping
This interface gathers methods to the ClassMapping and GenClassMapping
interfaces. It gives the notion of reference
- X. Spengler
addDependency , addPrimitiveElementMapping , addPrimitiveElementMapping , createIdentifierMapping , createReferenceMapping , getAllPrimitiveElementMappings , getDependencies , getIdentifierMapping , getPrimitiveElementMapping , getPrimitiveElementMappings , getRuleName , primitiveElementMappingsIterator , removeDependency , setIdentifierMapping , setRuleName |
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.
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.
superClass
- the super class that will be referenced by this
parent class mapping
- a parent class mapping with in implicit rule to the super class
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)
fieldName
- the name of the field of which the primitive element
mapping must be returnedsearchInSuper
- if true search recursively in super classes
- 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.
referenceName
- is the name of a reference field
- 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.
- a collection.
iterateReferenceMappings
public Iterator iterateReferenceMappings()
Returns an Iterator over ReferenceMapping objects.
- an Iterator.