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
  • 115,091
  • 17
  • 196
  • 297
Aubergine
  • 5,862
  • 19
  • 66
  • 110
  • 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
  • 5,061
  • 3
  • 26
  • 39
1

You could use a object mapper like Dozer.

jeha
  • 10,562
  • 5
  • 50
  • 69
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
  • 18,095
  • 1
  • 53
  • 73