Gent, and I'm trying to create a method in which I delete the database record. However, it is giving the following error:
Caused by: org.hibernate.MappingException: Unknown entity: java.lang.Integer
Code:
public void delete(int user) {
Consultar consulta = new Consultar ();
EntityManager deletar = consulta.getEntityManager();
System.out.println("usuário deletado"+user);
deletar.getTransaction().begin();
deletar.remove(user);
deletar.getTransaction().commit();
}