Class JPAAccountDAO
- java.lang.Object
-
- ejava.examples.ejbsessionbank.jpa.JPAAccountDAO
-
- All Implemented Interfaces:
AccountDAO
public class JPAAccountDAO extends Object implements AccountDAO
-
-
Field Summary
Fields Modifier and Type Field Description static StringACCOUNT_BY_NUMstatic StringACCOUNT_NUM_PARAMprivate EntityManageremstatic StringGET_LEDGERstatic StringGET_LEDGER_AVEstatic StringGET_LEDGER_CNTstatic StringGET_LEDGER_SUMprivate static org.slf4j.Loggerlog-
Fields inherited from interface ejava.examples.ejbsessionbank.dao.AccountDAO
GET_ACCOUNTS_QUERY
-
-
Constructor Summary
Constructors Constructor Description JPAAccountDAO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AccountcreateAccount(Account account)List<Account>findAccounts(String queryName, Map<String,Object> params, int index, int count)AccountgetAccountById(long id)AccountgetAccountByNum(String acctNum)LedgergetLedger()doublegetLedgerAveBalance()longgetLedgerCount()doublegetLedgerSum()AccountremoveAccount(Account account)voidsetEntityManager(EntityManager em)AccountupdateAccount(Account account)
-
-
-
Field Detail
-
log
private static org.slf4j.Logger log
-
ACCOUNT_BY_NUM
public static final String ACCOUNT_BY_NUM
- See Also:
- Constant Field Values
-
ACCOUNT_NUM_PARAM
public static final String ACCOUNT_NUM_PARAM
- See Also:
- Constant Field Values
-
GET_LEDGER
public static final String GET_LEDGER
- See Also:
- Constant Field Values
-
GET_LEDGER_AVE
public static final String GET_LEDGER_AVE
- See Also:
- Constant Field Values
-
GET_LEDGER_CNT
public static final String GET_LEDGER_CNT
- See Also:
- Constant Field Values
-
GET_LEDGER_SUM
public static final String GET_LEDGER_SUM
- See Also:
- Constant Field Values
-
em
private EntityManager em
-
-
Method Detail
-
setEntityManager
public void setEntityManager(EntityManager em)
-
createAccount
public Account createAccount(Account account) throws DAOException
- Specified by:
createAccountin interfaceAccountDAO- Throws:
DAOException
-
findAccounts
public List<Account> findAccounts(String queryName, Map<String,Object> params, int index, int count) throws DAOException
- Specified by:
findAccountsin interfaceAccountDAO- Throws:
DAOException
-
getAccountById
public Account getAccountById(long id) throws DAOException
- Specified by:
getAccountByIdin interfaceAccountDAO- Throws:
DAOException
-
getAccountByNum
public Account getAccountByNum(String acctNum) throws DAOException
- Specified by:
getAccountByNumin interfaceAccountDAO- Throws:
DAOException
-
removeAccount
public Account removeAccount(Account account) throws DAOException
- Specified by:
removeAccountin interfaceAccountDAO- Throws:
DAOException
-
updateAccount
public Account updateAccount(Account account) throws DAOException
- Specified by:
updateAccountin interfaceAccountDAO- Throws:
DAOException
-
getLedger
public Ledger getLedger() throws DAOException
- Specified by:
getLedgerin interfaceAccountDAO- Throws:
DAOException
-
getLedgerAveBalance
public double getLedgerAveBalance() throws DAOException- Specified by:
getLedgerAveBalancein interfaceAccountDAO- Throws:
DAOException
-
getLedgerCount
public long getLedgerCount() throws DAOException- Specified by:
getLedgerCountin interfaceAccountDAO- Throws:
DAOException
-
getLedgerSum
public double getLedgerSum() throws DAOException- Specified by:
getLedgerSumin interfaceAccountDAO- Throws:
DAOException
-
-