Well, on non-iterable properties, any "null" targets properties are created before calling the property mapping method for it.
For example (taken from one of our tests):
if ( source.getCompany() != null ) {
if ( target.getCompany() == null ) {
target.setCompany( new CompanyEntity() );
}
toCompanyEntity( source.getCompany(), target.getCompany() );
}
else {
target.setCompany( null );
}
Limitation: iterables and maps behave differently here, as we don't call property mapping methods with those types as @MappingTarget. So any updating logic would break below such property paths. The main reason for that is that we didn't yet came up with a clean solution to identify what elements in those collections need to be removed, created, or updated by the incoming source elements...
@Sjaak, did I miss something?