MS Lesson14: @Transactional
1. Arxa planda proxy nece implement olunur package guru.springframework.cruddemo.service.impl; import guru.springframework.cruddemo.entity.Account; import guru.springframework.cruddemo.repository.AccountRepository; import guru.springframework.cruddemo.service.AccountService; import lombok. RequiredArgsConstructor ; import lombok.extern.slf4j. Slf4j ; import org.springframework.stereotype. Service ; import org.springframework.transaction.annotation. Transactional ; @Service @Slf4j @RequiredArgsConstructor public class AccountServiceImpl implements AccountService { private final AccountRepository accountRepository ; @Override @Transactional public void transfer (Integer amount) { Account fromAccount = accountRepository .findById( 1L ).get(); Account toAccount = accountRepository .findById( 2L ).get(); fromAccount.setAmount(fromAccount.getAmount() - amount); toAccount.setAmount(toAccount.getAmount() + amount); } } arxa planda yaranan kla...