Skip to main content
Data Nucleus Access Platform

Note: This post is just my running notes and contains content consolidated from different sources while understanding datanucleus.

DataNucleus (formerly known as Java Persistent Objects JPOX) is an open source project (under the Apache 2 license) which provides a series of software products around data management in Java.

DataNucleus Access Platform is a fully compliant implementation of the Java Data Objects (JDO) 1.0, 2.0, 2.1, 2.2, 3.0 specifications and the Java Persistence API 1.0, 2.0 specifications, providing transparent persistence of Java objects. It supports persistence to the widest range of datastores of any Java persistence software, supporting all of the main object-relational mapping (ORM) patterns, allows querying using either JDOQL, JPQL or SQL, and comes with its own byte-code enhancer. It allows persistence to relational datastores (RDBMS), object-based datastores (db4o,NeoDatis ODB), document-based storage(XML, Excel, OpenDocument spreadsheets), web-based storage (JSON, Google Storage, Amazon Simple Storage Service), map-based datastores (HBase, Google's BigTable), as well as other types of datastores (LDAP). It is designed using OSGitechnology.

DataNucleus Access Platform is the persistence layer behind Google App Engine for Java.


Enterprise Java Beans 3.0 (EJB3) specification also covered persistence, as had EJB v2 with Entity Beans. In the end, persistence has been "broken out" of "EJB3 Core", and a new standard formed, the Java Persistence API (JPA). JPA uses thejavax.persistence package, and is specified in a separate document within the EJB3 JSR 220. Significantly, javax.persistence will notrequire an EJB container, and thus will work within a Java SE environment as well, as JDO always has. JPA, however, is an Object-relational mapping(ORM) standard, while JDO is both an Object-relational mapping standard and a transparent object persistence standard. JDO, from an API point of view, is agnostic to the technology of the underlying datastore, whereas JPA is targeted to RDBMS datastores (although there are several JPA providers that support access to non-relational datastores through the JPA API, such as EclipseLink, DataNucleus and ObjectDB).

JDO applications can easily be deployed non RDBMS datastores. Full list of supported datastores can be found at:

Leading JDO commercial implementations and open source projects will and some also offer a JPA API implementation as an alternative access to their underlying persistence engines, formerly exposed solely via JDO in the original products. There are many open source implementations of JDO.

JDO Reference Implementations:
JDO 1.0 : FOStore
JDO 2.0 : JPOX 1.1
JDO 2.1 : JPOX 1.2
JDO 2.2 : DataNucleus AccessPlatform 1.0.1
JDO 3.0 : DataNucleus AccessPlatform 2.1.0

Understanding the difference between JDO and JPA
http://db.apache.org/jdo/jdo_v_jpa.html

Apache JDO Project Documentation
http://db.apache.org/jdo/index.html

Hibernate vs JPA vs JDO - pros and cons of each?
http://stackoverflow.com/questions/530215/hibernate-vs-jpa-vs-jdo-pros-and-cons-of-each

Good place to start:

Data Nucleus Tutorial

JSR for JDO

Having reading some basic information about JDO and JPA, seems choosing a JDO implementation of persistence is better option.

Comments

Popular posts from this blog

Find second largest element in an array

Find second largest element in an unsorted array.               We can reach the solution in three ways.  Solution 1 Sort the array and return last but one element. We could use already existing sorting methods in JDK Arrays class and sort the array. public static int findSecondLargestV1( int [] array ){ if ( array . length == 0 || array . length < 2){ return -1; } Arrays.sort( array ); return array [ array . length - 2]; } Complexity: Since this solution depends on sorting, the complexity is equal to complexity of sorting algorithm, ie., O(n log n) Solution 2 public static int findSecondLargestV2( int [] array ){ if ( array . length == 0 || array . length < 2){ return -1; } int max = -1; for ( int i = 0; i < array . length ; i ++){ if ( array [ i ] > max ){ max = array [ i ]; } }...

Binary search (recursive and non-recursive)

Recursive solution: public static int binarySearch( int [] array , int startIndex , int endIndex , int value ){ int midIndex = ( startIndex + endIndex )/2; if ( array [ midIndex ] == value ){ return value ; } if ( startIndex > endIndex ){ return -1; } if ( value < array [ midIndex ]){ int sI = startIndex ; int eI = midIndex - 1; return binarySearch( array , sI , eI , value ); } else { int sI = midIndex + 1; int eI = endIndex ; return binarySearch( array , sI , eI , value ); } } Non-Recursive solution: public static int binarySearchNoRecursion( int [] array ,  int value ){ int startIndex = 0; int endIndex = array . length - 1; while ( startIndex <= endIndex ){ int midIndex = ( startIndex + endIndex )/2; if ( array [ midIndex ] == value ){ return value ; } if ( value ...

Merge two sorted Lists or Arrays

Code to merge two array lists: public static ArrayList<Integer> mergeLists(ArrayList<Integer> l1 , ArrayList<Integer> l2 ){ ArrayList<Integer> l3 = new ArrayList<Integer>(); int i = 0; int j = 0; while ( i < ( l1 .size()) && j < ( l2 .size())){ if ( l1 .get( i ) < l2 .get( j )){ l3 .add( l1 .get( i )); i ++; } else { l3 .add( l2 .get( j )); j ++; } } if ( i < l1 .size()){ while ( i < l1 .size()){ l3 .add( l1 .get( i )); i ++; } } else if ( j < l2 .size()){ while ( j < l2 .size()){ l3 .add( l2 .get( j )); j ++; } } return l3 ; } Code to merge two arrays: public static int[] mergeArrays(int[] a, int[] b){ if((a == null || a.length == 0) && (b == null || b.length == 0)) return new int[0]; if((a == null || a.length == 0)) return b; if(b == n...