Is it possible to import JPA’s interfaces without linking the provider’s libs?
I’m trying to build my system’s persistence interfaces and adapters to allow a modular persistence layer, but in order to do so I must link Hibernate’s (or some other JPA provider) jars.
To my understanding, the JPA interfaces are not provided with the JDK.
Is it possible to import JPA’s interfaces without linking the provider’s libs? I’m trying
Share
You include persistence-api.jar to compile against. Sadly the people behind JPA decided not to bother publishing v2.0 of that jar into a Maven repository so you have to rely on the various versions of jars providing this. For example EclipseLink has a persistence-api.jar, as does Hibernate, and there is also an Apache licensed “Geronimo Specs JPA 2.0 jar” providing the same “javax.persistence” classes.