We can think of embedded property mappings as a 'gateway' from one set of property mappings to another. They are in a sense both an InstanceSetImplementation (since they hold property mappings that map to a class) and a PropertyMapping (as it holds a property). The property's owner class belongs to the orginal/root InstanceSetImplementation. The property's type is the class mapped as part of the embedded property mapping

NOTE: We model this class differently than what we do in Pure metamodel. We make it only implement SetImplementation, not extending it for 2 reasons:

  1. Javascript only support single inheritance unlike Pure
  2. In the general mental model, it is more sensible to think of embedded property mapping as a property mapping rather than a class mapping because despite the fact that it has the shape similar to a class mapping and it can contain multiple property mappings, it itselt is not a class mapping, it must exist "embedded" within a property mapping.

Hierarchy

  • AbstractFlatDataPropertyMapping
    • EmbeddedFlatDataPropertyMapping

Implements

Properties

_OWNER: PropertyMappingsImplementation

the immediate parent instance set implementation that holds the property mappings

sourceSetImplementation: SetImplementationReference

In Pure, these fields are defined as string and not properly resolved, perhaps because of the fact that in Pure, we allow mappings which contain class mapping IDs pointing at another mapping's class mappings. In Pure/Engine, we let this pass compilation phase. In Studio, we disallow this. This makes it hard for users to migrate to Studio. We should think of a strategy to make things loadable in Studio, but disallow users to make changes if they have this kind of error in their graph.

See https://github.com/finos/legend-studio/issues/880

NOTE: We might not be able to resolve targetSetImplementation for all target IDs hence defined as optional for now. We might need to come back and re-visit this decision. Note that one quirky thing is that the metamodel in Pure has these fields as string pointers, even when these are not resolvable, the field is set to empty string. We should solidify our understand about these fields.

model