Question

Well, I must be brain-damaged, because I can't find the java source for Sun's persistence.jar or JBoss's ejb3-persistence.jar JPA package. They are open-source aren't they?

I looked all over the java.sun.com site as well as the GlassFish wiki, but came up empty.

I'd like a src.zip or folder like Sun delivers with Java JDKs.

Of course, I really don't have to have it, but I think it's fun to browse the source once in a while. And it helps me to debug my code sometimes.

Was it helpful?

OTHER TIPS

I just did a search on http://www.mvnrepository.com for persistence api

http://mirrors.ibiblio.org/pub/mirrors/maven2/javax/persistence/persistence-api/1.0/persistence-api-1.0-sources.jar

also available in the java.net maven 1 repository http://download.java.net/maven/1/javax.persistence/java-sources/

for the implementations see hibernate entity manager, openjpa, eclipse toplink, glassfish persistence, ...

The ejb3-persistence.jar contains the JPA API (javax.persistance.*) implementation which specified as part of the EJB 3.0 JSR 220 specification (the upcoming specification for JPA is JSR 317 which is now separate from EJB 3.1 spec)

The reference implementation is the one included with the Glassfish, I believe the one used in JBoss is the Hibernate implementation so you should be able to find the source code there. You are free to use the one whose license satisfies your need (if you need to redistribute) although I believe they are all redistributable. For an Apache style license I recommend the one used by the Apache OpenEJB.org project (provided by the Apache Geronimo project).

You can browse the source here: http://svn.apache.org/repos/asf/geronimo/specs/trunk/geronimo-jpa_3.0_spec/src/main/java/javax/persistence/

Jboss sources can be downloaded from http://www.jboss.org/jbossas/downloads/
For example, ejb3-persistence-sources.jar can be found in
http://sourceforge.net/projects/jboss/files/JBoss/JBoss-5.1.0.GA/jboss-5.1.0.GA-src.tar.gz/download

If all you're looking for is something to attach in eclipse, an SVN checkout should be all that you need, though I realise that this isn't exactly the answer you're looking for. The source for the JPA API for jboss can be found in http://anonsvn.jboss.org/repos/hibernate/jpa-api/ - check out the tag for the version of hibernate included with your version of jboss and you can attach the resulting folder as you would a zip file with the source.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top