Expected behavior
When I retrieve my data from DB, sometime the collection is Immutable. ex: when using @type(type = "json").
When I do a partial request, I expect it to keep working.
ie: Not try to clear the immutableCollection just create a new Empty one and set it.
Actual behavior
if ( entity.getTypes() != null ) {
Set<PartnerType> set = dto.getTypes();
if ( set != null ) {
entity.getTypes().clear();
entity.getTypes().addAll( set );
}
}
else {
Set<PartnerType> set = dto.getTypes();
if ( set != null ) {
entity.setTypes( new LinkedHashSet<PartnerType>( set ) );
}
}
Steps to reproduce the problem
Have the target contain an ImmutableCollection ex using Set.of()
@BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
void partialUpdate(@MappingTarget Partner entity, PartnerDTO dto);
Try to map.
MapStruct Version
Mapstruct 1.5.3
Expected behavior
When I retrieve my data from DB, sometime the collection is Immutable. ex: when using @type(type = "json").
When I do a partial request, I expect it to keep working.
ie: Not try to clear the immutableCollection just create a new Empty one and set it.
Actual behavior
Steps to reproduce the problem
Have the target contain an ImmutableCollection ex using
Set.of()Try to map.
MapStruct Version
Mapstruct 1.5.3