01: package com.ibatis.jpetstore.service;
02:
03: import java.util.List;
04:
05: import org.huihoo.jfox.soaf.container.ServiceFactory;
06: import org.huihoo.jfox.soaf.services.logging.LoggingService;
07:
08: import com.ibatis.dao.client.DaoManager;
09: import com.ibatis.jpetstore.domain.Account;
10: import com.ibatis.jpetstore.persistence.DaoConfig;
11: import com.ibatis.jpetstore.persistence.iface.AccountDao;
12:
13: /**
14: * <p/>Date: Mar 6, 2004 11:22:43 PM
15: *
16: * @author Clinton Begin
17: */
18: public class AccountServiceImpl implements AccountService {
19:
20: private LoggingService log = (LoggingService) ServiceFactory
21: .getInstance().getService(LoggingService.class);
22:
23: /* Private Fields */
24:
25: private DaoManager daoManager = DaoConfig.getDaomanager();
26:
27: private AccountDao accountDao;
28:
29: /* Constructors */
30:
31: public AccountServiceImpl() {
32: accountDao = (AccountDao) daoManager.getDao(AccountDao.class);
33: log.info("AccountDAO : " + accountDao);
34: }
35:
36: /* ACCOUNT */
37:
38: public Account getAccount(String username) {
39: log.info("Get Account **************");
40: return accountDao.getAccount(username);
41: }
42:
43: public Account getAccount(String username, String password) {
44: return accountDao.getAccount(username, password);
45: }
46:
47: public void insertAccount(Account account) {
48: accountDao.insertAccount(account);
49: }
50:
51: public void updateAccount(Account account) {
52: log.info("Update Account **************");
53: accountDao.updateAccount(account);
54: }
55:
56: public List getUsernameList() {
57: return accountDao.getUsernameList();
58: }
59:
60: }
|