Jackson/Hibernate, meta get methods and serialization

What I usually do is map Entities to DTOs manually, or with the help of tools such as MapStruct.
This will give you maximum flexibility, with a bit of overhead at the beginning, unfortunately.
Over time however, you’ll see it was worth it.

Jackson, GSON, and other serialization tools are obviously limited in what they can do out-of-the-box, and this kind of customization requires a bit too much work, imho, while also being difficult to understand and maintain.

Keep it simple.

Leave a Comment