Skip to content

Instantly share code, notes, and snippets.

@thjanssen
Last active July 26, 2019 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thjanssen/50a0a42199c0301a4ec3b66c1bb3d985 to your computer and use it in GitHub Desktop.
Save thjanssen/50a0a42199c0301a4ec3b66c1bb3d985 to your computer and use it in GitHub Desktop.
HashMap<String, Object> hints = new HashMap<>();
hints.put("javax.persistence.query.timeout", 1000);
em.find(Author.class, 1L, hints);
List<Author> authors = em.createQuery("SELECT a FROM Author a")
.setHint("javax.persistence.query.timeout", 1000)
.getResultList();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment