|
Dresden OCL Toolkit | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttudresden.ocl.sql.ORMappingImpl
Implementation of the ORMapping interface. This class represents an object-relational mapping for UML models to relational database Tables. To make the actual mapping as flexible as possible special mapping strategies can be assigned to different modelelements or be set as default strategies for mapping of kinds of modelelements.
ClassStrategy
,
KeyStrategy
,
DatatypeStrategy
,
InheritanceStrategy
,
OrderedStrategy
,
AssociationStrategy
Field Summary | |
private Hashtable |
associationEnds
|
private Set |
associations
|
private Hashtable |
associationStrategies
|
private Hashtable |
associationTables
|
static String |
CLASS
marks a ClassStrategy |
private Set |
classAttributes
|
private Set |
classifiers
|
private Hashtable |
classStrategies
|
private Hashtable |
classToTables
|
private Hashtable |
classViews
|
private Hashtable |
datatypeStrategies
|
private Map |
defaultStrategies
|
private Set |
generalizationRoots
|
static String |
INHERIT
marks an InheritanceStrategy |
private Hashtable |
inheritanceStrategies
|
private Hashtable |
keyStrategies
|
static String |
MANY_MANY
marks an AssociationStrategy that can be used to map N:M Associations |
private Hashtable |
nameToClassifier
|
private Hashtable |
navigationGuides
|
static String |
ONE_MANY
marks an AssociationStrategy that can be used to map 1:N or 0..1:N Associations |
static String |
ONE_ONE
marks an AssociationStrategy that can be used to map 1:1 or 0..1:1 Associations |
static String |
ORDERED
marks an OrderedStrategy |
private Hashtable |
orderStrategies
|
static String |
PK
marks a KeyStrategy |
private Set |
tables
|
private ru.novosoft.uml.model_management.MModel |
theModel
|
static String |
TYPE
marks a DatatypeStrategy |
private Set |
undefinedAttributes
|
Constructor Summary | |
ORMappingImpl(ru.novosoft.uml.model_management.MModel theModel,
ModelAdjuster ma)
|
Method Summary | |
Map |
associationEnds(String classifier)
returns a Map containing the name of the classifier for every association (opposite roleName) classifier takes part in |
Set |
attributes(String classifier)
returns a Set containing the names of all attributes of classifier |
Set |
classifiers()
returns the names of all classifiers the ModelAdjuster selected for mapping |
Set |
directSupertypeNames(String classifier)
|
Set |
getAssociations()
|
ru.novosoft.uml.foundation.core.MClassifier |
getClassifier(String name)
|
List |
getClassTables(String classifier)
contains all Tables classifier has been mapped to, including Tables containing inherited attributes and external attribute tables |
ObjectView |
getClassView(String classifier)
returns the ObjectView for classifier. |
Set |
getClassViews()
returns a Set of ObjectView containg ObjectViews for all classifiers mapped |
Set |
getGeneralizationRoots()
returns all generalization roots marked for mapping |
Set |
getUndefinedAttributes()
contains all attributes having a type undefined in TypeManager and no classifier defined in this Model |
List |
guidesToAssociationEnds(String classifier,
String assEnd)
returns a List containing the Guide to the ObjectView of the classifier corresponding the Associationend role name assEnd |
void |
map()
initiates the mapping process |
Set |
operations(String classifier)
returns a Set containing the names of all operations of classifier |
void |
setDefaultStrategies(Map strategies)
sets default strategies for modelelements strategies should map Strategykinds as defined in ORMappingImpl to concrete strategies |
void |
setStrategy(ru.novosoft.uml.foundation.core.MAssociation association,
AssociationStrategy strategy)
sets a special mapping strategy for association |
void |
setStrategy(ru.novosoft.uml.foundation.core.MAssociationEnd associationEnd,
OrderedStrategy strategy)
sets a special mapping strategy for an ordered association end |
void |
setStrategy(ru.novosoft.uml.foundation.core.MAttribute attribute,
DatatypeStrategy strategy)
sets a special mapping strategy for attribute's datatype |
void |
setStrategy(ru.novosoft.uml.foundation.core.MClassifier classifier,
ClassStrategy strategy)
sets a special mapping strategy for classifier |
void |
setStrategy(ru.novosoft.uml.foundation.core.MClassifier generalizationRoot,
InheritanceStrategy strategy)
sets a special mapping strategy for a generalization |
void |
setStrategy(ru.novosoft.uml.foundation.core.MClassifier classifier,
KeyStrategy strategy)
sets a special mapping strategy for classifier's primary key |
List |
tables()
returns a List containing all Tables tht were created during mapping the sequence of this list is random |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static String INHERIT
public static String CLASS
public static String TYPE
public static String PK
public static String ONE_ONE
public static String ONE_MANY
public static String MANY_MANY
public static String ORDERED
private Hashtable classStrategies
private Hashtable datatypeStrategies
private Hashtable keyStrategies
private Hashtable inheritanceStrategies
private Hashtable associationStrategies
private Hashtable orderStrategies
private Map defaultStrategies
private Hashtable classToTables
private Hashtable nameToClassifier
private Hashtable associationEnds
private Hashtable navigationGuides
private Hashtable associationTables
private Hashtable classViews
private ru.novosoft.uml.model_management.MModel theModel
private Set tables
private Set classifiers
private Set associations
private Set generalizationRoots
private Set undefinedAttributes
private Set classAttributes
Constructor Detail |
public ORMappingImpl(ru.novosoft.uml.model_management.MModel theModel, ModelAdjuster ma)
theModel
- to be mapped to a database schemema
- a ModelAdjuster filtering the interesting model dataMethod Detail |
public Map associationEnds(String classifier)
associationEnds
in interface ORMapping
classifier
- a classifier
public Set attributes(String classifier)
attributes
in interface ORMapping
classifier
- a classifier
public Set classifiers()
classifiers
in interface ORMapping
ModelAdjuster
public ru.novosoft.uml.foundation.core.MClassifier getClassifier(String name)
public Set directSupertypeNames(String classifier)
directSupertypeNames
in interface ORMapping
classifier
- a classifier
public List getClassTables(String classifier)
getClassTables
in interface ORMapping
classifier
- a classifier
Table
public ObjectView getClassView(String classifier)
public Set getClassViews()
ObjectView
public List guidesToAssociationEnds(String classifier, String assEnd)
guidesToAssociationEnds
in interface ORMapping
classifier
- a classifierassEnd
- the name of the association end
Guide
,
ObjectView
public Set operations(String classifier)
operations
in interface ORMapping
classifier
- a classifier
public List tables()
tables
in interface ORMapping
Table
public void setStrategy(ru.novosoft.uml.foundation.core.MClassifier classifier, ClassStrategy strategy)
public void setStrategy(ru.novosoft.uml.foundation.core.MAttribute attribute, DatatypeStrategy strategy)
public void setStrategy(ru.novosoft.uml.foundation.core.MClassifier classifier, KeyStrategy strategy)
public void setStrategy(ru.novosoft.uml.foundation.core.MClassifier generalizationRoot, InheritanceStrategy strategy)
public void setStrategy(ru.novosoft.uml.foundation.core.MAssociation association, AssociationStrategy strategy)
public void setStrategy(ru.novosoft.uml.foundation.core.MAssociationEnd associationEnd, OrderedStrategy strategy)
public void setDefaultStrategies(Map strategies)
strategies
- a Map (String -> Strategy)ClassStrategy
,
KeyStrategy
,
DatatypeStrategy
,
InheritanceStrategy
,
OrderedStrategy
,
AssociationStrategy
public Set getGeneralizationRoots()
public Set getAssociations()
public Set getUndefinedAttributes()
public void map()
|
Dresden OCL Toolkit | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |