Dresden OCL Toolkit

tudresden.ocl.sql.orstrategy
Class KeyChooser

java.lang.Object
  extended bytudresden.ocl.sql.orstrategy.KeyChooser
All Implemented Interfaces:
KeyStrategy

public class KeyChooser
extends Object
implements KeyStrategy

allows the user to choose one or more attributes as primary key these primary key column are added to every Table the classifier is directly mapped to

Author:
Andrea Kling
See Also:
Table

Field Summary
private  List pk
           
 
Constructor Summary
KeyChooser(List pk)
          the primary Key may contain several attributes.
 
Method Summary
 void map(ru.novosoft.uml.foundation.core.MClassifier classifier, Map classToTables, Map classViews)
          Defines the primary key for all tables this classifier was mapped to.
 String toString()
          a short descrption of the strategy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pk

private List pk
Constructor Detail

KeyChooser

public KeyChooser(List pk)
the primary Key may contain several attributes. none of these attributes should have another than a simple datatype as for example defined in TypeManager

Parameters:
pk - a List of MAttribute of all attributes that are to be used as primary key columns
See Also:
TypeManager
Method Detail

map

public void map(ru.novosoft.uml.foundation.core.MClassifier classifier,
                Map classToTables,
                Map classViews)
Defines the primary key for all tables this classifier was mapped to. Structure of classToTables: MClassifier -> List of Table the first Table listed gets the primary key other class tables refer to the primary key chosen will be used to identify rows in the Classifiers ObjectView

Specified by:
map in interface KeyStrategy
Parameters:
classifier - the class, whose primary key shall be set
classToTables - a List of Table for each class mapped.
classViews - contains an ObjectView for every MClassifier
See Also:
ObjectView, Table

toString

public String toString()
a short descrption of the 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.