Package com.testdomain

Examples of com.testdomain.Account


    List list = sqlMap.queryForList("dynamicWithTwoDynamicElements", account);
    assertAccount1((Account) list.get(0));
  }

  public void testComplexDynamic() throws SQLException {
    Account account = new Account();
    account.setId(1);
    account.setFirstName("Clinton");
    account.setLastName("Begin");
    List list = sqlMap.queryForList("complexDynamicStatement", account);
    assertAccount1((Account) list.get(0));
  }
View Full Code Here


    assertEquals(1, order1.getFavouriteLineItem().getOrderId());

  }

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

    initScript("com/scripts/account-init.sql");
  }

  public void testExecutebatchDetailed() {
    List accountList1 = new ArrayList();
    Account account = new Account();
    account.setId(10);
    account.setFirstName("fred");
    account.setLastName("flintstone");
    account.setEmailAddress("fred.flintstone@gmail.com");
    accountList1.add(account);

    account = new Account();
    account.setId(11);
    account.setFirstName("fred");
    account.setLastName("flintstone");
    account.setEmailAddress("fred.flintstone@gmail.com");
    accountList1.add(account);

    account = new Account();
    account.setId(12);
    account.setFirstName("fred");
    account.setLastName("flintstone");
    account.setEmailAddress("fred.flintstone@gmail.com");
    accountList1.add(account);

    account = new Account();
    account.setId(13);
    account.setFirstName("fred");
    account.setLastName("flintstone");
    account.setEmailAddress("fred.flintstone@gmail.com");
    accountList1.add(account);

    account = new Account();
    account.setId(14);
    account.setFirstName("fred");
    account.setLastName("flintstone");
    account.setEmailAddress("fred.flintstone@gmail.com");
    accountList1.add(account);

    List accountList2 = new ArrayList();
    account = new Account();
    account.setId(15);
    account.setFirstName("fred");
    account.setLastName("flintstone");
    account.setEmailAddress("fred.flintstone@gmail.com");
    accountList2.add(account);

    account = new Account();
    account.setId(16);
    account.setFirstName("fred");
    account.setLastName("flintstone");
    account.setEmailAddress("fred.flintstone@gmail.com");
    accountList2.add(account);

    account = new Account();
    account.setId(17);
    account.setFirstName("fred");
    account.setLastName("flintstone");
    account.setEmailAddress("fred.flintstone@gmail.com");
    accountList2.add(account);

    account = new Account();
    account.setId(18);
    account.setFirstName("fred");
    account.setLastName("flintstone");
    account.setEmailAddress("fred.flintstone@gmail.com");
    accountList2.add(account);

    try {
      sqlMap.startTransaction();
      sqlMap.startBatch();

      // insert 5 accounts
      for (int i = 0; i < accountList1.size(); i++) {
        sqlMap.insert("insertAccountViaInlineParameters", accountList1.get(i));
      }

      // update 1 account
      account = new Account();
      account.setId(10);
      account.setFirstName("barney");
      account.setLastName("rubble");
      account.setEmailAddress("barney.rubble@gmail.com");

      sqlMap.update("updateAccountViaInlineParameters", account);

      // insert 4 accounts
      for (int i = 0; i < accountList2.size(); i++) {
View Full Code Here

    int secondId = System.identityHashCode(list);

    assertEquals(firstId, secondId);

    Account account = (Account) list.get(1);
    account.setEmailAddress("new.clinton@ibatis.com");
    sqlMap.update("updateAccountViaInlineParameters", account);

    list = sqlMap.queryForList("getCachedAccountsViaResultMap", null);

    int thirdId = System.identityHashCode(list);
View Full Code Here

    int secondId = System.identityHashCode(list);

    assertEquals(firstId, secondId);

    Account account = (Account) list.get(1);
    account.setEmailAddress("new.clinton@ibatis.com");
    sqlMap.update("updateAccountViaInlineParameters", account);

    list = sqlMap.queryForList("getCachedAccountsViaResultMap");

    int thirdId = System.identityHashCode(list);
View Full Code Here

    assertTrue(firstId.equals(secondId));

    List list = (List) results.get("list");

    Account account = (Account) list.get(1);
    account.setEmailAddress("new.clinton@ibatis.com");
    sqlMap.update("updateAccountViaInlineParameters", account);

    list = sqlMap.queryForList("getCachedAccountsViaResultMap", null);

    int thirdId = System.identityHashCode(list);
View Full Code Here

    assertFalse(firstId.equals(secondId));

    List list = (List) results.get("list");

    Account account = (Account) list.get(1);
    account.setEmailAddress("new.clinton@ibatis.com");
    sqlMap.update("updateAccountViaInlineParameters", account);

    list = sqlMap.queryForList("getCachedAccountsViaResultMap", null);

    int thirdId = System.identityHashCode(list);
View Full Code Here

  }

  // ARRAY

  public void testArrayPropertyIterate() throws SQLException {
    Account account = new Account();
    account.setIds(new int[]{1, 2, 3});
    List list = sqlMap.queryForList("dynamicQueryByExample", account);
    assertAccount1((Account) list.get(0));
    assertEquals(3, list.size());
  }
View Full Code Here

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

  public void testArrayPropertyIterate2() throws SQLException {
    Account account = new Account();
    account.setAge(4);
    account.setIds(new int[]{1, 2, 3});
    List list = sqlMap.queryForList("dynamicQueryByExample2", account);
    assertAccount1((Account) list.get(0));
    assertEquals(3, list.size());
  }
View Full Code Here

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

  public void testArrayPropertyIterate2Literal() throws SQLException {
    Account account = new Account();
    account.setAge(4);
    account.setIds(new int[]{1, 2, 3});
    List list = sqlMap.queryForList("dynamicQueryByExample2Literal", account);
    assertAccount1((Account) list.get(0));
    assertEquals(3, list.size());
  }
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.