Professional Documents
Culture Documents
org/tips-to-boost-your-hibernate-performance/
▼ ▼ ▼ ▼
1 of 18 6/14/2019, 10:34 AM
7 Tips to boost your Hibernate performance https://thoughts-on-java.org/tips-to-boost-your-hibernate-performance/
▼ ▼ ▼ ▼
2 of 18 6/14/2019, 10:34 AM
7 Tips to boost your Hibernate performance https://thoughts-on-java.org/tips-to-boost-your-hibernate-performance/
▼ ▼ ▼ ▼
3 of 18 6/14/2019, 10:34 AM
7 Tips to boost your Hibernate performance https://thoughts-on-java.org/tips-to-boost-your-hibernate-performance/
▼ ▼ ▼ ▼
1 @NamedEntityGraph(name = "graph.AuthorBooksReviews",
2 attributeNodes = @NamedAttributeNode(value = "books"))
4 of 18 6/14/2019, 10:34 AM
7 Tips to boost your Hibernate performance https://thoughts-on-java.org/tips-to-boost-your-hibernate-performance/
▼ ▼ ▼ ▼
1 @NamedStoredProcedureQuery(
2 name = "getBooks",
3 procedureName = "get_books",
4 resultClasses = Book.class,
5 parameters = { @StoredProcedureParameter(mode = ParameterMode.REF_CURSOR, type =
6 )
5 of 18 6/14/2019, 10:34 AM
7 Tips to boost your Hibernate performance https://thoughts-on-java.org/tips-to-boost-your-hibernate-performance/
▼ ▼ ▼ ▼
1 CriteriaBuilder cb = this.em.getCriteriaBuilder();
6 of 18 6/14/2019, 10:34 AM
7 Tips to boost your Hibernate performance https://thoughts-on-java.org/tips-to-boost-your-hibernate-performance/
▼ ▼ ▼ ▼
8
9 // set update and where clause
10 update.set("amount", newAmount);
11 update.where(cb.greaterThanOrEqualTo(e.get("amount"), oldAmount));
12
13 // perform update
14 this.em.createQuery(update).executeUpdate();
7 of 18 6/14/2019, 10:34 AM
7 Tips to boost your Hibernate performance https://thoughts-on-java.org/tips-to-boost-your-hibernate-performance/
▼ ▼ ▼ ▼
8 of 18 6/14/2019, 10:34 AM
7 Tips to boost your Hibernate performance https://thoughts-on-java.org/tips-to-boost-your-hibernate-performance/
▼ ▼ ▼ ▼
9 of 18 6/14/2019, 10:34 AM
7 Tips to boost your Hibernate performance https://thoughts-on-java.org/tips-to-boost-your-hibernate-performance/
▼ ▼ ▼ ▼
10 of 18 6/14/2019, 10:34 AM
7 Tips to boost your Hibernate performance https://thoughts-on-java.org/tips-to-boost-your-hibernate-performance/
▼ ▼ ▼ ▼
11 of 18 6/14/2019, 10:34 AM
7 Tips to boost your Hibernate performance https://thoughts-on-java.org/tips-to-boost-your-hibernate-performance/
▼ ▼ ▼ ▼
12 of 18 6/14/2019, 10:34 AM
7 Tips to boost your Hibernate performance https://thoughts-on-java.org/tips-to-boost-your-hibernate-performance/
▼ ▼ ▼ ▼
13 of 18 6/14/2019, 10:34 AM
7 Tips to boost your Hibernate performance https://thoughts-on-java.org/tips-to-boost-your-hibernate-performance/
▼ ▼ ▼ ▼
14 of 18 6/14/2019, 10:34 AM
7 Tips to boost your Hibernate performance https://thoughts-on-java.org/tips-to-boost-your-hibernate-performance/
▼ ▼ ▼ ▼
15 of 18 6/14/2019, 10:34 AM
7 Tips to boost your Hibernate performance https://thoughts-on-java.org/tips-to-boost-your-hibernate-performance/
▼ ▼ ▼ ▼
16 of 18 6/14/2019, 10:34 AM
7 Tips to boost your Hibernate performance https://thoughts-on-java.org/tips-to-boost-your-hibernate-performance/
▼ ▼ ▼ ▼
17 of 18 6/14/2019, 10:34 AM
7 Tips to boost your Hibernate performance https://thoughts-on-java.org/tips-to-boost-your-hibernate-performance/
▼ ▼ ▼ ▼
18 of 18 6/14/2019, 10:34 AM