mirror of
https://github.com/mapstruct/mapstruct.git
synced 2025-07-12 00:00:08 +08:00
#255 avoid empty if check due to the introduction of constants in bean mapping
This commit is contained in:
parent
683acdc7e3
commit
b5e18b54fc
@ -27,11 +27,13 @@
|
|||||||
<#if !existingInstanceMapping><@includeModel object=resultType/> ${resultName} = <#if factoryMethod??><@includeModel object=factoryMethod targetType=resultType raw=true/><#else>new <@includeModel object=resultType/>()</#if>;</#if>
|
<#if !existingInstanceMapping><@includeModel object=resultType/> ${resultName} = <#if factoryMethod??><@includeModel object=factoryMethod targetType=resultType raw=true/><#else>new <@includeModel object=resultType/>()</#if>;</#if>
|
||||||
<#if (sourceParameters?size > 1)>
|
<#if (sourceParameters?size > 1)>
|
||||||
<#list sourceParameters as sourceParam>
|
<#list sourceParameters as sourceParam>
|
||||||
|
<#if (propertyMappingsByParameter[sourceParam.name]?size > 0)>
|
||||||
if ( ${sourceParam.name} != null ) {
|
if ( ${sourceParam.name} != null ) {
|
||||||
<#list propertyMappingsByParameter[sourceParam.name] as propertyMapping>
|
<#list propertyMappingsByParameter[sourceParam.name] as propertyMapping>
|
||||||
<@includeModel object=propertyMapping targetBeanName=resultName existingInstanceMapping=existingInstanceMapping/>
|
<@includeModel object=propertyMapping targetBeanName=resultName existingInstanceMapping=existingInstanceMapping/>
|
||||||
</#list>
|
</#list>
|
||||||
}
|
}
|
||||||
|
</#if>
|
||||||
</#list>
|
</#list>
|
||||||
<#else>
|
<#else>
|
||||||
<#list propertyMappingsByParameter[sourceParameters[0].name] as propertyMapping>
|
<#list propertyMappingsByParameter[sourceParameters[0].name] as propertyMapping>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user