Google App Engine JDO 3

馋奶兔 提交于 2020-01-24 02:52:09

问题


Google just came out with JDO 3.0 (which uses DataNucleus 2.0) for Google App Engine, and I want to use it, since it conveniently supports unowned relationships. I've been trying for days, but I can't figure out how to use it with the Google Eclipse plugin. I've found this web page https://developers.google.com/appengine/docs/java/datastore/jdo/overview-dn2, but my project folder doesn't have a build.xml file. I tried creating a separate project and transferring all my code, but the new project didn't have JDO 3.0, nor did it have a build.xml file.

Any help would be much appreciated.


回答1:


I just installed the new Eclipse and GPE (since upgrading my eclipse completely destroyed it, I had no other option).

Did you update your version of GPE? Mine is:

Google Plugin for Eclipse 4.2 3.1.0.v201208080121-rel-r42

After that, you should be able to switch to JDO 3.0 by selecting Datanucleus JDO/JPA v2 in the project properties under Google / App Engine. As far as I understand, the GPE v2 is actually JDO v3.0 by looking at the jars that are copied to the output directory. Mine is /war/WEB-INF/lib/datanucleus-api-jdo-3.0.7.jar




回答2:


You could switch the project building to ant by following the guide here: https://developers.google.com/appengine/docs/java/tools/ant#Creating_the_Build_File

To actually run it in eclipse, 1. Right click at the build.xml 2. Run As -> Ant Build ... 3. Select target "runserver"




回答3:


Currently, you must use Apache Ant in order to use JDO 3 or JPA 2. That document is not very well written, but it states after the Migration part:

"Currently, you must use Apache Ant to use version 2.x of the DataNucleus plugin for App Engine."

Also, "The App Engine Java SDK includes version 2.x of the DataNucleus plugin for App Engine. This plugin corresponds to version 3.0 of the DataNucleus Access Platform, which enables you to use the App Engine Datastore via JDO 3.0."

Too bad, my friend :(




回答4:


Currently you no longer need to use Apache Ant. Wit the latest GPE 1.7.3 you can select data nucleus v2 in Google App Engine project properties



来源:https://stackoverflow.com/questions/10058607/google-app-engine-jdo-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!