Java Persistence/What is new in JPA 2.1?

The JPA 2.1 specification adds several enhancements to the JPA 2.0 specification including:

  • Converters - allowing custom code conversions between database and object types.
  • Criteria Update/Delete - allows bulk updates and deletes through the Criteria API.
  • Stored Procedures - allows queries to be defined for database stored procedures.
  • ConstructorResult support for SQLResultSetMapping
  • Runtime creation of named queries
  • Injectable EntityListeners
  • Unsynchronized persistence contexts
  • DDL generation - automatic table, index and schema generation.
  • Entity Graphs - allow partial or specified fetching or merging of objects.
  • JPQL/Criteria enhancements - arithmetic sub-queries, generic database functions, join ON clause, TREAT option.