• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

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

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • 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.
 
The government thinks you are too stupid to make your own lightbulb choices. But this tiny ad thinks you are smart:
Create Edit Print & Convert PDF Using Free API with Java
https://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!