I try to create a Json respectively a keyvalue map from “getEditedEntity”. This works out fine but for the columns of type enumeration I receive the enums value (which is a string) instead of its integer ID. In the database table itself the corresponding IDs of the enum are stored in the column as expected.
My JSON od KeyValue Map structure should reflect only the column name and its integer value exactly as seen in the Database Table.
Any hint is welcome since I am struggeling with this task for quite a while.
I think it is actually not Jmix issue.
How do you perform conversion of the entity to JSON? You need to configure your mapper to take enum property value id, not the value itself.
Thx Alexander, I am using com.fasterxml.jackson.databind.ObjectMapper. Either it’s methods “writeValueAsString” nor “readTree” delivery me a JSON based on my entity. Those methods obviously take the value instead of the property value.
Can you give me an idea accomplishing this task may without this ObjectMapper?