You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there any way to have multiple attributes as a primary key? I have an object that has 2 string attributes and combination of them determines the object uniqueness.
Thanks.
The text was updated successfully, but these errors were encountered:
Hello, @kryzhikh! Unfortunately no. I was trying to manage stuff like that in the past but wasn't able to manage correct prefetch. Issue is in the predicate, when we have to fetch objects that has received IDs.
When key is one, then predicate is PK IN arrayOfPKs, however for multiple PKs it is hard to describe it. This should be either a very long (PK1 == A && PK2 == B) || (PK1 == A1 && PK2 == B) .... or something different. Do you have any idea, by the way?
Well, we can go with PK1 IN firstPKArray AND PK2 IN secondPKArray. I assume, that sql does optimisation, so lookup don't have to be O(n^2). This might be an idea.
Hello,
Is there any way to have multiple attributes as a primary key? I have an object that has 2 string attributes and combination of them determines the object uniqueness.
Thanks.
The text was updated successfully, but these errors were encountered: