简体   繁体   中英

Google App Engine JDO 3

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.

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

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"

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:(

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM