Package mjg.spring.entities

Examples of mjg.spring.entities.Account


    @Autowired
    private AccountDAO dao;

    @Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
    public BigDecimal getAccountBalance(int id) {
        Account account = dao.findAccountById(id);
        return account.getBalance();
    }
View Full Code Here


        Account account = dao.findAccountById(id);
        return account.getBalance();
    }

    public BigDecimal depositIntoAccount(int id, BigDecimal amount) {
        Account account = dao.findAccountById(id);
        account.deposit(amount);
        dao.updateAccount(account);
        return account.getBalance();
    }
View Full Code Here

        dao.updateAccount(account);
        return account.getBalance();
    }

    public BigDecimal withdrawFromAccount(int id, BigDecimal amount) {
        Account account = dao.findAccountById(id);
        account.withdraw(amount);
        dao.updateAccount(account);
        return account.getBalance();
    }
View Full Code Here

        dao.updateAccount(account);
        return account.getBalance();
    }

    public boolean transferFunds(int fromId, int toId, BigDecimal amount) {
        Account from = dao.findAccountById(fromId);
        Account to = dao.findAccountById(toId);
        from.withdraw(amount);
        to.deposit(amount);
        dao.updateAccount(from);
        dao.updateAccount(to);
        return true;
    }
View Full Code Here

TOP

Related Classes of mjg.spring.entities.Account

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.