 6 minutes
 
                            6 minutes 
                            From Spring Boot To Jakarta EE 11: How Payara Starter Eases The Transition
If you’ve been living in the Spring ecosystem, you’re used to fast project setup. Spring Initializr gives you a […]
 
 
                        In prior versions of Jakarta EE, the use of UUID as entity ID or database primary key type was a vendor specific feature. So even though you could use it, you had to rely on vendor specific constructs to get the mapping right. With the release of Jakarta EE 10 however, the Jakarta Persistence specification now provides native support for using UUID as entity ID type.
The jakarta.persistence.GenerationType now has a UUID option that indicates to the persistence provider to generate and assign RFC 4122 UUID to the annotated field. The HelloEntity below shows how to use this new feature.
@Entity
public class HelloEntity implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.UUID)
private UUID id;
private String greeting;
}
The strategy parameter of the @GeneratedValue annotation is passed the GenerationType.UUID type. With this, you now have a vendor neutral, portable way to entity IDs to the UUID type.
Read more of our Jakarta EE content:
Share:
 6 minutes
 
                            6 minutes 
                            If you’ve been living in the Spring ecosystem, you’re used to fast project setup. Spring Initializr gives you a […]
 3 minutes
 
                            3 minutes 
                            Exploring the Future of AI with the Jakarta EE Community At Payara, we’re passionate about pushing the boundaries of […]
 5 minutes
 
                            5 minutes 
                            Legacy Java applications built on enterprise standards don’t have to be roadblocks to modernization. When applications follow established specifications […]