Skip to content

fix(intent): mark cross-model PROJECTION entities in the .edm diagram cell (editor renders them as projections, not owned entities)#6381

Merged
delchev merged 1 commit into
masterfrom
fix/intent-edm-projection-graph-cell
Jul 22, 2026
Merged

fix(intent): mark cross-model PROJECTION entities in the .edm diagram cell (editor renders them as projections, not owned entities)#6381
delchev merged 1 commit into
masterfrom
fix/intent-edm-projection-graph-cell

Conversation

@delchev

@delchev delchev commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Problem

A cross-model entity reference (via uses: + a relation with model:, e.g. PaymentMethod, Customer) is correctly emitted as a read-only type="PROJECTION" entity in both the .model JSON and the top-level <entity> of the .edm (with projectionReferencedModel/projectionReferencedEntity, no table/DAO/controller generated).

But the mxGraph diagram block of the .edm — which is what the EDM/Entity editor renders the canvas from — emitted the projection as a plain <Entity ... type="Entity"> cell with no entityType, identical to a locally-owned PRIMARY entity. appendEntityValue only carried entityType for DEPENDENT/SETTING. So in the editor a cross-model reference looked like an owned entity box and the editor would treat it as manageable local state.

Fix

appendEntityValue now emits entityType="PROJECTION" (plus projectionReferencedModel/projectionReferencedEntity) on the diagram cell, so the editor restyles it as a projection — consistent with the top-level <entity> and with how DEPENDENT/SETTING are already carried.

Test

Added a buildEdmXmlForTest seam and an EdmIntentGeneratorTest case asserting the cross-model Country diagram cell is entityType="PROJECTION" (and carries its referenced entity), while an owned Customer cell is not. Full EdmIntentGeneratorTest green (23/23).

… cell

The .edm/.model already emitted cross-model references (e.g. PaymentMethod,
Customer) as type=PROJECTION with projectionReferencedModel/Entity - but the
mxGraphModel DIAGRAM cell (what the EDM editor renders) omitted entityType for
anything other than DEPENDENT/SETTING, so a projection came out as a plain
<Entity> cell identical to a PRIMARY owned entity. In the canvas the external
reference was indistinguishable from an owned entity and the editor treated it
as manageable local state.

appendEntityValue now carries entityType="PROJECTION" (and the
projectionReferencedModel/Entity attrs) on the diagram cell, matching the
top-level <entity>. Adds buildEdmXmlForTest seam + an EdmIntentGeneratorTest
assertion that the cross-model cell is a projection and an owned cell is not.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@delchev
delchev merged commit 6108f58 into master Jul 22, 2026
10 checks passed
@delchev
delchev deleted the fix/intent-edm-projection-graph-cell branch July 22, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant