JDO vs JPA for Java on Google App Engine

前端 未结 12 589
生来不讨喜
生来不讨喜 2020-12-12 12:22

I want to develop my project on Google App Engine with Struts2. For the database I have two options JPA and JDO. Will you guys please suggest me on it? Both are new for me a

相关标签:
12条回答
  • 2020-12-12 13:08

    Go JDO. Even if you don't have experience in it, it is not hard to pick up, and you will have a new skill under your belt!

    0 讨论(0)
  • 2020-12-12 13:09

    Neither!

    Use Objectify, because is cheaper (use less resources) and is faster. FYI: http://paulonjava.blogspot.mx/2010/12/tuning-google-appengine.html

    Objectify is a Java data access API specifically designed for the Google App Engine datastore. It occupies a "middle ground"; easier to use and more transparent than JDO or JPA, but significantly more convenient than the Low-Level API. Objectify is designed to make novices immediately productive yet also expose the full power of the GAE datastore.

    Objectify lets you persist, retrieve, delete, and query your own typed objects.

    @Entity
    class Car {
        @Id String vin; // Can be Long, long, or String
        String color;
    }
    
    ofy().save().entity(new Car("123123", "red")).now();
    Car c = ofy().load().type(Car.class).id("123123").now();
    ofy().delete().entity(c);
    
    0 讨论(0)
  • 2020-12-12 13:10

    Just saw this comparison between JPA and JDO by DataNucleus themselves:- http://www.datanucleus.org/products/accessplatform_2_1/jdo_jpa_faq.html An eye-opener.

    0 讨论(0)
  • 2020-12-12 13:12

    JPA is Sun's standard for persistence, JDO is IMHO dying (actually, it's dead but still moving). In other words, JPA seems to be a better investment on the long term. So I guess I'd choose JPA if both were new to me.

    0 讨论(0)
  • 2020-12-12 13:12

    The GAE/J google group has several posts about this very thing. I'd do a search on there and look at people's opinions. You will get a very different message to the opinions expressed above. Also focus on the fact that BigTable is not an RDBMS. Use the right tool for the job

    0 讨论(0)
  • 2020-12-12 13:13

    GAE/J is slated to add MYSQL before the end of the year.

    0 讨论(0)
提交回复
热议问题