Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix reading the primary key property of resolved entities #383

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

trickpatty
Copy link

This change fixes an issue where, when reading the PrimaryKey property of an entity which was resolved from an abstract manifest (with the identifiedBy purpose on an attribute), the value cannot be retrieved.

When FetchTraitReferenceArgumentValue returns the value of the argument for the resolved is.identifiedBy trait, it returns either a string or a CdmAttributeReference. However, the subsequent process was looking to cast to a CdmTypeAttributeDefinition, which is not a compatible type. Since the only thing the code needs from that object is the name, it is safe to cast to the CdmObject instead and call the underlying FetchObjectDefinitionName() method.

This change makes the cast to CdmObject and returns the value successfully.

A unit test which addresses this situation is also included in the changes.

Scott Kearney added 2 commits August 8, 2024 15:55
…d entity from an abstract manifest.

Currently fails due to incompatible types.
The attRef returned can be cast to the base CdmObject type in order to just retrieve the object definition name.
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