How to override the primary key generation strategy

Hibernate Tips: How to override the primary key generation strategy

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 leave a comment below. Question: You explained that the GenerationType.SEQUENCE is the most efficient primary key generation strategy and that MySQL doesn’t support it….

Entities or DTOs – When should you use which projection?
| |

Entities or DTOs – When should you use which projection?

JPA and Hibernate allow you to use DTOs and entities as projections in your JPQL and Criteria queries. When I talk about Hibernate performance in my online training or at a workshop, I get often asked, if it matters which projection you use. The answer is: YES! Choosing the right projection for your use case…

Database Migration with Liquibase

Version-Based Database Migration with Liquibase – Getting Started

Creating the database for your application seems to be easy as long as you don’t need to support multiple versions or work in multiple teams. You just generate an SQL script from your database model or in the worst case, export the required statements from your test database. You can then execute it manually or…

5 Things You Need to Know When Using Hibernate with Mysql
|

5 Things You Need to Know When Using Hibernate with Mysql

One of the benefits of using JPA and Hibernate is that it provides an abstraction of database-specific dialects and features. So, in theory, you can implement an application, connect it to one of the supported databases and it will run without any code changes. Hibernate does that really well. But let’s be honest, you didn’t…