Skip to content

Instantly share code, notes, and snippets.

@samuelsonbrito
Created December 16, 2014 02:42
Show Gist options
  • Save samuelsonbrito/de169b49976f1b4c4da2 to your computer and use it in GitHub Desktop.
Save samuelsonbrito/de169b49976f1b4c4da2 to your computer and use it in GitHub Desktop.
private void salvarUsuario(Usuario usuario) {
EntityManager entityManager = getEntityManager();
entityManager.getTransaction().begin();
entityManager.persist(usuario);
entityManager.getTransaction().commit();
entityManager.close();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment