Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Whats the difference between JPA and JDO specifications?

Tags:

java

orm

jpa

jdo

I have been using Hibernate ORM, which is an implementation of the JPA specification to manage relational data. I have also heard of the JDO specification that supposed to do the same (manage relational data).

What are the fundamental differences between the two? Any code samples most appreciated. How does JDO integrate with other Java technology stacks e.g. EJB3?

like image 644
n002213f Avatar asked Dec 10 '09 05:12

n002213f


2 Answers

Try these JDO-JPA FAQ, JDO or JPA, JDO .v. JPA, JDO .v. JPA - API, JDO .v. JPA - ORM

JDO existed long before JPA, and has a wider scope. JPA is solely for RDBMS, and (even in JPA2) doesn't provide the full support that JDO provides. The links, and other posts in this forum should provide ample reading to explain all sides of the arguments.

--Andy (DataNucleus)

like image 70
DataNucleus Avatar answered Oct 03 '22 21:10

DataNucleus


JPA was defined to unify and replace the previous existing Java persistence specs of EJB CMP and JDO. JPA was released as part of EJB 3.0, and is part of the Java EE spec supported by Oracle WebLogic, IBM Websphere, Redhat JBoss, and any other Java EE provider.

There are many leading products supporting JPA (TopLink/EclipseLink, Hibernate, OpenJPA, DataNucleus), but few to none supporting JDO or CMP. So, it seems JPA has done a good job of replacing both.

As for JPA only being RDBMS, that is entirely false, (even DataNucleus the only remaining JDO product that I am aware of, supports JPA on any non relational platform that it support JDO on).

There are also many other products that support JPA on non relational platforms, such as EclipseLink's NoSQL and EIS support (MongoDB, Oracle NoSQL, XML, legacy databases), Kundera, DataNucleus, even object databases such as ObjectDB that support JPA as their Java API.

like image 37
James Avatar answered Oct 03 '22 23:10

James