D
D
Dmitry Volokitin2021-04-17 18:11:48
Java
Dmitry Volokitin, 2021-04-17 18:11:48

How to fix java compilation error: cannot find symbol symbol:?

In general:
I am writing a training banking service that calculates interest on a loan. I am more than sure that the error is in the very construction of my code, but I don’t understand how to fix it ... help whoever can.

@Override
    public CreditDTO statement(CreditDTO creditDTO){
        CreditEntity creditDtoFromEntity = CreditMap.INSTANCE.toEntity(creditDTO);
        CreditEntity creditEntity = new CreditEntity();//кредит
        creditEntity.setLimit(creditDtoFromEntity.getLimit());//Сумма необходимая клиенту
        creditEntity.setPercent(creditDtoFromEntity.getPercent());//проценты
        creditEntity.setMonths(creditDtoFromEntity.getMonths()); // кол-во месяцев
        creditEntity.getBankEntity().setId(BankMap.INSTANCE.toEntity(creditDTO.getBankDTO()).getId());// id банка
        creditEntity.getClientEntity().setId(ClientMap.INSTANCE.toEntity( creditDTO.getClientDTO()).getId());// id клиента

        CreditEntity save = creditRepo.save(creditEntity);

        return CreditMap.INSTANCE.toDto(save);

    }


@Override
    public OfferDTO registration(OfferDTO offerDTO) {


        OfferEntity offer = new OfferEntity();// новое КП
        CreditEntity creditEntity = CreditMap.INSTANCE.toEntity(statement(offerDTO.getCreditDTO()));

        offer.setCreditId(creditEntity.getId());
        offer.setClientId(creditEntity.getClientEntity().getId());

        int oneРundredPercent = 100;
        offer.setClientId(offer.getClientId());//id клиента вписываем вручную, раз уж спринг секьюрити нет...
        offer.setPaymentDate(new Date());//дата платежа
        offer.setSum(creditEntity.getLimit()+creditEntity.getLimit()/oneРundredPercent*creditEntity.getPercent());//сумма+проценты
        offer.setSumPay(offer.getSum()/creditEntity.getMonths()); //месячный платёж
        offer.setSumPayDeposit(creditEntity.getLimit()/creditEntity.getMonths()); //гашение задолжности без процентов
        offer.setSumPayPercent(offer.getSumPay()-offer.getSumPayDeposit());//гашение процентов

        OfferEntity save = offerRepo.save(offer);
        return OfferMap.INSTANCE.toDto(save);

    }

C:\Users\Дмитрий\Desktop\bank\src\main\java\com\example\demo\service\impl\CalculateServiceImpl.java:32:50
java: cannot find symbol
  symbol:   method getLimit()
  location: variable creditDtoFromEntity of type com.example.demo.model.entity.CreditEntity

607afe45ea3b8967471314.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Orkhan, 2021-04-17
Hasanly @azerphoenix

Good afternoon!
Please note that in your console all getters drop out with an error. This happens due to errors when using the lombok library.
For example, the lombok plugin is not installed in IDEA or, for example, annotation processing is not enabled for this project
Make sure you have the plugin installed and enabled - https://plugins.jetbrains.com/plugin/6317-lombok
https://stackoverflow.com /questions/24006937/lombo...
https://www.jetbrains.com/help/idea/annotation-pro...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question