The domain model represents the data that is stored in your app. Each module has a domain model, consisting of entities, which have attributes of a certain type and associations with other entities.
Attributes have a
value which can either be a
StoredValue, which is a value stored in the database, or a
CalculatedValue, which is computed from a
The entities can also relate to each other through generalizations. Finally, you can define access rules, validation rules, event handlers and indexes for entities.
Entities can have multiple attributes. Each attribute has a specific type.
Graphical overview - Non-numeric attributes
Graphical overview - Numeric attributes
Entities can have a Generalization relationship with another entity. The entity is then called a Specialization. A specialization entity inherits all attributes, validation rules and access rules from its Generalization entity.
Entity instance has a
generalization property with which to define this relationship. It can either be set to a
NoGeneralization instance if it is not a specialization of another entity, or it can be set to a
Generalization instance. A
Generalization instance has again a
generalization property which must point to the entity that is the actual generalization.
To secure access to the data in a Mendix app, you can define access rules for entities. An access rule is always defined for a certain module role, defines to which attribute or association members that role has access, and the retrieved data is constrained by an xpath constraint.
For each attribute of an entity, it is possible to define a validation rule. The validation rule is applied to a single attribute, will show some error message, and it is a certain type of rule, e.g. the attribute needs to be equal to a certain value, or has a maximum length, or needs to be unique.
An entity can have multiple indexes. Each index consists of a set of indexed attributes.