Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

javax.persistence.* sources, where? [closed]

I might be missing something really obvious here, but I couldn't find the sources for a few classes from the javax.persistence package.

I'm using EclipseLink as a JPA provider. When I tried Ctrl+left clicking a method of the EntityManager interface, Eclipse said that I should attach the sources since it can't find them. I tried attaching the EclipseLink ones but it complained it cannot find the source for EntityManager there.

What sources do I need to attach in order to view the code in Eclipse? Could somebody provide a link?

like image 210
pnt Avatar asked Jan 26 '11 11:01

pnt


2 Answers

I think if you create a JPA project type in Eclipse you will be able to see the JPA source, or perhaps load the JPA module.

Only the source code to EclipseLink is in the eclipselink-src.jar, you can access the source to JPA from the EclipseLink repository,

http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/jpa/plugins/

The source is not that interesting for JPA, as it is a spec, and all interfaces, there is little to no real code.

like image 54
James Avatar answered Oct 04 '22 12:10

James


The actual implementations of the interfaces can be seen by cloning the git repo:

git clone https://github.com/eclipse/javax.persistence.git
cd javax.persistence

== Then find a specific function

grep -ir 'close()' *
src/javax/persistence/EntityManager.java:    public void close();
src/javax/persistence/EntityManagerFactory.java:    public void close();
src/javax/persistence/spi/PersistenceProviderResolverHolder.java: in.close();
like image 25
Andrei Sura Avatar answered Oct 04 '22 12:10

Andrei Sura