Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

EclipseLink/Development/JPA

< EclipseLink‎ | Development
Revision as of 15:41, 1 April 2009 by Gordon.yorke.oracle.com (Talk | contribs) (Features completed:)

The EclipseLink project has been chosen to deliver the JPA 2.0 reference implementation as part of JSR 317. This page provides a summary of the work planned and the current status.

JPA 2.0 Implementation Status

At present EclipseLink implements JPA 1.0 with advanced functionality made available through Persistence Unit Properties, Query Hints, a native ORM XML Schema, and native API. Some of the advanced 'extensions' align with what is being discussed for JPA 2.0.

Bug Report Graph

Goals/Requirements

EclipseLink will introduce JPA 2.0 features with the following goals in mind:

  1. Remain a compliant JPA 1.0 implementation during the development of 2.0 functionality. This is a major requirement since we are working towards a 1.0 release of EclipseLink which must be JPA 1.0 compliant.
    • This generally means that the JPA 1.0 persistence.jar could be on the classpath and the product should function as expected
  2. Conform with the Eclipse IP process and rules. This means that the use of any updated persistence libraries and their source must come into the project through proper IP review procedures.
  3. All new features involving changes to JPA's ORM-XML schema must be reflected in Eclipse-ORM.XML. This should be done in such a way that changes during the evolution of the specification are minimized.
  4. Where possible any new features added for JPA 2.0 should also be available to users of the native EclipseLink ORM API and metadata. Accessibility through the native API can be limited to programmatic access and configuration.
    • EclipseLink users using JPA 1.0 will be able to access 2.0 preview functionality through native EclipseLink API or metadata


Types of Changes

The JPA 2.0 expert group is attempting to evolve this new specification to remain backwards compatible with JPA 1.0. The scope of its work will involve changes of various types with different effects on EclipseLink.

  1. Metadata Changes
    1. New Annotations
    2. New structures in the persistence.xml XSD
    3. New structures in the ORM.XML XSD
  2. API Changes
    1. New interfaces
    2. New methods on existing interfaces

Development Approach

We will be developing this functionality within the main product stream. Specification defined interfaces will be created and packaged within a javax.persistence_2.0 bundle/jar for users who wish to preview the functionality. To remain backward compatible with JPA 1.0 we will be packaging any interfaces we must link with for JPA 2.0 within the eclipselink JPA bundle/jar. As this bundle/jar will not contain the EMF API users will be required to choose their JPA version by using the appropriate persistence bundle/jar. Not bundling all the interfaces allows us to produce a single EclipseLink JPA bundle/jar while alleviating the concern of user's hitting preview code when they do not expect to.

Class file to be included in EclipseLink JPA bundle

  • javax.persistence.Cache
  • javax.persistence.Access
  • javax.persistence.AccessType
  • javax.persistence.LockModeType
  • javax.persistence.LockTimeoutException
  • javax.persistence.PessimisticLockException

Metadata Changes

The following changes need to be handled keeping the backwards compatibility to JPA 1.0 goals in mind:

  • New Annotations
  • Modified Annotations
  • Changes to the XML Schemas
  • new Interfaces
  • reference to new interfaces



Features completed:

Uni-directional OneToMany without join table

Provide EclipseLink functionality to support a uni-directional OneToMany mapping that does not use a join table. This mapping will be similar to EclipseLink's current AggregateObjectMapping.

Access Type

Provide support for configurable access type

Pessimistic Locking Support

Adding support for EntityManager APIs and functionality for Pessimistic locking

Nested embedding

ER 207823: Embedded objects can nest other embedded objects as well as being able to have relationships to entities.

Cache APIs

Add support for the new Cache APIs.

New collection mappings

Collections of embedded objects (aka Aggregate Collections) or of simple objects (Direct Collections)

Table Per Class Inheritance

Add support for TABLE_PER_CLASS inheritance strategy.

Derived Identifiers

Relationship mappings can be used as Id's or components of compound Id's directly without the need for separate primitive attributes.


Extended Map support

Maps can have keys and values that can be any of basic, entity, or embedded. These are stored in a target table or join table.

JPA 2.0 Features

The following are features known to be required for JPA 2.0

EDR of JPA 2.0

Note that plumbing for some of these features already does exist in EclipseLink while other parts are going to require feature additions.

Assigned Features:

Ordered lists

Order of list is persisted to an "order column" when writes occur

Standard Properties

Add support for new javax.persistence properties.

Entity Type Expressions

JPA 2.0 has added syntax to allow restriction of query results by Entity Class type

Orphan removal

When this option is set on a relationship if a child object is removed from the relationship it must be deleted.

MetaModel API

266912: Runtime metamodel api implementation (without the APT based canonical metamodel work in 267391).

Query Definition API

This will be an object oriented query construction api.

Integration with Validation API

Through this feature EclipseLink JPA will integrate with the Validation APIs. (JSR-303)

CASE Expressions

Case style expressions have been introduce to JPQL and Criteria API

MappedById support

Derived Ids that are also defined in an embeddableid mapping

Unassigned Features to be completed:

Properties Processing

The new version of the specification provides a means to dynamically specify properties on the EntityManager. The goal of this feature will be to define our properties processing and validation.

Undelimited Identifiers

This feature covers specifying and processing metadata Identitfiers.

JPQL updates

JPA 2.0 introduces certain JPQL updates that do not correspond to other features.

Nested Fetch Joins

JPA 2.0 Fetch joins have been allowed in JPA 2.0

Collection Parameters for IN

IN() in JPQL can now accept a single collection parameter.

APT implementation for canonical MetaModel API generation

267391: APT based canonical metamodel generation.

Application Server support

Ensure that EclipseLink libraries with JPA 2.0 functionality will be able to run on JPA 1.0 compliant application servers.

JoinTable support for OneToOneMapping

Ensure that EclipseLink libraries with JPA 2.0 functionality will be able to run on JPA 1.0 compliant application servers.

JPA 1.0 Optional Features

Table Per Class Inheritance

Add support for TABLE_PER_CLASS inheritance strategy.

Back to the top