AccessPlatform : Getting Started

DataNucleus AccessPlatform implements the JDO and JPA specifications. These specifications define how Java classes can be persisted to a datastore and how they can be queried. By choosing AccessPlatform you can select which of these APIs you feel most comfortable with. Time for you to get started and use AccessPlatform!

What is required?

  1. Decide which datastore your project will use, and then download DataNucleus AccessPlatform
  2. Depending on which ZIP you downloaded above, and what add-ons you'll be using you may also need to download some dependencies

You now have the necessary components to start investigating use of DataNucleus.

Starting up

Decide which persistence API you want to use. If you're not familiar with these APIs then the next thing to do is to learn about JDO and JPA, or alternatively REST. You need to understand the basic concepts involved. There is plenty of reading on the internet, starting with the JDO or JPA specifications of course.

The best thing to do after some reading is to try the JDO Tutorial (for RDBMS, HBase, MongoDB, Neo4j, Cassandra, ODF, Excel) or try the JPA Tutorial (for RDBMS, HBase, MongoDB, Neo4j, Cassandra, ODF, Excel). These explain the basic steps of applying JDO/JPA (and DataNucleus) to your own application and provides a link to download the source code for the Tutorial. Please download it and start up your development environment with the Tutorial classes and files. Once you have completed the Tutorial you're in a position to apply DataNucleus JDO/JPA to your own application, and start benefiting from what it offers.

Key Points

There are some key points to bear in mind when starting using JDO/JPA for java persistence.

  • To persist objects of classes you firstly need to define which classes are persistable, and how they are persisted. Start under the JDO Class Mapping and JPA Class Mapping sections
  • Use of JDO or JPA requires a datastore-controlling factory : PersistenceManagerFactory for JDO, EntityManagerFactory for JPA. You can define many properties to define the capabilities of this
  • The persistence of objects is controlled by an API. Look under JDO API and JPA API for more details
  • During the persistence process objects are in different lifecycle states (JDO, JPA) and you ought to be aware of what they are
  • You retrieve objects either by their identity, or using a query. With JDO you can use JDOQL, SQL or JPQL query languages. With JPA you can use JPQL or SQL query languages
  • For JDO usage you will need jdo-api/javax.jdo as well as datanucleus-api-jdo, datanucleus-core and the datanucleus-XXX jar for whichever datastore you are using.
  • For JPA usage you will need persistence-api/javax.persistence as well as datanucleus-api-jpa, datanucleus-core and the datanucleus-XXX jar for whichever datastore you are using.