예제 #1
0
  @Test
  public void testSearch() throws Exception {

    ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("beans.xml");
    ZaiqianDAO zaiqianDao = (ZaiqianDAO) ctx.getBean("zaiqianDao");

    Zaiqian z = new Zaiqian();
    z.setId(1);

    Assert.assertEquals(1, zaiqianDao.search(z).size());
  }
예제 #2
0
  @Test
  public void testDelete() throws Exception {

    ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("beans.xml");
    ZaiqianDAO zaiqianDao = (ZaiqianDAO) ctx.getBean("zaiqianDao");

    Zaiqian z = new Zaiqian();

    z.setId(1);

    zaiqianDao.delete(z);
  }
예제 #3
0
  @Test
  public void testUpdate() throws Exception {

    ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("beans.xml");
    ZaiqianDAO zaiqianDao = (ZaiqianDAO) ctx.getBean("zaiqianDao");

    Zaiqian z = new Zaiqian();

    z.setId(1);
    Yuangong yg = new Yuangong();
    yg.setId(2);
    z.setFz_person(yg);

    zaiqianDao.update(z);
  }