Package com.ibatis.jpetstore.domain

Examples of com.ibatis.jpetstore.domain.Account


  public List getUsernameList() {
    return queryForList("getUsernameList", null);
  }

  public Account getAccount(String username, String password) {
    Account account = new Account();
    account.setUsername(username);
    account.setPassword(password);
    return (Account) queryForObject("getAccountByUsernameAndPassword", account);
  }
View Full Code Here


  }

  /* Constructors */

  public AccountBean() {
    account = new Account();
  }
View Full Code Here

      setAccountListOption(false);
    }
  }

  public void clear() {
    setAccount(new Account());
    repeatedPassword = null;
    pageDirection = null;
    myList = null;
    authenticated = false;
  }
View Full Code Here

    if (accountBean == null || !accountBean.isAuthenticated()){
      ActionContext.getActionContext().setSimpleMessage("You must sign on before attempting to check out.  Please sign on and try checking out again.");
      return "signon";
    } else if (cartBean != null) {
      // Re-read account from DB at team's request.
      Account account = accountService.getAccount(accountBean.getAccount().getUsername());
      order.initOrder(account, cartBean.getCart());
      return "success";
    } else {
      ActionContext.getActionContext().setSimpleMessage("An order could not be created because a cart could not be found.");
      return "failure";
View Full Code Here

public class AccountDaoTest extends BasePersistenceTest {

  private AccountDao acctDao = (AccountDao) daoMgr.getDao(AccountDao.class);

  public void testShouldFindDefaultUserAccountByUsername() throws Exception {
    Account acct = acctDao.getAccount("j2ee");
    assertNotNull(acct);
  }
View Full Code Here

    Account acct = acctDao.getAccount("j2ee");
    assertNotNull(acct);
  }

  public void testShouldFindDefaultUserAccountByUsernameAndPassword() throws Exception {
    Account acct = acctDao.getAccount("j2ee", "j2ee");
    assertNotNull(acct);
  }
View Full Code Here

    Account acct = acctDao.getAccount("j2ee", "j2ee");
    assertNotNull(acct);
  }

  public void testShouldInsertNewAccount() throws Exception {
    Account acct = DomainFixture.newTestAccount();
    acctDao.insertAccount(acct);
    acct = acctDao.getAccount("cbegin");
    assertNotNull(acct);
  }
View Full Code Here

    assertNotNull(acct);
  }

  public void testShouldUpdateAccountEmailAddress() throws Exception {
    String newEmail = "new@email.com";
    Account acct = acctDao.getAccount("j2ee");
    acct.setEmail(newEmail);
    acctDao.updateAccount(acct);
    acct = acctDao.getAccount("j2ee");
    assertNotNull(acct);
    assertEquals(newEmail, acct.getEmail());
  }
View Full Code Here

    public Account getAccount(String username) {
        return (Account) queryForObject("getAccountByUsername", username);
    }

    public Account getAccount(String username, String password) {
        Account account = new Account();
        account.setUsername(username);
        account.setPassword(password);
        return (Account) queryForObject("getAccountByUsernameAndPassword", account);
    }
View Full Code Here

    public AccountBean() {
        this(new AccountService(), new CatalogService());
    }

    public AccountBean(AccountService accountService, CatalogService catalogService) {
        account = new Account();
        this.accountService = accountService;
        this.catalogService = catalogService;
    }
View Full Code Here

TOP

Related Classes of com.ibatis.jpetstore.domain.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.