Demo code for my "Mastering JPA Performance" talk at Oracle Code on 25-10-2018.
All code is written in JUnit 5 and runs by default using a H2 in-memory database.
It's organized following the CRUD scheme
- Create CreateTest.java
- Read ReadTest.java including Caching
- Update UpdateTest.java
- Delete DeleteTest.java
All Tests run successfully in the default configuration, except CreateTest.java which needs to be optimized. Changing the mapping of entities may affect other tests as well.
You can
- turn off SQL output, gathering statistics or switch databases in src/test/resources/persistence.xml
- change Hibernate dependencies in pom.xml