Composite Key in Mendix Domain Model

1
Hi guys,  I am new to Mendix. I am trying to create a table with a composite primary key (3 fields). It seems that there is no way to do that (I looked in the validation tab, and we can only select 1 field there).  Can you please tell me how this can be done in Mendix? Thank you !
asked
1 answers
0

In your Before Commit Microflow concatenate both keys and store in the attribute. Since this attribute is Unique, you are not going to get duplicates for that foreign key.  Made sense?

Parent Entity(Attribute: Key1)  ChildTable(UniqueAttribute,Key2) – Before commit to ChildTable (UniqueAttribute = key1+key2). This way you are cheating to get a foreign key relationship into the ChildTable.

answered