Skip to content
This repository was archived by the owner on Jan 13, 2023. It is now read-only.

Commit 03455bf

Browse files
committed
Updated AccountService.java
1 parent 608f4c5 commit 03455bf

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

jpa-tx-management/src/main/java/com/bobocode/AccountApp.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class AccountApp {
1919
public static void main(String[] args) {
2020
init();
2121
accountService.printAllAccounts();
22-
accountService.withdraw(1L, BigDecimal.valueOf(1_000_000));
22+
accountService.withdraw(1L, BigDecimal.valueOf(1000));
2323
accountService.printAllAccounts();
2424
}
2525

jpa-tx-management/src/main/java/com/bobocode/service/AccountService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public void save(Account account) {
2323

2424
public void withdraw(long accountId, BigDecimal value) {
2525
Account account = accountDao.findById(accountId);
26-
account.setBalance(account.getBalance().add(value));
26+
account.setBalance(account.getBalance().subtract(value));
2727
}
2828

2929
@Transactional(readOnly = true)

0 commit comments

Comments
 (0)