The link mentioned in the accepted answer says nothing about the second level cache, so I decided to publish a quick list to summarize "What's New in JPA 2.0 (JSR-317)":
- Standard properties for
persistence.xml - for example. javax.persistence.jdbc.driver etc. instead of the specific properties of the provider. - Mixed Type Access Type -
PROPERTY and FIELD can be mixed in a hierarchy and combined into one class. - Derived identifiers . Identifiers can be obtained from relationships.
@ElementCollection , @OrderColumn - for better collection support.- Unidirectional
@OneToMany / @OneToOne - for advanced mappings. - Shared Cache API - Second-Level Caching in JPA, Yes !
- Lock - added support for pessimistic locking.
- Improved JP QL - Timestamp literals, non-polymorphic queries, collection parameter in IN expression, ordered list index, CASE statement.
- The expression and criteria API is
QueryBuilder and CriteriaQuery for programmatically constructing security type queries. - Additions API - additional API on
EntityManager (supported properties, detach method, etc.) and Query (query hints). - Validation Transparent Support Bean Validation (JSR-303) if a provider is present. (Validation is optional; JPA 2.0 specification does not require Bean Validation.)
Pascal Thivent Mar 13 '10 at 23:35 2010-03-13 23:35
source share