14 High-Performance Java Persistence Tips

Introduction In this article, I’m going to show you various high-performance Java Persistence optimization tips that will help you get the most out of your data access layer. A high-performance data access layer requires a lot of knowledge about database internals, JDBC, JPA, Hibernate, and this post summarizes some of the most important techniques you can use to optimize your enterprise application. 1. SQL statement logging If you’re using a framework that generates statements on your behalf, you should always validate the effectiveness and efficiency of each executed statement. A testing-time assertion… Read More

How to map JSON objects using generic Hibernate Types

Introduction In this article, we are going to see how you can map a JSON column to a JPA entity attribute using the Hypersistence Utils open-source project. While you can create your own custom Hibernate Types, for mapping JSON column types on Oracle, SQL Server, PostgreSQL, or MySQL, you don’t need to implement your own Hibernate Type since the Hypersistence Utils project already offers this functionality.

High-Performance Java Persistence – Part Two

Another milestone has been reached The second part of High-Performance Java Persistence book is out. It’s been almost a year since I started writing this book, and seven months since I published the first part.

How to implement a custom String-based sequence identifier generator with Hibernate

Introduction One of my blog readers bumped into the assigned generator with a sequence or an identity column post and wondered if it was possible to generate String-based identifiers instead. I accepted the challenge and answered his question on StackOverflow. However, this post is going to explain this topic in greater detail, so there we go.

How to implement equals and hashCode using the JPA entity identifier (Primary Key)

Introduction As previously explained, using the JPA entity business key for equals and hashCode is always the best choice. However, not all entities feature a unique business key, so we need to use another database column that is also unique as the primary key. But using the entity identifier for equality is very challenging, and this post is going to show you how you can use it without issues.