Support for Composite Key

We are developing an web app that makes use of composite keys a lot. As mentioned in the topic here (which is about 9 months old), composite keys are not supported in CUBA-Platform.

Has things changed since then? Do we now have support for composite keys? If not, is it coming anytime soon?

Thanks & Regards

Hi Ranes,
Composite keys are still not supported in Platform 6.2 and Studio 2.2.
We are going to investigate the possibility for such support as part of the task described here:
Could you provide some details on why you use composite keys? Is it for some kind of sharding or just for application needs?

Hi Konstantin,

Thank you so much for your reply.

In our case most of the the drop-down (combo box) items for example Person.Gender (Male / Female) are to be configured in a separate table say “Gender” with the option to support multiple locales (code remains same but description is changed based on the locale).
The structure of the Gender table may look something like below.


Sample records may look something like below

SX1 - Male - en
SX2 - Female - en
SX1-Mâle - fr

Code and the locale becomes composite primary key in this case so that we display the localized description based on the users locale.
Hope it helps.

Thanks & Regards

Thank you for the explanation.
What if you introduce an artificial primary key (UUID or Integer) and just create a unique index on the combination of GenderCode and LocaleCode? Do you think it will complicate something?

As we are using MySQL, this is exactly the approach we have taken. But what we want to achieve is store only the code (like SX1 / SX2) for a person instead of the UUID so that it is not attached to one specific locale.