Сопоставитель моделей : путает назначение сопоставления с большим количеством полей, чем источник

#java #mapping #modelmapper

Вопрос:

Я столкнулся с проблемой с классом сопоставления моделей. Я должен сопоставить 2 объекта :

Источник

 @Getter
@Setter
@Document(collection = "accountpayable")
@NoArgsConstructor
public class AccountPayable extends AccountingRecord {

    private String invoiceNumber;
    private LocalDateTime invoiceListReceivedDateTime;
    private Integer invoiceListMonth;

    @Builder
    public AccountPayable(
        final String invoiceNumber,final LocalDateTime invoiceListReceivedDateTime, final Integer invoiceListMonth) {
        super(ledger, sourceSystem, federation, sourceNumber, invoiceAmount, ogmNr, sentToFinancialServiceDate, finsReferenceNumber, AccountingType.AP, financialTransactionId, context);
        this.invoiceNumber = invoiceNumber;
        this.invoiceListReceivedDateTime = invoiceListReceivedDateTime;
        this.invoiceListMonth = invoiceListMonth;
    }}
 

и пункт назначения :

 @Document(collection = "financialTransactionAccountingOverview")
public class FinancialTransactionAccountingOverview extends BaseEntity {
  private int invoiceListYear;
  private int invoiceListMonth;
  private LocalDateTime invoiceListReceivedDateTime;
  
   public FinancialTransactionAccountingOverview(final String hcoNr, final int invoiceListYear, final int invoiceListMonth, final int invoiceListNumber, final Double acceptedAmount, final PayabilityState payabilityState, final MotivationType motivationType, final LocalDate paymentDueDate, final String iban, final LocalDateTime sentToFinancialServiceDate, final String name, final SearchType searchType, final LocalDateTime invoiceListReceivedDateTime, final String riziv, final FinancialTransactionState financialTransactionState, final Double invoiceAmount, final String paymentRemark, final LocalDate receiptDate, final String kboNr, final String context) {
    this.invoiceListYear = invoiceListYear;
    this.invoiceListMonth = invoiceListMonth;
    this.invoiceListReceivedDateTime = invoiceListReceivedDateTime;

    }

  public int getInvoiceListYear() {
    return this.invoiceListYear;
  }

  public int getInvoiceListMonth() {
    return this.invoiceListMonth;
  }
    
  public LocalDateTime getInvoiceListReceivedDateTime() {
    return this.invoiceListReceivedDateTime;
  }
    
  public void setInvoiceListYear(final int invoiceListYear) {
    this.invoiceListYear = invoiceListYear;
  }

  public void setInvoiceListMonth(final int invoiceListMonth) {
    this.invoiceListMonth = invoiceListMonth;
  }
  
 public void setInvoiceListReceivedDateTime(final LocalDateTime invoiceListReceivedDateTime) {
    this.invoiceListReceivedDateTime = invoiceListReceivedDateTime;
  }
}
 

Счет-фактура месяц = 1
счет-фактура Дата получения = 2019-01-28T11:42:35.686 01:00

поля invoiceListMonth и invoiceListReceivedDateTime хорошо отображаются в пункте назначения. но есть проблема, когда дело доходит до поля invoiceListYear. Я ожидаю, что не увижу сопоставления для поля invoiceListYear, но результат-2019 год !

Я отладил картограф, я видел эту штуку :

Сопоставление свойств[Оплачиваемый счет.invoiceListReceivedDateTime.year -> Финансовая транзакцияаккаунтинговый просмотр.Счет-фактура за год]

Skipping the mapping of this field so it solved the problem, but is it normal ?

FYI : the model mapper is setup with the default config

thank you in advance