30313233343536373839
return em.createQuery(c).getResultList(); } @Transactional public void removePerson(Integer id) { Person person = em.find(Person.class, id); if (null != person) { em.remove(person); } }
20212223242526272829
private PersonService personService; @RequestMapping("/") public String listPeople(Map<String, Object> map) { map.put("person", new Person()); map.put("peopleList", personService.listPeople()); return "people"; }