A short, clear list of what's new in JPA2?

Does anyone know a good list of what's new in JPA 2? Not that new to Hibernate / TopLink in the version supporting JPA 2, but in the new specification.

+27
java java-ee orm jpa
Mar 12 '10 at 19:28
source share
3 answers

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.)
+38
Mar 13 '10 at 23:35
source share
+3
Jun 30 '10 at 10:32
source share



All Articles