fix(intent): mark cross-model PROJECTION entities in the .edm diagram cell (editor renders them as projections, not owned entities)#6381
Merged
Conversation
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A cross-model entity reference (via
uses:+ a relation withmodel:, e.g.PaymentMethod,Customer) is correctly emitted as a read-onlytype="PROJECTION"entity in both the.modelJSON and the top-level<entity>of the.edm(withprojectionReferencedModel/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 noentityType, identical to a locally-owned PRIMARY entity.appendEntityValueonly carriedentityTypeforDEPENDENT/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
appendEntityValuenow emitsentityType="PROJECTION"(plusprojectionReferencedModel/projectionReferencedEntity) on the diagram cell, so the editor restyles it as a projection — consistent with the top-level<entity>and with howDEPENDENT/SETTINGare already carried.Test
Added a
buildEdmXmlForTestseam and anEdmIntentGeneratorTestcase asserting the cross-modelCountrydiagram cell isentityType="PROJECTION"(and carries its referenced entity), while an ownedCustomercell is not. FullEdmIntentGeneratorTestgreen (23/23).