Dresden OCL Toolkit

tudresden.ocl.sql.orstrategy
Class ClassTypeMapping

java.lang.Object
  extended bytudresden.ocl.sql.orstrategy.ClassTypeMapping
All Implemented Interfaces:
DatatypeStrategy

public class ClassTypeMapping
extends Object
implements DatatypeStrategy

an 'object-relational mapping strategy' for attributes containing modeled classes as type


Field Summary
private  String attributeName
           
private  Map classViews
           
private  Vector objectViews
           
private  Table ownerTable
           
private  ru.novosoft.uml.foundation.core.MClassifier type
           
 
Constructor Summary
ClassTypeMapping(ru.novosoft.uml.foundation.core.MClassifier type)
           
 
Method Summary
private  void fillObjectViews(ru.novosoft.uml.foundation.core.MClassifier owner)
          adds references to ObjectViews of subclasses of the attribute's class
 void map(ru.novosoft.uml.foundation.core.MAttribute attribute, Map classToTables, Map classViews)
          Adds the primary key of the type's main table as foreign key to the table containing the attribute and to the ObjectView of the attribute's class.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

type

private ru.novosoft.uml.foundation.core.MClassifier type

objectViews

private Vector objectViews

attributeName

private String attributeName

ownerTable

private Table ownerTable

classViews

private Map classViews
Constructor Detail

ClassTypeMapping

public ClassTypeMapping(ru.novosoft.uml.foundation.core.MClassifier type)
Parameters:
type - the MClassifier representing an Attributes type
Method Detail

map

public void map(ru.novosoft.uml.foundation.core.MAttribute attribute,
                Map classToTables,
                Map classViews)
Adds the primary key of the type's main table as foreign key to the table containing the attribute and to the ObjectView of the attribute's class. If other classes inherit attribute the reference is added to their ObjectViews, too. The main table is the first Table contained in a classifiers list of table in classToTables.

Specified by:
map in interface DatatypeStrategy
Parameters:
attribute - the attribute having a modeled classifier as type
classToTables - a Map of MClassifier -> (List of Table)
classViews - a Map of MClassifier -> ObjectView
See Also:
Table

fillObjectViews

private void fillObjectViews(ru.novosoft.uml.foundation.core.MClassifier owner)
adds references to ObjectViews of subclasses of the attribute's class


toString

public String toString()
Returns:
the classifier that is the attribute's type

Dresden OCL Toolkit

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