0

How to map persistent object to DTO? So that no additional behavior is taken. I know it is quite common and easy, but many people - many opinions, what are the best approaches?

(talking about Java)

Thanks,

leppie
  • 112,162
  • 17
  • 191
  • 293
Aubergine
  • 5,641
  • 19
  • 61
  • 105
  • What exactly do you mean - is this a conceptual question or are you simply looking for an O/R mapper? – home Oct 04 '11 at 16:26

3 Answers3

1

You can also use Orika it also support hetrogenous mapping with ease coding.

prashant thakre
  • 4,787
  • 2
  • 25
  • 38
1

You could use a object mapper like Dozer.

jeha
  • 10,304
  • 5
  • 49
  • 68
0

Another alternative is MapStruct (disclaimer: I'm the original author of this project). MapStruct generates mapping code at compile-time which is thus fast and type-safe, i.e. you don't have any runtime dependencies and get feedback about incompatible mappings at build time, e.g. within your IDE.

Gunnar
  • 16,917
  • 1
  • 50
  • 69