JPA 2.0JPA 2.0 is an important piece of the Java EE 6 solution. JPA 2.0 builds upon the solid foundation provided by JPA 1.0 in the Java EE 5 timeframe. In addition to providing additional support for legacy situations, it also provides several new features to cement itself as the premier persistence framework.
JPA 2.0 is so important to our customer base that we decided to create a separate Feature Pack that works with WebSphere v7. As part of our normal process, the capabilities introduced by a Feature Pack are then incorporated into our next release. Thus, most of the JPA 2.0 functionality provided by the JPA Feature Pack is already part of the WebSphere Application Server v8.0 Beta.
Key JPA 2.0 FeaturesSome of the key JPA 2.0 features available in the WebSphere Application Server v8.0 Alpha include:
Access TypesExpanded to allow specification on a per-persistent type basis or on individual attributes.
EmbeddablesExpanded to include collections of embeddables, nested embeddables, and embeddables containing relationships to other entities.
Enhanced Map CollectionsExpanded to support ElementCollection and new annotations for MapKeyColumn, MapKeyClass and MapKeyJoinColumn.
Derived IdentitiesEnables the ID of an entity to be derived from another entity, which provides for parent-to-dependent relationships.
Query APIMethods to get typed query parameters and results, supported and in-effect hints and lock mode getter/setter.
LockingOfficial support for Pessimistic locking (included in prior OpenJPA releases) along with LockModeType properties and hint.
- Embeddables support for path expressions to nested Embeddables and Embeddables with relationships
- Enhanced Map Collection support for ElementCollection and new query expressions for KEY, ENTRY, VALUE
- Support for CASE and TYPE expressions along with IN expressions for Collection parameters
- Support for native date/time/timestamp literals
- Support for INDEX expressions on an OrderColumn
- Provides cache operations such as entity eviction and cache mode behaviors to use, bypass or refresh items
- Per-entity annotation to specify whether an entity should be cached
Bean ValidationSupports using a JSR 303 implementation for entity validation for persist and remove operations.
- Provides API to dynamically retrieve metamodel information for a persistence unit
- Currently limited to persistent state and relationships
- Used with Criteria API to generate and execute type safe queries
- Supports dynamic or static generation of the metamodel
- Provides programmatic construction of queries using an object based query graph
- Operates on Metamodel objects to provide compile-time type safety enforcement
EntityManagerFactory APIUpdated for new L2 Cache, Properties, Criteria and Metamodel APIs
EntityManager APIUpdated for new Query and Query Result APIs, Hints, Properties, LockModeType, and Detach
And many more...