{
BeanPopulator replicator = BeanPopulator.newBeanPopulator(from, to);
// Change bean class replicator
//
BeanTransformerSpi transformer = (BeanTransformerSpi) replicator.getTransformer();
transformer.initBeanReplicatable(MergeClassBeanReplicator.factory);
((MergeClassBeanReplicator) transformer.getBeanReplicatable()).setClassMapper(classMapper);
((MergeClassBeanReplicator) transformer.getBeanReplicatable()).setPersistenceUtil(persistenceUtil);
((MergeClassBeanReplicator) transformer.getBeanReplicatable()).setProxyStore(proxyStore);
transformer.initCollectionReplicatable(MergeCollectionReplicator.factory);
((MergeCollectionReplicator) transformer.getCollectionReplicatable()).setPersistenceUtil(persistenceUtil);
transformer.initMapReplicatable(MergeMapReplicator.factory);
((MergeMapReplicator) transformer.getMapReplicatable()).setPersistenceUtil(persistenceUtil);
// Custom transformers (timestamp handling)
//
transformer.initCustomTransformerFactory(new CustomBeanTransformerSpi.Factory()
{
public CustomBeanTransformerSpi newCustomBeanTransformer(final BeanTransformerSpi beanTransformer)
{
return CustomTransformersFactory.getInstance().createUnionCustomBeanTransformer(beanTransformer);
}