It’s almost February 2020, and I still haven’t published my end of 2019 review or shared my plans for this year. But I have good excuses for that. So far, January has been extremely busy. I already did a code review, started a new coaching project, taught an in-house workshop, recorded multiple online course lectures

Read More

Since a lot of new applications are built as a system of microservices, dual writes have become a widespread issue. They are one of the most common reasons for data inconsistencies. To make it even worse, I had to learn that a lot of developers don’t even know what a dual write is. Dual writes

Read More

JPA and Hibernate provide a default mapping that maps each entity class to a database table with the same name. Each of its attributes gets mapped to a column with the same. But what if you want to change this default, e.g., because it doesn’t match your company’s naming conventions? You can, of course, specify

Read More

When you start learning and using Hibernate and JPA, the number of annotations might be overwhelming. But as long as you rely on the defaults, you can implement your persistence layer using only a small subset of them. After you have mastered the basic annotations, you can take a look at additional customization options. You

Read More

Should you expose your entities in your REST API, or should you prefer to serialize and deserialize DTO classes?That’s one of the most commonly asked questions when I’m talking to developers or when I’m coaching teams who are working on a new application. There are two main reasons for these questions and all the discussions

Read More

Hibernate Tips is a series of posts in which I describe a quick and easy solution for common Hibernate questions. If you have a question for a future Hibernate Tip, please post a comment below. Question: “I was told that native queries remove all entities from my 2nd level cache. But you’re still recommending them.

Read More

Hibernate Tips is a series of posts in which I describe a quick and easy solution for common Hibernate questions. If you have a question for a future Hibernate Tip, please post a comment below. Question: “One of my entities uses an @IdentityClass to map a composite primary key, and I need to map a

Read More

Hibernate Tips is a series of posts in which I describe a quick and easy solution for common Hibernate questions. If you have a question for a future Hibernate Tip, please post a comment below. Question: “I don’t like JPQL. It abstracts from the underlying table model, and it’s too limited for my use case.

Read More