If you would like to upgrade to a newer long-term support version of Studio Pro, see Moving from Mendix Studio Pro 8 to 9.

Persistability

Last modified: August 20, 2024

Introduction

The Persistable property of an entity in the domain model defines whether an object can be committed to the database.

Persistable entities are colored blue in the domain model. Non-persistable entities are colored orange. The Customer entity in the image below is persistable, while ProductQueryResults is non-persistable.

Picture of a persistable and a non-persistable entity

Persistable Entities

When an entity is declared persistable, a database table is created for the entity.

Committing an object of this entity type results in a row being inserted into the table. The attribute and association values for the object are saved in the database as well.

Autocommitted Objects

Usually, a rollback reverts changes in memory since the last commit.

However, performing a rollback on persistable autocommitted objects or objects with the state “NEW” deletes the row corresponding with this object from the database table for the associated entity. See Object Activities for more information about autocommitted objects.

Non-Persistable Entities

Non-persistable entities are stored in the runtime memory and never get committed to the database. Therefore, they have no table in the database.

Committing non-persistable entities records the current attribute values and association values in memory, allowing a rollback to revert to these values.