Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

copying bean properties values to another bean

 
kishore mang
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

For copying one bean properties to another bean apache provided BeanUtils can use, but the condition is
both beans properties signature should match.
But most of the time beans fields signatures(naming) can be different between layers(service, dao etc).

Is there any API which can copy one bean properties to another bean even though field names different?

Best example is castor mapping file where eventhough request xml fields names are different still we can process(map)
request data to xml.

Regards
Kishore
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15272
37
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you can do this with Dozer.
 
kishore mang
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you Jesper de Jong for providing solution!!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic