Question

Does anybody know of a good list of what is new in JPA 2? Not what is new with Hibernate/TopLink in the version that supports JPA 2 but what is new in the actual spec.

Was it helpful?

Solution

The link mentioned in the accepted answer doesn't say anything about the second level cache so I decided to post a quick list to summarize "What's new in JPA 2.0 (JSR-317)":

  • Standard properties for persistence.xml - E.g. javax.persistence.jdbc.driver, etc instead of persistence provider specific properties.
  • Mixed Access Type - PROPERTY and FIELD access type can be mixed in a hierarchy and combined in a single class.
  • Derived Identifiers - Identifiers can be derived from relationships.
  • @ElementCollection, @OrderColumn - For better collection support.
  • Unidirectional @OneToMany / @OneToOne - For expanded mappings.
  • Shared Cache API - Second level caching in JPA, yeah!
  • Locking - Support for pessimistic locking added.
  • Enhanced JP QL - Timestamp literals, non-polymorphic queries, collection parameter in IN expression, ordered list index, CASE statement.
  • Expression and Criteria API - QueryBuilder and CriteriaQuery for programmatic construction of type-safe queries.
  • API additions - Additional API on EntityManager (supported properties, detach method, etc) and Query (query hints).
  • Validation - Transparent support of Bean Validation (JSR-303) if provider is present. (Validation is optional, the JPA 2.0 spec does not require a Bean Validation implementation).

OTHER TIPS

Regarding this question, this link is maybe not 100% precise, but it's a very good source of information to start from.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top