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 (
containment: true): Defines parent-child ownership -
Non-containment (
containment: false): Defines associations
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
Initialise an EReference from a DynamicEObject.
Instance Properties
Whether this reference can be modified.
Whether this is a containment reference.
Annotations attached to this reference.
The metaclass describing this reference.
The type of objects this reference points to.
Unique identifier for this reference.
Whether this reference is multi-valued.
Whether this reference is required.
The lower bound of this reference’s multiplicity.
The name of this reference.
The identifier of the opposite reference in a bidirectional relationship.
Whether to resolve proxies for this reference.
Whether this reference is transient.
The upper bound of this reference’s multiplicity.
Whether this reference has a volatile value.
Instance Methods
Reflectively retrieves the value of a feature.
Checks whether a feature has been explicitly set.
Reflectively sets the value of a feature.
Unsets a feature, returning it to its default value.
Hashes the essential components of this reference.
Type Aliases
The type of classifier for this reference.
Default Implementations
Relationships
Conforms To
See Also
Structural Features
A structural feature (attribute or reference) in the Ecore metamodel.
An attribute in the Ecore metamodel.