org.objectweb.speedo.generation.jorm
Interface JormMIMappingBuilder

All Known Implementing Classes:
OneTableRdbJormIMappingBuilder

public interface JormMIMappingBuilder

This interface defines a builder of the mapping part of the Jorm meta information. It must be implemented for each mapper.

Author:
S.Chassande-Barrioz

Method Summary
 org.objectweb.jorm.metainfo.api.ClassMapping createClassMapping(org.objectweb.jorm.metainfo.api.Class clazz, SpeedoClass sc, org.objectweb.jorm.metainfo.api.Mapping mapping)
          It builds a ClassMapping, assignes it to the mapping and builds mapping structure for the class (RdbTable, directory name, ...).
 org.objectweb.jorm.metainfo.api.PrimitiveElementMapping createFieldMapping(org.objectweb.jorm.metainfo.api.PrimitiveElement pe, SpeedoElement selem, org.objectweb.jorm.metainfo.api.CommonClassMapping cm)
          It creates the mapping of a primitive field.
 org.objectweb.jorm.metainfo.api.GenClassMapping createGenClassMapping(org.objectweb.jorm.metainfo.api.GenClassRef gcr, SpeedoField sf, org.objectweb.jorm.metainfo.api.Mapping mapping)
          It builds a GenClassMapping, assignes it to the mapping and builds mapping structure for the class (RdbTable, directory name, ...).
 void createNameDefMapping(org.objectweb.jorm.metainfo.api.CommonClassMapping cm, org.objectweb.jorm.metainfo.api.NameDef nd, SpeedoClass sc, boolean isIdentifier, boolean isInGenClass)
          It creates the mapping of a name def (reference or identifier).
 void finalizeClassMapping(SpeedoClass sc, java.lang.String projectName, java.lang.String mapperName)
          It finishes the filling of a ClassMapping (Inheritance for example).
 

Method Detail

createClassMapping

public org.objectweb.jorm.metainfo.api.ClassMapping createClassMapping(org.objectweb.jorm.metainfo.api.Class clazz,
                                                                       SpeedoClass sc,
                                                                       org.objectweb.jorm.metainfo.api.Mapping mapping)
                                                                throws org.objectweb.jorm.api.PException,
                                                                       SpeedoException
It builds a ClassMapping, assignes it to the mapping and builds mapping structure for the class (RdbTable, directory name, ...).

Parameters:
clazz - is the Jorm meta object representing the class which the ClassMapping must be built.
mapping - is the Mapping instance which will host the ClassMapping.
Returns:
the ClassMapping instance built by the method (never null).
Throws:
org.objectweb.jorm.api.PException - if it is not possible to build the ClassMapping
SpeedoException

finalizeClassMapping

public void finalizeClassMapping(SpeedoClass sc,
                                 java.lang.String projectName,
                                 java.lang.String mapperName)
                          throws org.objectweb.jorm.api.PException,
                                 SpeedoException
It finishes the filling of a ClassMapping (Inheritance for example).

Throws:
org.objectweb.jorm.api.PException - if it is not possible to build the ClassMapping
SpeedoException

createGenClassMapping

public org.objectweb.jorm.metainfo.api.GenClassMapping createGenClassMapping(org.objectweb.jorm.metainfo.api.GenClassRef gcr,
                                                                             SpeedoField sf,
                                                                             org.objectweb.jorm.metainfo.api.Mapping mapping)
                                                                      throws org.objectweb.jorm.api.PException,
                                                                             SpeedoException
It builds a GenClassMapping, assignes it to the mapping and builds mapping structure for the class (RdbTable, directory name, ...).

Parameters:
gcr - is the Jorm meta object representing the gen class which the GenClassMapping must be built.
mapping - is the Mapping instance which will host the GenClassMapping.
Returns:
the GenClassMapping instance built by the method (never null).
Throws:
org.objectweb.jorm.api.PException - if it is not possible to build the GenClassMapping
SpeedoException

createFieldMapping

public org.objectweb.jorm.metainfo.api.PrimitiveElementMapping createFieldMapping(org.objectweb.jorm.metainfo.api.PrimitiveElement pe,
                                                                                  SpeedoElement selem,
                                                                                  org.objectweb.jorm.metainfo.api.CommonClassMapping cm)
                                                                           throws org.objectweb.jorm.api.PException,
                                                                                  SpeedoException
It creates the mapping of a primitive field.

Parameters:
pe - is the Jorm meta object representing a primitive field
cm - is the MappingStructure which will host the mapping of the field
Returns:
a PrimitiveElementMapping corresponding to the given primitive field.
Throws:
org.objectweb.jorm.api.PException - if it is not possible to build the mapping of the primitive field.
SpeedoException

createNameDefMapping

public void createNameDefMapping(org.objectweb.jorm.metainfo.api.CommonClassMapping cm,
                                 org.objectweb.jorm.metainfo.api.NameDef nd,
                                 SpeedoClass sc,
                                 boolean isIdentifier,
                                 boolean isInGenClass)
                          throws org.objectweb.jorm.api.PException,
                                 SpeedoException
It creates the mapping of a name def (reference or identifier).

Parameters:
cm - is the MappingStructure which will host the mapping of the fields of the name def
nd - is the NameDef which must be mapped.
Throws:
org.objectweb.jorm.api.PException - if it is not possible to build the mapping of the field.
SpeedoException