12

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?

n002213f
  • 7,805
  • 13
  • 69
  • 105
  • related: http://stackoverflow.com/questions/530215/hibernate-vs-jpa-vs-jdo-pros-and-cons-of-each – matt b Dec 10 '09 at 05:56
  • @matt - from you question i don't see any answers that give the differences. You asked about the pros and cons, i was going to evaluate those after understanding the differences between the two specification. – n002213f Dec 10 '09 at 06:10

2 Answers2

11

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)

DataNucleus
  • 15,497
  • 3
  • 32
  • 37
2

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.

James
  • 17,965
  • 11
  • 91
  • 146
  • 2
    GAE seems to be a key JDO-supporting platform. I don't know how distinct that is to DataNucleus but I've seen the questions here… – Donal Fellows Mar 19 '12 at 15:58
  • 1
    How many representatives of non-RDBMS datastore vendors are there on the JPA expert group? This would be a representation of how suitable it is being "designed" for non-RDBMS datastores. – user383680 Mar 19 '12 at 16:25
  • 1
    These other datastores don't use JDBC, yet JPA is oriented around it, with no real way of providing access to a datastore by standard JPA means; DataNucleus seems to hack it in via the jdbc.url. Consequently no, I don't see how "JPA" caters for other datastores as you claim. Whether DataNucleus ought to offer JPA on them is debatable too. – Neil Stockton Mar 19 '12 at 17:05