[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [eclipselink-dev] javax.persistence in eclipselink.jar

The JPA 2.0 classes added to eclipselink.jar are done so intentionally to allow this library to be used with the JPA 1.0 API as a 1.0 provider. Within the implementation classes there are some hard dependencies on these new JPA 2.0 classes. The ones we include are those classes not in JPA 1.0 that are required by our implementation.
A good example of the issue is with EntityManager in JPA 2.0 having a dependency on CriteriaBuilder and TypedQuery. Our EclipseLink 2.0 implementation of this interface, EntityManagerImpl, must implement methods like:

public <T> TypedQuery<T> createQuery(CriteriaQuery<T> criteriaQuery);

This means that the class-loader loading EntityManagerImpl must be able to resolve its dependencies on TypedQuery and CriteriaBuilder. When running with the JPA 1.0 API library these classes do not exist. We have added them to eclipselink.jar to address this issue.
The intent is that in a JPA 2.0 container the full API is available and hopefully loaded ahead of the eclipselink.jar and thus these duplicate classes will never be touched.
If you are only running with JPA 2.0 you can either use the bundles produced from the project or you can build a custom version of the eclipselink.jar that does not have these classes.
-----Original Message-----
From: Goerler, Adrian [mailto:adrian.goerler@xxxxxxx]
Sent: March 9, 2010 1:04 PM
To: Eric Gwin
Cc: Dev mailing list for Eclipse Persistence Services
Subject: [eclipselink-dev] javax.persistence in eclipselink.jar

Hi Eric,
I am puzzled by the fact that in trunk eclipselink.jar contains *some selected* classes from javax.persistence. Actually, I don’t see why eclipselink.jar should contain classes from javax.persistence at all. But if it contains these classes, it should contain the entire API, I think. Moreover the selection is not complete as it for example does not contain javax.persistence.Query, which has been changed in 2.0.
In the trunk/build.xml, I find the comment
# 360:            <!-- JPA 1.1/2.0 concurrent dev solution: New classes from javax.persistence 2.0 -->
So, likely, this is just some leftover from 1.2.
(I am currently testing on JBoss where I am seeing a mixed 1.0/2.0 API which causes some confusion) ;-)
Adrian Görler

Pflichtangaben/Mandatory Disclosure Statements: http://www.sap.com/company/legal/impressum.epx