Package com.apress.prospring.ch10

Examples of com.apress.prospring.ch10.Main


    }
    System.out.println("Took " + (System.currentTimeMillis() - startMillis) + " ms");   
  }
 
  private void customer() {
    CustomerDao customerDao = (CustomerDao)context.getBean("customerDao");
   
    Customer janm = customerDao.getById(1);
    Customer robh = customerDao.getById(2);
   
    System.out.println(janm);
    System.out.println(robh);
  }
View Full Code Here


    System.out.println(janm);
    System.out.println(robh);
  }
 
  private void order() {
    OrderDao orderDao = (OrderDao)context.getBean("orderDao");
    Order order = orderDao.getById(1);     
    System.out.println(order);
  }
View Full Code Here

 
  private ApplicationContext context;
 
  private void test() {
    System.out.println("Getting testDao");
    TestDao testDao = (TestDao)context.getBean("testDao");
   
    Date today = Calendar.getInstance().getTime();

    System.out.println("Inserting new Test record");
    Test test = new Test();
    test.setName("new one");
    test.setRunDate(today);
    testDao.save(test);
   
    System.out.println("Test inserted " + test);
   
    List tests = testDao.getAll();
    for (Iterator i = tests.iterator(); i.hasNext();) {
      test = (Test)i.next();
      System.out.println(test);
    }
   
    long startMillis = System.currentTimeMillis();
    for (int i = 0; i < 25000; i++) {
      testDao.getByNameAndRunDate("foo", today);
    }
    System.out.println("Took " + (System.currentTimeMillis() - startMillis) + " ms");
   
    startMillis = System.currentTimeMillis();
    for (int i = 0; i < 5000; i++) {
      testDao.updateName(1, "foobar");
    }
    System.out.println("Took " + (System.currentTimeMillis() - startMillis) + " ms");   
  }
View Full Code Here

  }
 
  private void customer() {
    CustomerDao customerDao = (CustomerDao)context.getBean("customerDao");
   
    Customer janm = customerDao.getById(1);
    Customer robh = customerDao.getById(2);
   
    System.out.println(janm);
    System.out.println(robh);
  }
View Full Code Here

    System.out.println(robh);
  }
 
  private void order() {
    OrderDao orderDao = (OrderDao)context.getBean("orderDao");
    Order order = orderDao.getById(1);     
    System.out.println(order);
  }
View Full Code Here

    TestDao testDao = (TestDao)context.getBean("testDao");
   
    Date today = Calendar.getInstance().getTime();

    System.out.println("Inserting new Test record");
    Test test = new Test();
    test.setName("new one");
    test.setRunDate(today);
    testDao.save(test);
   
    System.out.println("Test inserted " + test);
   
    List tests = testDao.getAll();
View Full Code Here

    params.put("runDate", runDate);
    return getSqlMapClientTemplate().queryForList("getTestsByNameAndRunDateMap", params);
  }

  public List getByNameAndRunDateDO(String name, Date runDate) {
    Test test = new Test();
    test.setName(name);
    test.setRunDate(runDate);
    return getSqlMapClientTemplate().queryForList("getTestsByNameAndRunDateDO", test);
  }
View Full Code Here

TOP

Related Classes of com.apress.prospring.ch10.Main

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.