Jmix version: 1.1.1
Jmix Studio plugin version: 1.1.4-213
IntelliJ IDEA 2021.3 CE - Build #IC-213.5744.223, built on November 27, 2021
Operating System: macOS 12.0.1 (21A559)
File System: Case-Sensitive Journaled HFS+ (APFS)
Datebase: PostgreSQL 13
Hi Everyone
After performing the CUBA-to-Jmix migration I noticed in my CUBA code that provides a Map object for the CUBA Freemarker functionality, used for example in the CUBA EmailInfoBuilder setTemplateParameters() method, that my Jmix JPA entity is no longer serializable. Studio displays an error.
I assume that this was explicitly chosen for the new architecture but I am not 100% sure. Maybe there was a mistake during the CUBA-to-Jmix migration somewhere?
In fact, Java serialization is still used when saving entities changed in UI screens. It’s done to isolate instances being saved from the screen content, essentially by making a copy of the object graph.
It’s true that you don’t have to declare implements Serializable in your entities source code, but it’s added by the bytecode enhancement at build time anyway. So if your entities contain any non-serializable fields, they should be marked with the transient modifier, otherwise they’ll cause exceptions when saved in UI.