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!