--- Hanson Char <[EMAIL PROTECTED]> wrote: > Or as a comparison, you can achieve the copying via > BeanPopulator of > beanlib, and it would just work. See sample code > below. > > > http://sourceforge.net/project/showfiles.php?group_id=140152 > > Cheers, > Hanson > > import java.util.Date; > > import net.sf.beanlib.provider.BeanPopulator; > > public class Bean1Bean2Main { > public static void main(String...args) { > Bean1 b1 = new Bean1(); > Bean2 b2 = new Bean2(); > > BeanPopulator.newBeanPopulator(b1, > b2).populate(); > System.out.println(b1.getDate()); > System.out.println(b2.getDate()); > > b1.setDate(new Date()); > BeanPopulator.newBeanPopulator(b1, > b2).populate(); > System.out.println(b1.getDate()); > System.out.println(b2.getDate()); > } > } >
FWIW, the simplest approach to this in Morph (http://morph.sourceforge.net) should be: Morph.copy(b2, b1); -Matt > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]