-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Writing a Generic POJO Copy Method
PostPosted: Fri Nov 25, 2011 4:48 pm 
Newbie

Joined: Sun Jul 12, 2009 9:38 pm
Posts: 3
I've attempted to write a method to copy the non-collection fields of a proxy POJO to another, as defined by the mapping.

To do this, I use Property.getGetter() on the field mapping and then apply that getter to obtain the original value, the apply an obtained setter to set the value in the target POJO.

This seems to work except for those fields that use field access. What's the correct way to proceed in this case? Am I on the right track at all? And how can my method determine which fields use field access and which use accessors?

Thanks,
Elly


Last edited by eshevin on Sat Nov 26, 2011 10:53 pm, edited 1 time in total.

Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.