Hi!
I am converting a java spring project to kotlin.
The project uses JPA, and I have an Entity, which have JSON fields (postgres). Those fields are mapped to Map
String, Object.
As the structure of those jsons are kinda standard, we have some classes to map to.
For that purpose we need an ObjectMapper.
I thought it would be a great idea to have an Entity companion object, which have an ObjectMapper instance, so that I can map between Map
String, Object to MyModelClass.
So: Can I inject dependency to a companion object?
If not, what is the preferred way to map entity fields?