tudresden.ocl.sql.orstrategy
Class InheritanceMapping
java.lang.Object
tudresden.ocl.sql.orstrategy.InheritanceMapping
- All Implemented Interfaces:
- InheritanceStrategy
- public class InheritanceMapping
- extends Object
- implements InheritanceStrategy
This strategy uses real inheritance in mapping. It is assumed that
each class is already mapped to one or more tables, according to
its attributes. To map inheritance each Table of a subclass
gets a foreign key to the Table of it's superclass so that
in combining a classes table with those of all superclasses you
get the full object with all inherited attributes.
Handles only single inheritance so far
Method Summary |
static InheritanceMapping |
getInstance()
|
void |
map(ru.novosoft.uml.foundation.core.MClassifier root,
Map classToTables,
Map classViews)
To map inheritance each Table of a subclass
gets a foreign key to the Table of it's superclass so that
in combining a classes table with those of all superclasses you
get the full object with all inherited attributes. |
private void |
pushDownKey(ru.novosoft.uml.foundation.core.MClassifier root,
ObjectView copyDownView)
runs through the inheritance tree to perform mapping |
String |
toString()
a short description of the mapping strategy |
myInstance
private static InheritanceMapping myInstance
classToTables
private Map classToTables
classViews
private Map classViews
InheritanceMapping
private InheritanceMapping()
getInstance
public static InheritanceMapping getInstance()
map
public void map(ru.novosoft.uml.foundation.core.MClassifier root,
Map classToTables,
Map classViews)
- To map inheritance each Table of a subclass
gets a foreign key to the Table of it's superclass so that
in combining a classes table with those of all superclasses you
get the full object with all inherited attributes. All Tables
needed for that will be contained in the the Classifiers List of Table.
The classifiers ObjectView already contains that combination
- Specified by:
map
in interface InheritanceStrategy
- Parameters:
root
- the class or interface that is the highest defined 'superclassifier'
of an inheritance treeclassToTables
- contains a List of Table for every MClassifier mappedclassViews
- contains an ObjectView for every MClassifier- See Also:
ObjectView
,
Table
pushDownKey
private void pushDownKey(ru.novosoft.uml.foundation.core.MClassifier root,
ObjectView copyDownView)
- runs through the inheritance tree to perform mapping
toString
public String toString()
- a short description of the mapping strategy
Submit a bug
Developed at the Dresden University of Technology.
This software is published under the GNU Lesser General Public License.