How does Mendix implement Entity Inheritance?

2
I’m interested in the inheritance mechanism in Mendix. It is a little confusing because as a programmer I am used to database modelling as one discipline and then designing a class hierarchy as another discipline. Mendix blurs these together. So, in a brand new app, it seems there is a System module with a System.User entity table. Also, out of the box there is an Administration.Account entity which inherits from System.User. But on a database level how is the inheritance implemented? Is it the case that when a row is entered into System.User then a row is automatically entered into Administration.Account entity? If so then is this an event handler thing because as far as I can see there are no event handlers on either the ‘base’ entity or the ‘derived’ entity. Very curious to find out how this is implemented.
asked
1 answers
7

In the database there will be a table for the base entity and all inherited entities. The base entity has a column indicating the 'object' type. Also the primary key is identical in base en inherited entity tables. All this is handled by the platform for you, so no event handlers.

One thing to know is that when deleting an inherited entity in the modeler the records of that entity are also deleted in the base entities table. They are strictly separated.

answered