Last active
June 7, 2016 16:12
-
-
Save thjanssen/d06f1a429b033779ee71e18991fc43a8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
em.createNamedQuery(“selectAuthors”).getResultList(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EntityGraph<?> graph = em.getEntityGraph(“graph.AuthorBooks”); | |
HashMap<String, Object> properties = new HashMap<>(); | |
properties.put(“javax.persistence.fetchgraph”, graph); | |
em.find(Author.class, 1L, properties); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@NamedQuery(name = “selectAuthors”, query = “SELECT a FROM Author a”, | |
hints = @QueryHint(name = QueryHints.COMMENT, value = “a custom SQL comment”)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
EntityGraph<?> graph = em.getEntityGraph(“graph.AuthorBooks”); | |
em.createQuery(“SELECT a FROM Author a”) | |
.setHint(“javax.persistence.fetchgraph”, graph) | |
.getResultList(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment