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

Create an alternate key for join entity types which have an independent PK #21900

Open
Tracked by #28479 ...
ajcvickers opened this issue Aug 2, 2020 · 0 comments
Open
Tracked by #28479 ...

Comments

@ajcvickers
Copy link
Contributor

Consider this many-to-many join type:

public class JoinType
{
        public virtual Guid Id { get; set; }
        public virtual int LeftId { get; set; }
        public virtual int RightId { get; set; }
}

When performing fixup, the state manager needs to lookup instance where LeftId and RightId match. This fast when these types form the composite PK of the type. In this case Id is the PK, and hence there isn't a way to do a fast lookup for matches of LeftId and RightId.

To fix this, we should create an alternate key for what would usually be the PK in the join table. However, we should likely only do this after #4073 is implemented to avoid making it impossible to change these values, although it does seem unlikely that changing them would be useful.

ajcvickers added a commit that referenced this issue Aug 2, 2020
Also support for join types that have a separate primary key

Part of #10508 #19003

See also #21900 and #21901
@ajcvickers ajcvickers added this to the Backlog milestone Aug 3, 2020
@ajcvickers ajcvickers self-assigned this Aug 3, 2020
ajcvickers added a commit that referenced this issue Aug 4, 2020
Also support for join types that have a separate primary key

Part of #10508 #19003

See also #21900 and #21901
@ajcvickers ajcvickers removed their assignment Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant