Sometimes you want to map a collection of sources into a collection of existing targets, e.g:
Collection forms = ...;
Collection entities = repository.findAll();
Collection results = beanMapper.map(forms, entities);
This would automatically select the comparable (equal) entity from the target list and map the source.
To compare entities an 'Equalizer' interface has to be created:
boolean equals(Object left, Object right)
With a default implementation that does an Object.equals(left, right), this is by default null safe.
Sometimes you want to map a collection of sources into a collection of existing targets, e.g:
Collection forms = ...;
Collection entities = repository.findAll();
Collection results = beanMapper.map(forms, entities);
This would automatically select the comparable (equal) entity from the target list and map the source.
To compare entities an 'Equalizer' interface has to be created:
boolean equals(Object left, Object right)
With a default implementation that does an Object.equals(left, right), this is by default null safe.