Given these to models (using Lombok @Data for simplicity)
@Data
public class RootModel {
private Integer myRootProperty;
private SubModel mySubModel;
}
@Data
public class SubModel {
private Integer mySubProperty
}
and this JSON-String:
{
"myRootProperty" : 5,
"mySubModel" : "{ "mySubProperty" : 3 }"
}
Is it possible (via Jackson-Annotations) to directly deserialze the embedded JSON-String (which origins from a DB-Column) to its Java-POJO-Model?
Background is that we need a JSON-Formatted configuration in our DB and I want to handle it typesafe as soon as possible - ideally directly after deserialization.