@Override
 @Transactional(noRollbackFor = {Throwable.class})
 public void saveTwo(User o1, User o2) {
   userDAO.save(o1);
   info("save user name: " + o1.getName());
   userDAO.save(o2);
 }
 @RequestMapping("/save")
 public String save(
     Model model,
     @RequestParam(required = false) String name,
     @RequestParam(required = false) String sex,
     @RequestParam(required = false) String ageStr) {
   int age = 0;
   try {
     age = Integer.parseInt(ageStr);
   } catch (NumberFormatException e) {
   }
   ;
   User user = new User();
   user.setName(name);
   user.setSex(sex);
   user.setAge(age);
   user.setBorn(new Date());
   boolean status = userDAO.save(user);
   model.addAttribute("status", status);
   return "save";
 }
 @Override
 public int getTotalCount() {
   return userDAO.getTotalCount();
 }
 @RequestMapping("/user")
 public String queryByName(Model model, @RequestParam String name) {
   model.addAttribute("user", userDAO.getByName(name));
   return "user";
 }
 @RequestMapping("/user/{id}")
 public String queryById(Model model, @PathVariable int id) {
   model.addAttribute("user", userDAO.getById(id));
   return "user";
 }
 @RequestMapping("/query")
 public String query(Model model) {
   List<User> users = userDAO.getAll();
   model.addAttribute("users", users);
   return "query";
 }