|RE: [eclipselink-dev] javax.persistence in eclipselink.jar|
I’ve got a test that uses the Query.getMaxResults method, which is a 2.0 method. The test firstly checks if it is running in a 2.0 or 1.0 environment by inspecting LockModeType.values(). If it sees 2 values, it assumes 1.0, 2.0 otherwise.
In JBoss, the check sees 8 values for LockModeType as LockModeType is included in eclipselink.jar. My test assumes 2.0 and the invocation of Query.getMaxResults fails as Query is not included in eclipselink.jar.
In NetWeaver, it behaves differently, here the jpa 1.0 jar has precedence over eclipselink.jar. Hence the LockModeType from 1.0 is visible having two values. My test assumes 1.0 and skips the invocation of Query.getMaxResults.
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) ;-)
eclipselink-dev mailing list
Back to the top