Differences between JPA and JPA2

40,826

Solution 1

Google returns many results, including this and this blog posts. The summary (copied from the former) is:

  • Added support for persistently ordered lists using OrderColumn and provider-managed ordering column
  • Defined support for foreign key mapping strategy for unidirectional one-to-many relationships
  • Added clear method to EntityManager interface to allow entities to be evicted from the persistence context; added CLEAR cascade option.
  • Added Cache interface.
  • Added support for pessimistic locking and new lock mode types.
  • Added overloaded find and refresh methods added to support locking with standardized and vendor-specific properties and hints.
  • Added standardized hint javax.persistence.lock.timeout for use in locking configuration.
  • Added the standardized properties javax.persistence.jdbc.driver, javax.persistence.jdbc.url, javax.persistence.jdbc.user, javax.persistence.jdbc.password for use in persistence unit and entity manager factory configuration.
  • Added Query getNamedParameters and getPositionalParameters methods.

Solution 2

JPA2 also adds typesafe query api. see http://www.ibm.com/developerworks/java/library/j-typesafejpa/

Solution 3

There is also a pdf version of Mike Keith's presentation "What's New and Exciting in JPA 2.0" from Jazoon 2009.

Share:
40,826
Vitaliy Alekask
Author by

Vitaliy Alekask

-

Updated on July 30, 2020

Comments

  • Vitaliy Alekask
    Vitaliy Alekask almost 4 years

    Does anyone have a list of the changes between JPA 1 and JPA 2? I have read about the Criteria queries and other changes, but I would like a "what's new" kind of reference. Thanks

  • Shivan Dragon
    Shivan Dragon almost 13 years
    Sorting is nicer too, as the @Ordered annotation actually makes the sort on the database side.
  • Marc Bouvier
    Marc Bouvier almost 11 years
    The link you provides is now down : 404
  • banterCZ
    banterCZ over 10 years