Previous Table of Contents Next


5.6.1 KeysIndexes Classes


   5.6.1.1 Index

   Instances of the Index class represent the ordering of the instances of some other Class, and the Index is said to “span? the Class. Indexes normally have an ordered set of attributes of the Class instance they span that make up the “key? of the index; this set of relationships is represented by the IndexedFeature class that indicates how the attributes are used by the Index instance.

   The Index class is intended primarily as a starting point for tools that require the notion of an index.

   Superclasses

   ModelElement

   Contained Elements

   IndexedFeature

   Attributes

   isUnique

The isUnique attribute is True if the Index instance guarantees all of its instances have a unique key value.

type:

multiplicity:

Boolean
exactly one

   isSorted

If True, the Index instance is maintained in a sorted order.

type:

multiplicity:

Boolean
exactly one

   isPartitioning

If True, this Index instance is used as a partitioning index.

type:

multiplicity:

Boolean
exactly one

   References

   indexedFeature

Identifies the IndexedFeature instance that associates this Index with one of the StructuralFeature elements of the Index’s key. The ordered constraint on this reference can be used to represent the sequential order of elements of the Index’s key.

class:

defined by:

multiplicity:

inverse:

IndexedFeature
IndexedFeatureInfo::indexedFeature
one or more; ordered
IndexedFeature::index

   spannedClass

Identifies the Class instance spanned by the Index instance.

class:

defined by:

multiplicity:

Class
IndexSpansClass::spannedClass
exactly one

   5.6.1.2 IndexedFeature

   Instances of the IndexedFeature class map StructuralFeature instances of the spanned Class instance to the Index instances that employ them as (part of) their key. Attributes of IndexedFeature instances indicate how specific StructuralFeature instances are used in Index keys.

   Superclasses

   ModelElement

   Attributes

   isAscending

The isAscending attribute is true if the feature is sorted in ascending order and false, if descending order.

type:

multiplicity:

Boolean
Zero or one

   References

   index

Identifies the Index instance for which this IndexedFeature instance is relevant.

class:

defined by:

multiplicity:

inverse:

Index
IndexedFeatureInfo::index
exactly one
Index::indexedFeature

   feature

Identifies the StructuralFeature instance for which this IndexedFeature instance is relevant.

class:

defined by:

multiplicity:

StructuralFeature
IndexedFeatures::feature
exactly one

   Constraints

   The isAscending attribute is valid only if the isSorted attribute is True. [C-6-1]

   5.6.1.3 KeyRelationship

   KeyRelationship instances represent relationships between UniqueKey instances and the Class(es) that reference them. This class is intended as a starting point for the creation of “foreign key? and other associative relationships.

   Superclasses

   ModelElement

   References

   feature

Identifies StructuralFeature instances that participate as (part of) the key of this KeyRelationship instance.

class:

defined by:

multiplicity:

StructuralFeature
KeyRelationshipFeatures::feature
one or more; ordered

   uniqueKey

Identifies the UniqueKey instance that serves as the “primary key? for this KeyRelationship instance.

class:

defined by:

multiplicity:

inverse:

UniqueKey
UniqueKeyRelationship::uniqueKey
exactly one
UniqueKey::keyRelationship

   Constraints

   A KeyRelationship instance must be owned by one and only one Class instance. [C-6-2]

   5.6.1.4 UniqueKey

   A UniqueKey represents a collection of features of some Class that, taken together, uniquely identify instances of the Class. Instances of UniqueKey for which all features are required to have non-null values are candidates for use as primary keys such as those defined by relational DBMSs.

   Superclasses

   ModelElement

   References

   feature

Identifies the StructuralFeature instances that make up the unique key. The ordered constraint is used to represent the sequence of StructuralFeature instances that make up the UniqueKey instance’s key.

class:

defined by:

multiplicity:

StructuralFeature
UniqueFeature::feature
one or more; ordered

   keyRelationship

Identifies the KeyRelationship instances that reference this UniqueKey instance.

class:

defined by:

multiplicity:

inverse:

KeyRelationship
UniqueKeyRelationship::keyRelationship
zero or more
KeyRelationship::uniqueKey

   Constraints

   An UniqueKey instance must be owned by one and only one Class instance. [C-6-3]