org.objectweb.speedo.generation.mivisitor
Class ORMappingGenerator
java.lang.Object
org.objectweb.speedo.generation.lib.AbstractGeneratorComponent
org.objectweb.speedo.generation.mivisitor.ORMappingGenerator
- All Implemented Interfaces:
- GeneratorComponent
public class ORMappingGenerator
- extends AbstractGeneratorComponent
This Speedo Meta information visitor builds and fills the Speedo Meta
information concerning the OR mapping information. It defines a SpeedoTable,
SpeedoColumn, SpeedoJoin where it is required.
This SMI visitor cannot be inclued with other SMI visitor. Indeed it requires
that all meta information is complete (for all classes). In particular it
needs the result of the Class analyser visitor. For this reason this SMI
visitor is a simple GeneratorComponent to use when SMI is complete.
In addition, due to dependency between classes (relation ship, inheritance)
the visit of classes must be done in a particular order. For these reasons,
this Visitor visits the SMI with a help of two internal classes (
VisitRequired and VisitRemeber).
- Author:
- S.Chassande-Barrioz
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOGGER_NAME
public static final java.lang.String LOGGER_NAME
- See Also:
- Constant Field Values
ORMappingGenerator
public ORMappingGenerator(Personality p)
getTitle
public java.lang.String getTitle()
- Specified by:
getTitle
in interface GeneratorComponent
- Overrides:
getTitle
in class AbstractGeneratorComponent
- Returns:
- a short string (less than 30 characters) representing the
title of the component. This string must indicate job of the component.
getLoggerName
protected java.lang.String getLoggerName()
init
public boolean init()
throws SpeedoException
- Description copied from interface:
GeneratorComponent
- Initializes the component
- Specified by:
init
in interface GeneratorComponent
- Specified by:
init
in class AbstractGeneratorComponent
- Returns:
- boolean value indicating if the process method can be called.
- Throws:
SpeedoException
- if the component initialization fails
process
public void process()
throws SpeedoException
- Description copied from interface:
GeneratorComponent
- Do the job of the component.
- Specified by:
process
in interface GeneratorComponent
- Specified by:
process
in class AbstractGeneratorComponent
- Throws:
SpeedoException
- if the component initialization fails
visitClassRefFieldExtension
public void visitClassRefFieldExtension(SpeedoField sf)
throws SpeedoException
- Visit extensions of field referencing a persistent class. This method
converts old Extensions 'source-foreign-keys' and 'target-foreign-keys'
to mapping definition in the Speedo meta information.
- Parameters:
sf
- a persistent field referencing a persistent class.
- Throws:
SpeedoException
- See Also:
SpeedoProperties.SOURCE_FK
,
SpeedoProperties.TARGET_FK
visitGenClassRefFieldExtension
public void visitGenClassRefFieldExtension(SpeedoField sf)
throws SpeedoException
- Visit extensions of field referencing a genclass. This method
converts old Extensions 'source-foreign-keys', 'target-foreign-keys'
and 'join-table' to mapping definition in the Speedo meta information.
- Parameters:
sf
- a persistent field referencing a genclass.
- Throws:
SpeedoException
- See Also:
SpeedoProperties.SOURCE_FK
,
SpeedoProperties.TARGET_FK
,
SpeedoProperties.JOIN_TABLE