Changed/removed functionality part 30000 (it seems) Entity.getMetaClass() removed

Apparently there is no Entity.getMetaClass() in Jmix? In CUBA, we used this in a PreCommit event to go through the lists of changed and deleted entities, looking to see if entities of certain classes were changed or deleted, to then let the user know they needed to check certain things because they made important changes.

Apparently there is no getMetaClass() in Jmix… So how can we, while iterating event.getModifiedInstances() (or RemovedInstances), get the class of the entity, which was done with entity.getMetaClass() in CUBA…?

All about metadata is collected in Metadata.
metadata.getClass(getEditedEntity())

Yeah, I decided to use metadata.getClass(e).getName() to compare the name and see if it’s the entity class I’m interested in.

Seems this could have been converted automatically. (Or left as is from CUBA…)

1 Like