Exemple #1
0
  @Test
  public void testInsertAndGetId() {

    @SuppressWarnings("resource")
    AbstractApplicationContext ctx =
        new ClassPathXmlApplicationContext(new String[] {"config/applicationContext.xml"});
    AdminDao userdao = (AdminDao) ctx.getBean("AdminDao");
    Admin user = new Admin();
    user.setAdminName("'why'");
    user.setAdminId("123");
    System.out.println(userdao.insertAndGetId(user));
  }
Exemple #2
0
  @Test
  public void testSaveAdmin() {

    @SuppressWarnings("resource")
    AbstractApplicationContext ctx =
        new ClassPathXmlApplicationContext(new String[] {"config/applicationContext.xml"});
    AdminDao userdao = (AdminDao) ctx.getBean("AdminDao");
    Admin user = new Admin();
    user.setAdminName("'why'");
    user.setAdminId("123");
    userdao.save(user);
  }