Package com.testdomain

Examples of com.testdomain.Account


    String email = (String) sqlMap.queryForObject("getEmailAddressViaResultMap", new Integer(1));
    assertEquals("clinton.begin@ibatis.com", email);
  }

  public void testExecuteQueryForObjectWithResultObject() throws SQLException {
    Account account = new Account();
    Account testAccount = (Account) sqlMap.queryForObject("getAccountViaColumnName", new Integer(1), account);
    assertAccount1(account);
    assertTrue(account == testAccount);
  }
View Full Code Here


    assertEquals(100, testItem.getId());

  }

  public void testExecuteUpdateWithParameterMap() throws SQLException {
    Account account = (Account) sqlMap.queryForObject("getAccountViaColumnName", new Integer(1));

    account.setId(6);
    account.setEmailAddress("new.clinton@ibatis.com");
    account.setBannerOption(true);
    account.setCartOption(true);
    sqlMap.update("insertAccountViaParameterMap", account);

    account = (Account) sqlMap.queryForObject("getAccountViaColumnName", new Integer(6));

    assertEquals(true, account.isBannerOption());
    assertEquals(true, account.isCartOption());
    assertEquals("new.clinton@ibatis.com", account.getEmailAddress());

  }
View Full Code Here

    assertEquals("new.clinton@ibatis.com", account.getEmailAddress());

  }

  public void testExecuteUpdateWithInlineParameters() throws SQLException {
    Account account = (Account) sqlMap.queryForObject("getAccountViaColumnName", new Integer(1));

    account.setEmailAddress("new.clinton@ibatis.com");
    try {
      sqlMap.startTransaction();
      sqlMap.update("updateAccountViaInlineParameters", account);
      sqlMap.commitTransaction();
    } finally {
      sqlMap.endTransaction();
    }
    account = (Account) sqlMap.queryForObject("getAccountViaColumnName", new Integer(1));

    assertEquals("new.clinton@ibatis.com", account.getEmailAddress());

  }
View Full Code Here

    assertEquals("new.clinton@ibatis.com", account.getEmailAddress());

  }

  public void testExecuteUpdateWithParameterClass() throws SQLException {
    Account account = new Account();
    account.setId(5);

    boolean checkForInvalidTypeFailedAppropriately = false;
    try {
      sqlMap.update("deleteAccount", new Object());
    } catch (SQLException e) {
View Full Code Here

    assertEquals(3, list.size());
  }

  public void testIterateWithPrepend2b() throws SQLException {

    Account account1, account2, account3;
    account1 = new Account();
    account1.setId(1);

    account2 = new Account();
    account2.setId(2);

    account3 = new Account();
    account3.setId(3);

    List params = Arrays.asList(new Account[]{account1, account2, account3});
    List list = sqlMap.queryForList("dynamicIterateWithPrepend2b", params);
    assertAccount1((Account) list.get(0));
View Full Code Here

    assertEquals(3, list.size());
  }

  public void testIterateWithPrepend2c() throws SQLException {

    Account account1, account2, account3;
    account1 = new Account();
    account1.setId(1);

    account2 = new Account();
    account2.setId(2);

    account3 = new Account();
    account3.setId(3);

    List params = Arrays.asList(new Account[]{account1, account2, account3});

    MyBean x = new MyBean();
View Full Code Here

    assertAccount1((Account) list.get(0));
    assertEquals(3, list.size());
  }

  public void testDynamicWithPrepend1() throws SQLException {
    Account account = new Account();
    account.setId(1);
    account = (Account) sqlMap.queryForObject("dynamicWithPrepend", account);
    assertAccount1(account);
  }
View Full Code Here

    account = (Account) sqlMap.queryForObject("dynamicWithPrepend", account);
    assertAccount1(account);
  }

  public void testDynamicWithPrepend2() throws SQLException {
    Account account = new Account();
    account.setId(1);
    account.setFirstName("Clinton");
    account = (Account) sqlMap.queryForObject("dynamicWithPrepend", account);
    assertAccount1(account);
  }
View Full Code Here

    account = (Account) sqlMap.queryForObject("dynamicWithPrepend", account);
    assertAccount1(account);
  }

  public void testDynamicWithPrepend3() throws SQLException {
    Account account = new Account();
    account.setId(1);
    account.setFirstName("Clinton");
    account.setLastName("Begin");
    account = (Account) sqlMap.queryForObject("dynamicWithPrepend", account);
    assertAccount1(account);
  }
View Full Code Here

    assertAccount1((Account) list.get(0));
    assertEquals(5, list.size());
  }

  public void testIterateWithTwoPrepends() throws SQLException {
    Account account = new Account();
    account.setId(1);
    account.setFirstName("Clinton");
    account = (Account) sqlMap.queryForObject("dynamicWithPrepend", account);
    assertNotNull(account);
    assertAccount1(account);

    List list = sqlMap.queryForList("dynamicWithTwoDynamicElements", account);
View Full Code Here

TOP

Related Classes of com.testdomain.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.