Creating New Jakarta Persistence/JPA Applications
Java Enterprise Edition (Java EE) has gone through a major transformation and is now Jakarta EE. One of the most significant changes impacting developers is the namespace change from
jakarta. If you’re new to JPA or creating new JPA applications, you might be wondering how to create your persistence applications. Your two options are:
- Create your new applications using the new
jakartanamespace (Jakarta Persistence 3.0).
- Create your new applications using the existing
javaxnamespace (JPA 2.2 and earlier).
If you’re writing a new application, you might think that option 1 is the obvious choice especially to avoid having to migrate your application later. However, there are a few reasons developers might not be ready or want to do so. One reason to go with option 2 is that your favorite provider may not compatible with Jakarta Persistence 3.0 yet. For example, Hibernate is currently not a Jakarta Persistence 3.0 compatible implementation. Another reason is that there are no actual new features introduced in Jakarta Persistence 3.0. The main difference between JPA 2.2 and Jakarta Persistence 3.0 is the namespace change so there is no compelling reason to upgrade.
Whether you decide to go with option 1 or option 2, IntelliJ IDEA Ultimate will provide you an easy way to create your applications.
Option 1: Create your new applications using the new
If you want to create your new applications using the new
jakarta namespace, checkout Creating a Simple Jakarta Persistence Application video or blog post. In the tutorial, I create a new Jakarta Persistence 3.0 application and use EclipseLink as my provider.
Option 2: Create your new applications using the existing
If you want to create your new applications using the
javax namespace, checkout Creating a Simple JPA Application blog post. In the blog, I create a new JPA 2.2 application and use Hibernate as my provider.
Subscribe to Blog updates
Thanks, we've got you!
Java Annotated Monthly – December 2023
The December edition of Java Annotated Monthly is here! As usual, you’ll find all the latest Java and Kotlin updates as well as details of key industry events for networking and learning. This issue also features the latest release candidates and targeted JEPs alongside Java tutorials and articles a…
String Templates in Java – why should you care?
TLDR; The existing String concatenation options are difficult to work with and could be error prone. String Templates (a preview feature introduced in Java 21) greatly improves how we create strings in Java by merging constant strings with variable values. The name of this feature pretty much says …
Java Annotated Monthly – November 2023
Welcome to the Java Annotated Monthly – November 2023! As the Java world keeps on spinning, we've gathered a treasure trove of articles, talks, and insights to warm your Java developers’ hearts. This month's edition features a delightful blend of the latest technological advancements and the ever…
Java Annotated Monthly – October 2023
Welcome to the October edition of Java Annotated Monthly! In this issue, we're plunging into the world of Java and tech. We'll explore the latest and greatest in the recent release of Java 21, share exciting news about the new EAP for IntelliJ IDEA 2023.3, and bring you a handpicked selection of …