This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes copying bean properties values to another bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "copying bean properties values to another bean" Watch "copying bean properties values to another bean" New topic
Author

copying bean properties values to another bean

kishore mang
Greenhorn

Joined: Nov 27, 2012
Posts: 10
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

Joined: Aug 16, 2005
Posts: 14074
    
  16

I think you can do this with Dozer.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
kishore mang
Greenhorn

Joined: Nov 27, 2012
Posts: 10
thank you Jesper de Jong for providing solution!!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: copying bean properties values to another bean
 
Similar Threads
My SCEA Part 1Study Notes
Comparing two Java Objects
JSP with Beans
Use the same facelet component with different parameters
Using DAO in struts