Método de remoção o objeto:
Já tentei descobrir e não consegui.
@Transactional public class BaseRepositorio {
@PersistenceContext private EntityManager entityManager;
public EntityManager getEntityManager() { return entityManager; }
public void setEntityManager(EntityManager entityManager) { this.entityManager = entityManager; }
public void remover(T objeto) { getEntityManager().remove(objeto); } }
Mostra este erro no html
Exception
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalArgumentException: Removing a detached instance br.com.netsoft.desif.model.endereco.PaisEntity#85 org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:982) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) javax.servlet.http.HttpServlet.service(HttpServlet.java:635) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) javax.servlet.http.HttpServlet.service(HttpServlet.java:742) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)