JPA defines an interface (or API) to persist normal Java objects (or POJO's in some peoples terminology) to an RDBMS datastore. The JPA API itself is provided by the javax.persistence JAR. DataNucleus provides an implementation of the JPA API in the datanucleus-api-jpa JAR.
Note that this version of DataNucleus requires the JPA 2.1 API
JPA uses a definition of how the users Java objects map to the chosen datastore structure. This mapping can be provided by way of XML metadata, or alternatively by having Java annotations in the code. The whole point of having a standard mapping and API is that users can, in principle, swap between implementations of JPA without changing their code. Make sure you have datanucleus-api-jpa.jar in your CLASSPATH for this API. The process of mapping a class can be split into the following areas
At runtime the JPA code can be split into several sections.
If in doubt about how things fit together, please make use of the JPA Tutorial
If you just want to get the JPA API javadocs, then you can access those here
|While DataNucleus allows you to use JPA against any of its supported datastores if you are intent on using JPA for persistence to a non-RDBMS datastore we highly recommend that you think deeply about that decision, and consider JDO instead since the design of JPA and in particular JPQL force assumptions to be made in how the persistence/query process operates.|