This is my first time really playing around with Java development using Eclipse. I am trying to use EclipseLink's implementation of the JPA. I moved all of my entities into a separate package "entities". I have the persistence.xml
in a separate JPA project called "dataModeling".
Everything builds and runs fine.
Just about every project depends on my entities. However, I'm seeing a warning Class javax.persistence.Entity not found - continuing with a stub.
, etc. showing up because the dependent projects don't reference EclipseLink.
The solution is to go into each dependent project's properties and under Java Build Path > Libraries, click Add Library, then User Library and then select EclipseLink.
However, to me, it doesn't make sense to reference EclipseLink in every project! That's an implementation detail I don't want to burden other projects with. It looks like this is happening because the other projects see the annotations and don't recognize them.
So the real question is: how can I use JPA (via annotations) without every other project needing to reference my JPA implementation?