| java.lang.Object org.objectweb.speedo.generation.jorm.rdb.RdbJORMMapping
RdbJORMMapping | public class RdbJORMMapping implements JormMIMappingBuilder,SpeedoProperties,Loggable(Code) | | This class is an implementation of the JormMIMappingBuilder for the mapper
rdb and its sub mappers. It defines the O/R mapping of persistent classes.
It supports the mapping a of a class into several tables (multi table class
mapping).
author: S.Chassande-Barrioz |
Method Summary | |
public void | createClassIdentifierNameDefMapping(ClassMapping cm, NameDef nd, SpeedoClass sc, MIBuilderHelper mibh) Maps the identifier fields. | public ClassMapping | createClassMapping(Class clazz, SpeedoClass sc, Mapping mapping) Defines the mapping the a class. | public void | createClassRefNameDefMapping(ClassMapping cm, NameDef nd, SpeedoCommonField sf) Creates the mapping of the name def (JORM meta object) corresponding to
a reference to a persistent class from a persistent class. | public void | createClassRefNameDefMapping(GenClassMapping gcm, NameDef nd, SpeedoField sf) Creates the mapping of the name def (JORM meta object) corresponding to
a reference to a persistent class from a generic persistent class.
The class reference is always stored in into the table of the genric
class. | public PrimitiveElementMapping | createFieldMapping(PrimitiveElement pe, SpeedoField sf, ClassMapping cm) Creates a PEM (PrimitiveElementMapping) for a PrimitiveElement. | public PrimitiveElementMapping | createFieldMapping(PrimitiveElement pe, SpeedoInheritedField sif, ClassMapping cm) Creates a PEM (PrimitiveElementMapping) for a PrimitiveElement. | public PrimitiveElementMapping | createFieldMapping(PrimitiveElement pe, SpeedoNoFieldColumn snfc, ClassMapping cm) Creates a PEM (PrimitiveElementMapping) for a PrimitiveElement. | public PrimitiveElementMapping | createGenClassElementMapping(PrimitiveElement pe, SpeedoField sf, GenClassMapping gcm) It creates the mapping of a primitive field (element of the generic
class).
Parameters: pe - is the Jorm meta object representing a primitive field Parameters: gcm - is the MappingStructure which will host the mapping of thefield Parameters: sf - is the Speedo meta object representing the persistent fieldreferencing a generic class. | public void | createGenClassIdentifierNameDefMapping(GenClassMapping gcm, NameDef nd, SpeedoField sf, MIBuilderHelper mibh) Creates the mapping of the name def (JORM meta object) corresponding to
the identifier of a persistent generic class (collection, map, ...). | public PrimitiveElementMapping | createGenClassIndexMapping(PrimitiveElement pe, SpeedoField sf, GenClassMapping gcm) It creates the mapping of a primitive field used as index in the generic
class.
Parameters: pe - is the Jorm meta object representing a primitive field Parameters: gcm - is the MappingStructure which will host the mapping of thefield Parameters: sf - is the Speedo meta object representing the persistent fieldreferencing a generic class. | public GenClassMapping | createGenClassMapping(GenClassRef gcr, SpeedoField sf, Mapping mapping) 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 theGenClassMapping must be built. Parameters: mapping - is the Mapping instance which will host the GenClassMapping. Parameters: sf - is the SpeedoField corresponding to the generic class. | public void | createGenClassRefNameDefMapping(ClassMapping cm, NameDef nd, SpeedoCommonField sf) | public Logger | getLogger() | public LoggerFactory | getLoggerFactory() | public void | setLogger(Logger logger) | public void | setLoggerFactory(LoggerFactory loggerFactory) |
createClassIdentifierNameDefMapping | public void createClassIdentifierNameDefMapping(ClassMapping cm, NameDef nd, SpeedoClass sc, MIBuilderHelper mibh) throws PException, SpeedoException(Code) | | Maps the identifier fields.
Parameters: cm - is the JORM meta object representing the mapping of a persistent class. Parameters: nd - is the JORM meta object representing the name definition of thepersistent class. Parameters: sc - is the Speedo meta object representing the persistent class Parameters: mibh - is a helper for the building of the JORM meta information. |
createClassMapping | public ClassMapping createClassMapping(Class clazz, SpeedoClass sc, Mapping mapping) throws PException, SpeedoException(Code) | | Defines the mapping the a class. It creates the table(s) where the
class is stored. When there are several tables (multitable mapping) or
in case of vertical inheritance, this method bulds the join between
the main table and the secondary table.
Parameters: clazz - is the JORM meta object representing the persistent class. Parameters: sc - is the Speedo meta object representing the persistent class. Parameters: mapping - is the JORM Meta object associated to the persistent class the JORM meta object of mapping corresponding to the class. |
createClassRefNameDefMapping | public void createClassRefNameDefMapping(ClassMapping cm, NameDef nd, SpeedoCommonField sf) throws PException, SpeedoException(Code) | | Creates the mapping of the name def (JORM meta object) corresponding to
a reference to a persistent class from a persistent class.
According to the mapping information hold by the SpeedoField, the
Class Reference is mapped in the main table or in an external table.
The external can be the table of the targeted class in case of One-One
relationship.
As the implementation of this method is a bit complex, it has been divided
in two local methods:
- createLocalClassRefNameDefMapping
- createExternalClassRefNameDefMapping
Parameters: cm - is the MappingStructure which will host the mapping of the reference Parameters: nd - is the namedef corresponding to the reference Parameters: sf - is the Speedo meta object representing the persistent field.referencing a class. See Also: RdbJORMMapping.createLocalClassRefNameDefMapping(RdbClassMultiMapping,Class,SpeedoCommonField,NameDef,NameDef,SpeedoClass) See Also: RdbJORMMapping.createExternalClassRefNameDefMapping(RdbClassMultiMapping,Class,SpeedoCommonField,NameDef,RdbClassMultiMapping,NameDef,SpeedoClass) |
createClassRefNameDefMapping | public void createClassRefNameDefMapping(GenClassMapping gcm, NameDef nd, SpeedoField sf) throws PException, SpeedoException(Code) | | Creates the mapping of the name def (JORM meta object) corresponding to
a reference to a persistent class from a generic persistent class.
The class reference is always stored in into the table of the genric
class. But it is important to check if the column used for the class
reference can be reused for index or generic class identifier.
Parameters: gcm - is the MappingStructure which will host the mapping of the reference Parameters: nd - is the namedef corresponding to the reference Parameters: sf - is the Speedo meta object representing the persistent fieldreferencing a generic class. |
createFieldMapping | public PrimitiveElementMapping createFieldMapping(PrimitiveElement pe, SpeedoField sf, ClassMapping cm) throws PException, SpeedoException(Code) | | Creates a PEM (PrimitiveElementMapping) for a PrimitiveElement. The PEM
is created only if the column does not already exist in the table
Parameters: pe - is the primitive element to map Parameters: sf - is the persistent field holding column definition Parameters: cm - is the RdbClassMapping correponding to the persistent classowning the field. It permits to find tha table where the field is mapped. the created or existing PEM corresponding to the specifiedcolumn name. |
createFieldMapping | public PrimitiveElementMapping createFieldMapping(PrimitiveElement pe, SpeedoInheritedField sif, ClassMapping cm) throws PException, SpeedoException(Code) | | Creates a PEM (PrimitiveElementMapping) for a PrimitiveElement. The PEM
is created only if the column does not already exist in the table
Parameters: pe - is the primitive element to map Parameters: sif - is the persistent field holding column definition Parameters: cm - is the RdbClassMapping correponding to the persistent classowning the field. It permits to find tha table where the field is mapped. the created or existing PEM corresponding to the specifiedcolumn name. |
createFieldMapping | public PrimitiveElementMapping createFieldMapping(PrimitiveElement pe, SpeedoNoFieldColumn snfc, ClassMapping cm) throws PException, SpeedoException(Code) | | Creates a PEM (PrimitiveElementMapping) for a PrimitiveElement. The PEM
is created only if the column does not already exist in the table
Parameters: pe - is the primitive element to map Parameters: sif - is the persistent field holding column definition Parameters: cm - is the RdbClassMapping correponding to the persistent classowning the field. It permits to find tha table where the field is mapped. the created or existing PEM corresponding to the specifiedcolumn name. |
createGenClassElementMapping | public PrimitiveElementMapping createGenClassElementMapping(PrimitiveElement pe, SpeedoField sf, GenClassMapping gcm) throws PException, SpeedoException(Code) | | It creates the mapping of a primitive field (element of the generic
class).
Parameters: pe - is the Jorm meta object representing a primitive field Parameters: gcm - is the MappingStructure which will host the mapping of thefield Parameters: sf - is the Speedo meta object representing the persistent fieldreferencing a generic class. a PrimitiveElementMapping corresponding to the given primitivefield. throws: PException - if it is not possible to build the mapping of theprimitive field. |
createGenClassIdentifierNameDefMapping | public void createGenClassIdentifierNameDefMapping(GenClassMapping gcm, NameDef nd, SpeedoField sf, MIBuilderHelper mibh) throws PException, SpeedoException(Code) | | Creates the mapping of the name def (JORM meta object) corresponding to
the identifier of a persistent generic class (collection, map, ...).
Parameters: gcm - is the MappingStructure which will host the mapping of the generic class Parameters: nd - is the namedef corresponding to the identifier of the generic class Parameters: sf - is the Speedo meta object representing the persistent fieldreferencing a generic class. |
createGenClassIndexMapping | public PrimitiveElementMapping createGenClassIndexMapping(PrimitiveElement pe, SpeedoField sf, GenClassMapping gcm) throws PException, SpeedoException(Code) | | It creates the mapping of a primitive field used as index in the generic
class.
Parameters: pe - is the Jorm meta object representing a primitive field Parameters: gcm - is the MappingStructure which will host the mapping of thefield Parameters: sf - is the Speedo meta object representing the persistent fieldreferencing a generic class. a PrimitiveElementMapping corresponding to the given primitivefield. throws: PException - if it is not possible to build the mapping of theprimitive field. |
createGenClassMapping | public GenClassMapping createGenClassMapping(GenClassRef gcr, SpeedoField sf, Mapping mapping) throws PException, SpeedoException(Code) | | 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 theGenClassMapping must be built. Parameters: mapping - is the Mapping instance which will host the GenClassMapping. Parameters: sf - is the SpeedoField corresponding to the generic class. the GenClassMapping instance built by the method (never null). throws: PException - if it is not possible to build the GenClassMapping |
getLogger | public Logger getLogger()(Code) | | |
getLoggerFactory | public LoggerFactory getLoggerFactory()(Code) | | |
setLogger | public void setLogger(Logger logger)(Code) | | |
setLoggerFactory | public void setLoggerFactory(LoggerFactory loggerFactory)(Code) | | |
|
|