Documentation Language: Swift

Structure

EReference

A reference in the Ecore metamodel.

struct EReference

Overview

References represent relationships between classes, pointing to other model objects. They enable navigation between instances and can define both simple associations and complex containment hierarchies.

Example

let managerRef = EReference(
    name: "manager",
    eType: personClass,
    containment: false,
    lowerBound: 1  // Required reference
)

Containment

References can be either:

Containment references create a tree structure where children are owned by their parent and deleted when the parent is deleted.

Bidirectional References

References can have an opposite reference creating bidirectional navigation. The opposite is stored as a UUID (ID-based reference) and resolved through the Resource pattern when needed.

Example: Bidirectional Reference

let booksRef = EReference(
    name: "books",
    eType: bookClass,
    upperBound: -1
)

let authorsRef = EReference(
    name: "authors",
    eType: writerClass,
    upperBound: -1,
    opposite: booksRef.id  // ID-based opposite
)

Topics

Operators

?
==(_:_:)

Compares two references for equality.

Initializers

Instance Properties

V
changeable

Whether this reference can be modified.

V
containment

Whether this is a containment reference.

V
eAnnotations

Annotations attached to this reference.

V
eClass

The metaclass describing this reference.

V
eType

The type of objects this reference points to.

V
id

Unique identifier for this reference.

V
isMany

Whether this reference is multi-valued.

V
isRequired

Whether this reference is required.

V
lowerBound

The lower bound of this reference’s multiplicity.

V
name

The name of this reference.

V
opposite

The identifier of the opposite reference in a bidirectional relationship.

V
resolveProxies

Whether to resolve proxies for this reference.

V
transient

Whether this reference is transient.

V
upperBound

The upper bound of this reference’s multiplicity.

V
volatile

Whether this reference has a volatile value.

Instance Methods

F
eGet(_:)

Reflectively retrieves the value of a feature.

F
eIsSet(_:)

Checks whether a feature has been explicitly set.

F
eSet(_:_:)

Reflectively sets the value of a feature.

F
eUnset(_:)

Unsets a feature, returning it to its default value.

F
hash(into:)

Hashes the essential components of this reference.

Type Aliases

T
EReference.Classifier

The type of classifier for this reference.

Default Implementations

Relationships

Conforms To

See Also

Structural Features

P
EStructuralFeature

A structural feature (attribute or reference) in the Ecore metamodel.

S
EAttribute

An attribute in the Ecore metamodel.