I currently recieve a POST request with a JSON that is serialized into Cobranca entity by SpringBoot with lombrok getter and setter.
I want to serialize this entity into a CobrancaDTO that latter will generate a second JSON with a different hierarchy model.
How would I be able to serialize the entity Cobranca into my CobrancaDTO, since CobrancaDTO has a different hierarchy model? Should I somehow use a custom ObjectMapper? Or should I just populate the DTO with a method, populating it property by property?