Difference between JPA and JDO?

16,343

Solution 1

Since you're using Data Nucleus, see their FAQ on JDO vs JPA. http://www.datanucleus.org/products/accessplatform_3_0/jdo_jpa_faq.html

DataNucleus AccessPlatform supports both JDO and JPA specifications of Java persistence. As such it has no "vested interest" in either technology, believing that it is for users to choose which they like best. There has been much FUD on the web about JDO and JPA, largely perpetrated by RDBMS vendors. This FAQ corrects many of these points

Solution 2

A key difference is that JDO support a rich domain model (logic together with data), in fact all persistent classes can have a reference to the current PersistenceManager, issue queries, and, I guess, it's possible not to have fields persistent by default.

JPA does not support such software design. In fact each Entity doesn't have a reference to the PersistenceManager, to have it you have to resort to ThreadLocal variables, which is not a very elegant and robust solution.

Solution 3

Since GAE BigTable is not an RDBMS, JDO is a better choice. There are some detailed comparision articles in Aphache JDO, it is helpful for me.

Solution 4

JPA persists java objects to relational data via ORM, while JDO is more general specification for java object persistence. So using JDO will give you more freedom in storage implementation options for your objects.

Solution 5

JPA is the leading java standard for persistence. So I'll say use JPA if you are using RDBMS and require ORM.
Hibernate is generally used as JPA implementation. If you need some extra features you can use hibernate specific annotations.

This question already looks to be discussed here JDO vs JPA for Java on Google App Engine

Share:
16,343
user246160
Author by

user246160

Updated on June 22, 2022

Comments

  • user246160
    user246160 almost 2 years

    want to develop my project on Google App Engine .I want to use google big table as database. For the database I have two options JPA and JDO. Will you guys please suggest me on it? Both are new for me and I need to learn them. So I will be focused on one after your replies.

  • user246160
    user246160 over 14 years
    But i want to use google datastore(Big table) using Data Nucleus .than what i follow JPA or JDO
  • DataNucleus
    DataNucleus over 14 years
    Hibernate may be "generally used as a JPA implementation" but it works only for RDBMS, and consequently will not work on GAE/J. As per the docs for GAE/J, JDO most closely matches that datastore, though if persistence models are simple and querying requirements are also simple then JPA can equally be used. With JDO or JPA the user will need to use DataNucleus
  • Kalle Richter
    Kalle Richter over 6 years
    The link is dead again.
  • Victor A
    Victor A over 2 years