BO <=> DTO mapper in Java

malejpavouk picture malejpavouk · Jan 25, 2013 · Viewed 8.2k times · Source

I am currently in my application maping DTOs to BO (and vice versa) manually. However, this approach is awkward and clumsy.

Is there any good mapper between these two representations?

My requirements follow:

  • Should support conversion of JPA proxies to identifiers (DTO should not link to other DTO directly). Or this functionality should be easy to implement
  • Should be annotation based, covention over configuration
  • Soft criteria: should allow mapping of multiple DTOs to one entity (and vice versa)

Thanks for any suggestions.

Answer

miguelcobain picture miguelcobain · Jan 25, 2013

Regarding object mapping I would recommend

Also, refer to this SO answer. It has a more or less complete list of Java Object mappers: https://stackoverflow.com/a/1432956/1137735

The 3 I suggested seemed more appealing to me. I think they all fulfill the requirements you ask.