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 String
ACCOUNT_BY_NUM
static String
ACCOUNT_NUM_PARAM
private EntityManager
em
static String
GET_LEDGER
static String
GET_LEDGER_AVE
static String
GET_LEDGER_CNT
static String
GET_LEDGER_SUM
private static org.slf4j.Logger
log
-
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 Account
createAccount(Account account)
List<Account>
findAccounts(String queryName, Map<String,Object> params, int index, int count)
Account
getAccountById(long id)
Account
getAccountByNum(String acctNum)
Ledger
getLedger()
double
getLedgerAveBalance()
long
getLedgerCount()
double
getLedgerSum()
Account
removeAccount(Account account)
void
setEntityManager(EntityManager em)
Account
updateAccount(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:
createAccount
in interfaceAccountDAO
- Throws:
DAOException
-
findAccounts
public List<Account> findAccounts(String queryName, Map<String,Object> params, int index, int count) throws DAOException
- Specified by:
findAccounts
in interfaceAccountDAO
- Throws:
DAOException
-
getAccountById
public Account getAccountById(long id) throws DAOException
- Specified by:
getAccountById
in interfaceAccountDAO
- Throws:
DAOException
-
getAccountByNum
public Account getAccountByNum(String acctNum) throws DAOException
- Specified by:
getAccountByNum
in interfaceAccountDAO
- Throws:
DAOException
-
removeAccount
public Account removeAccount(Account account) throws DAOException
- Specified by:
removeAccount
in interfaceAccountDAO
- Throws:
DAOException
-
updateAccount
public Account updateAccount(Account account) throws DAOException
- Specified by:
updateAccount
in interfaceAccountDAO
- Throws:
DAOException
-
getLedger
public Ledger getLedger() throws DAOException
- Specified by:
getLedger
in interfaceAccountDAO
- Throws:
DAOException
-
getLedgerAveBalance
public double getLedgerAveBalance() throws DAOException
- Specified by:
getLedgerAveBalance
in interfaceAccountDAO
- Throws:
DAOException
-
getLedgerCount
public long getLedgerCount() throws DAOException
- Specified by:
getLedgerCount
in interfaceAccountDAO
- Throws:
DAOException
-
getLedgerSum
public double getLedgerSum() throws DAOException
- Specified by:
getLedgerSum
in interfaceAccountDAO
- Throws:
DAOException
-
-