openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pinaki Poddar" <>
Subject RE: Is OpenJPA jdk1.4 compatible?
Date Mon, 13 Aug 2007 03:29:24 GMT

JPA API depends intrinsically on generics -- a JDK 1.5 feature.
Consider, for example, a method on EntityManager to find an instance by its identifier.

public <T> T find(Class<T> cls, Object id); 

A significant portion of OpenJPA codebase, however, is compatiable (and compiled with) JDK
1.4. The rest of the code where the fa├žade pattern that sits atop OpenJPA kernel to emulate
JPA API depends on JDK 1.5 as the JPA API itself uses generics. So annotations or no annotations,
a JPA application essentially requires JDK1.5.

Pinaki Poddar

-----Original Message-----
From: Das, Aditi [] 
Sent: Sunday, August 12, 2007 7:28 PM
Subject: RE: Is OpenJPA jdk1.4 compatible?

Thanks Craig, that was helpful.
I was probably too ambitiously thinking I can make JPA minus annotations run on Java 1.4 enviorment

-----Original Message-----
From: Craig.Russell@Sun.COM [mailto:Craig.Russell@Sun.COM]
Sent: Sunday, August 12, 2007 12:37 PM
Subject: Re: Is OpenJPA jdk1.4 compatible?

Hi Aditi,

In order to use the JSR 220 Persistence API you need to run in Java 5.
OpenJPA itself currently supports jdk 1.4 but to use it in 1.4 mode you have to use only the
1.4 components, that is, proprietary OpenJPA components.

Hope that helps,


On Aug 12, 2007, at 12:13 PM, Das, Aditi wrote:

> Hi,
> Is OpenJPA jdk1.4 compatible? I was trying out writing JPA without 
> using annotations on Entities but writing a orm.xml instead..
> When I try running my application with OpenJPA in jdk1.4 enviorment I 
> get the following error:
> java.lang.UnsupportedClassVersionError: javax/persistence/Persistence 
> (Unsupported major.minor version 49.0)
> That means,  I am trying to run Java 5 compliant byte code in a Java
> 1.4 VM. But there are quite a few places in the code I have seen "if 
> (JavaVersions.VERSION >= 5) {"
> check present. That means it certainly has options to run in Java 1.4 
> enviorment.
> Even maven builds few projects of openJPA in jdk1.4 enviorment.
> I guess, I am missing out something. Do I have to call OpenJPA api 
> directly without going through JPA specification in jdk1.4 enviorment?
> Any poineters to this will be highly appreciated.
> Regards,
> Aditi
> I am not the best, but certainly not like the rest.

Craig Russell
Architect, Sun Java Enterprise System
408 276-5638 P.S. A good JDO? O, Gasp!

Notice:  This email message, together with any attachments, may contain information  of  BEA
Systems,  Inc.,  its subsidiaries  and  affiliated entities,  that may be confidential,  proprietary,
 copyrighted  and/or legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient, and have received
this message in error, please immediately return this by email and then delete it.

View raw message