title: When should I use mapstruct or converters with java 8 to avoid error-prone?
body: <p>At work, we use MapStruct in many SpringBoot projects with Java 8 REST Full applications and when we need to map Entity to DTO or DTO to Response or in similar cases. But today my friend showed me a great advantage of using a simple Converter instead of MapStruct.</p>
  <p>This is a simple example using MapStrurct:</p>
  <pre><code>@Mapper(componentModel=&quot;spring&quot;, unmappedTargetPolicy = ReportingPolicy.IGNORE)
  public interface AccountMapper {
      @Mapping(source = &quot;customerBank.customerId&quot;, target = &quot;customerId&quot;)
      AccountResponse toResponse(AccountBank accountBank);
  }
  </code></pre>
  <p>It works perfectly but actually in the case of someone change the customerId attribute by another name and forgets to change this mapper we will have a Runtime error.</p>
  <p>The pros for Converter is we will have a Compile time error and avoid Runtime error.</p>
  <p>Please, let me know if someone managed to share how to avoid Runtime error, like my presented scenario, using MapStruct, due to Converter does not bring the same advantage.</p>
  <p>My question is: Is it possible to use MapStruct with efficiency, I mean without Runtime error prone?</p>