Dresden OCL Toolkit

tudresden.ocl.sql.orstrategy
Class InheritanceMapping

java.lang.Object
  extended bytudresden.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


Field Summary
private  Map classToTables
           
private  Map classViews
           
private static InheritanceMapping myInstance
           
 
Constructor Summary
private InheritanceMapping()
           
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

myInstance

private static InheritanceMapping myInstance

classToTables

private Map classToTables

classViews

private Map classViews
Constructor Detail

InheritanceMapping

private InheritanceMapping()
Method Detail

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 tree
classToTables - contains a List of Table for every MClassifier mapped
classViews - 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


Dresden OCL Toolkit

Submit a bug
Developed at the Dresden University of Technology.
This software is published under the GNU Lesser General Public License.