コード例 #1
0
 @RequestMapping(value = "/customerDelete/{id}")
 @Transactional
 public String delete(@PathVariable Long id) {
   Customer customer = customerRepository.findOne(id);
   if (customer != null) {
     customerRepository.delete(customer);
   }
   return "redirect:/customer";
 }
コード例 #2
0
 @RequestMapping(value = "/customerClear/{id}")
 @Transactional
 public String clear(@PathVariable Long id) {
   Customer customer = customerRepository.findOne(id);
   if (customer != null) {
     customer.setSurveyInfo(new SurveyInfo());
     customerRepository.save(customer);
   }
   return "redirect:/customer/" + id;
 }