Re: [morph-user] Converting graphs with Collection
Brought to you by:
orangeherbert,
sgarlatm
|
From: Matt S. <sga...@us...> - 2005-04-04 21:04:15
|
Hi Matt, thanks for using Morph! The PropertyNameMappingCopier is always getting picked up because by default the copier specifies that it can copy any object to any other object. You're probably putting in your PropertyNameMappingCopier first and your ContainerCopier second. This will cause the PNMC to always kick in. There are two simple solutions you can try, both of which should work: - Make the PNMC class less "greedy" so that it only tries to transform some types of objects. You can do this by modifying the sourceClasses and destinationClasses properties. - When you configure the DelegatingTransformer, use the CC first and the PNMC second so that the when a collection is encountered, the CC kicks in before the greedy PNMC tries to perform the transformation. Either one of those should work, but if you keep having trouble don't hesitate to post a follow-up question! Matt Matthieu Riou wrote: >Hi, > >I have a simple graph of object with AClass objects having collections >of BClass instances. I tried many solutions to get this transformed to >A2Class with a collection of B2Class but couldn't get anything >working. I want both the properties of A and B instances to be copied >to A2 and B2 but also the Collection to be processed automatically. > >My hunch had been to stuff both my PropertyNameMappingCopiers and a >CollectionCopier in the DelegatingTransformer components but the >PropertyNameMappingCopiers always get picked up first so the >collections are never processed. > >How should I proceed to get my object converted properly? > >Thanks, > >Matt. > > >------------------------------------------------------- >SF email is sponsored by - The IT Product Guide >Read honest & candid reviews on hundreds of IT Products from real users. >Discover which products truly live up to the hype. Start reading now. >http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click >_______________________________________________ >morph-user mailing list >mor...@li... >https://lists.sourceforge.net/lists/listinfo/morph-user > > > |