What is JPA 2.1?

What is JPA 2.1 and what the new features introduced in this version of JPA?

What is JPA 2.1? What are the new features of JPA 2.1?

This tutorial will introduce you with the JPA 2.1 specification. You will also learn the new features of the JPA 2.1.

Java Persistence API Version 2.1 or JPA 2.1 is defined through the JSR-338 and makes it easy to maintain and develop persistence layer. JPA 2.1 provides Object Relational Mapping (ORM) facility that uses the data from relational database. Developers use JPA 2.1 to make demanding applications by enterprises.

For JEE 7 use JPA 2.1 as it is an update and has many new features than previous JPA. JPA 2.1 libraries are available on the remote repository and the Maven build tool.

JPA is Java based solutions for mapping the persistence with the relational databases. JPA consists of Java Persistence API, query language and ORM tool. JPA uses ORM, which is very useful in bridging the gap between object model and the relational databases. JPA API queries the data from database.

JPA 2.1 can be used in Java SE applications and outside JEE 7 container.

JPA 2.1

Features of JPA 2.1:

  • With JPA 2.1 users can convert custom code between database and object types.
  • With JPA 2.1 user can use the Criteria API for bulk updates and deletes.
  • The new update allows the use of stored procedure.
  • JPA 2.1 allows the schema generation.
  • With  JPA 2.1 user cab use specified fetching or merging of objects.
  • The new update supports arithmetic sub-queries, generic database functions, join ON clause, TREAT option.
  • CDI support ahs been added.
  • JPQL has been updated.
  • JPA 2.1 supports TREAT

Read Complete Hibernate 4.3.x tutorial at Hibernate 4.3.x home page.