Trivial database constraints that are freely available in any RDBMS must be implemented yourself in Mendix. And guaranteeing data integrity is hard, because of possible race conditions between MFs. E.g. association functionality in Mendix does not guarantee data integrity. It is fairly easy to create a technically corrupt database with concurrent MFs with respect to associations (reference to non-existing object).
Add the following constraints to Mendix relying on the RDBMS:
- Uniqueness constraints on combined attributes.
- Uniqueness constraints on foreign key in combination with attribute. E.g. unique sequence number in order line per order (association from order line to order and sequence number attribute).
- Uniqueness constraint on combined foreign keys. E.g. student can subscribe to course only once (two associations from subscription to student and course).
- Foreign key constraint for 1-1/1-N associations without the association table (better performance, cleaner database schema, guaranteed reference).
- Not-null foreign keys. Define associations as required. E.g. an order line may not exist without order.
- Delete cascade and delete check. Associations do not guarantee data integrity.