I have the following setup:
EntityA has an EnttiyB as a property; entityB uses the objectFactory to populate one of its own properties.
The entityAMapper uses the entityBMapper.
This works fine for the normal entityA toEntity( entityAResource) method.
The generated code uses the entityBMapper which uses the object factory to resolve the property.
My entityA also has an 'update' method which uses the @MappingTarget annotation:
entityA update( EntityAResource resource, @MappingTarget entityA)
The now generated code does not use the entityBMapper anymore, instead it does a
new EntityB()
and calls a generated method to set other properties.
Since this is not calling the objectFactory, it blows up.
Is there some magic I need to do to have a mappingTarget working with a mapper?