~/devreads

#identifier

3 posts

2 Dec 2025

vladmihalcea 1 min read

Introduction In this article, I’m going to show you the best way to replace the deprecated @GenericGenerator when upgrading your application to Hibernate 7. Hibernate @GenericGenerator annotation The @GenericGenerator annotation has been available since Hibernate 3.5, as an alternative to the <generator> XML element from HBM mappings. As illustrated by the Hibernate 6.5 @GenericGenerator Javadoc, this annotation was deprecated in…

hibernatedatabase identifierdeprecatedgenericgeneratoridentifier

22 Aug 2023

vladmihalcea 1 min read

Introduction In this article, I’m going to show you the best way to hide the JPA entity identifier so that the users of your application won’t be able to guess and access data that belongs to other users. This has been a recurring question that I’ve been getting when running training or workshops, so I decided it’s a good idea…

hibernatehideidentifierjpamasquerade

16 Feb 2023

vladmihalcea 1 min read

Introduction In this article, I will show you the best way to generate a TSID entity identifier with JPA and Hibernate. Prior to continuing, if you are not familiar with the advantages of using compact Time-Sorted Identifiers, like TSID, check out this article first. Hypersistence Utils As promised, the Hypersistence Utils OSS library keeps on evolving, adding more and more…

hibernatehypersistence utilsidentifierjpatsid