• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

How to copy selected fields from one to Object to another using Dozer

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have two classes, say Product and ProductTO :
Other than fields, Product class also have several other different classes present as Collection (oneToMany), same goes with ProductTO.
When I use Dozer for mapping fields from entity Product to ProductTO, Dozer by default does copy all fields having same field names, but I don't want to copy all fields. Rather I will define a mehtod findFinishedProduct(), which will copy selected fields from Product to ProductTO while another method findScrapMaterial() will copy different set of fields from Product to ProductTO.
Is there any way to define a set of fields, say in xml configuration file, which I can refer in different methods while copying. How can I accomplish this with Dozer efficiently ?
Thanks.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic