Hibernate Tip : How to override the primary key generation strategy

preview_player
Показать описание

After I published my post about things you need to know when you use Hibernate with a MySQL database, I got the following question:
You explained that the GenerationType.SEQUENCE is the most efficient primary key generation strategy and that MySQL doesn’t support it. What shall I do if I need to support PostgreSQL and MySQL with the same application? Do I need to use the slower GenerationType.IDENTITY with PostgreSQL as well?

If you like this video, please give me your thumbs up and share it with your friends and co-workers.

Like my channel? Subscribe!

Join the free Member Library:

Want to connect with me?
Рекомендации по теме
Комментарии
Автор

Hi, you have good content. Keep up the good work. I have tried implementing as per this tutorial and I am facing issue. Can you share the source code as well?

nikitachhabhaiya
Автор

Hi,
Could you please share the source code of the same? We followed this but it's not overriding the annotations with orm.xml strategy

TheITEngineer