Insert new records in a middle table
- Last Updated: May 2, 2021
- 1 minute read
- Corticon
- Version 7.2
- Documentation
In relational databases, many-to-many relationships are modeled using a “middle” table (also known as an intersection table). Assume two tables named A and B, and they have a many-to-many relationship. A third or middle table named AB has a many-to-1 relationship with both A and B.
A many-to-many association between two entities in the Vocabulary can be mapped to such a middle table. Therefore, table AB does not need to correspond to a specific entity in the Vocabulary. However, should the middle table contain additional business fields, then it must have a corresponding entity in the Vocabulary. In such a situation, attempting to create a new record/row in table AB using rules can cause limitations depending on:
- The cardinalities of the associations between AB and A, and AB and B
- The identity strategy used for A, B, and AB
The following table highlights known limitations for combinations of entity identity (Application or Datastore) and association directionality (bidirectional or unidirectional):
The one uni / one bi configuration should be avoided when Application Identity is used.