As discussed in the comments: the entity needs to be in the persistence context for Hibernate to properly delete it. So the solution is to fetch it using Hibernate first.
Replace
session.delete(usuario);
with
session.delete(session.get(Usuario.class, usuario.getIdUsuario()));
Be careful: get()
can return null
values if the entity is no longer in the database, so you better check for that before passing the object to delete
.