How to use Ehcache as Hibernate’s 2nd Level Cache

How to use Ehcache as Hibernate’s 2nd Level Cache

Using JPA’s and Hibernate’s 2nd level cache can improve the performance of your persistence layer. It acts as a session-independent entity store. Hibernate uses it whenever you call the find method on your EntityManager or traverse an association to fetch a cached entity. Instead of executing a database query, Hibernate gets the entity object from…

Java Text Blocks – Using Multiline Strings with Hibernate & JPA
|

Java Text Blocks – Using Multiline Strings with Hibernate & JPA

JPA and Hibernate require you to write lots of Strings. You use them to create ad-hoc and named queries with JPQL, to define native SQL queries and to specify the fetching behavior in an EntityGraph. Until Java 13, the lack of multiline Strings in Java made all of these tasks either annoying to implement or…