views:

8043

answers:

4

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.

Thank you,
Randy Stegbauer

+1  A: 

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/

dljava
Thank you for the pointer to the code repository. I was hoping for a single ZIP file of the source like Sun releases with each of their JDKs so that I could attach it to the JAR within Eclipse and then step through with the debugger.
Randy Stegbauer
+6  A: 

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, ...

Somatik
+2  A: 

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.

Taufiq
I'm not the asker but that's just what I was looking for, thanks!
Cameigons
+3  A: 

I have found the version 1.0.2 GA it here: http://grepcode.com/snapshot/repository.jboss.com/maven2/org.hibernate/ejb3-persistence/1.0.2.GA

Davide D
Perfect! Thank you. I hope you get a medal for answering a long standing question.
Randy Stegbauer