diff --git a/appengine/guestbook-cloud-datastore/src/main/java/com/example/guestbook/Greeting.java b/appengine/guestbook-cloud-datastore/src/main/java/com/example/guestbook/Greeting.java index 12eb3d6c6de..a32777318c3 100644 --- a/appengine/guestbook-cloud-datastore/src/main/java/com/example/guestbook/Greeting.java +++ b/appengine/guestbook-cloud-datastore/src/main/java/com/example/guestbook/Greeting.java @@ -54,7 +54,7 @@ public Greeting(String book, String content, String id, String email) { } public Greeting(Entity entity) { - key = entity.hasKey() ? entity.key() : null; + key = entity.hasKey() ? entity.getKey() : null; authorEmail = entity.contains("authorEmail") ? entity.getString("authorEmail") : null; authorId = entity.contains("authorId") ? entity.getString("authorId") : null; date = entity.contains("date") ? entity.getDateTime("date").toDate() : null; @@ -66,7 +66,7 @@ public void save() { key = getDatastore().allocateId(makeIncompleteKey()); // Give this greeting a unique ID } - Builder builder = FullEntity.builder(key); + Builder builder = FullEntity.newBuilder(key); if (authorEmail != null) { builder.set("authorEmail", authorEmail); @@ -84,7 +84,7 @@ public void save() { private IncompleteKey makeIncompleteKey() { // The book is our ancestor key. - return Key.builder(book.getKey(), "Greeting").build(); + return Key.newBuilder(book.getKey(), "Greeting").build(); } @Override diff --git a/appengine/guestbook-cloud-datastore/src/main/java/com/example/guestbook/Guestbook.java b/appengine/guestbook-cloud-datastore/src/main/java/com/example/guestbook/Guestbook.java index ae407175ecb..218a7e292b8 100644 --- a/appengine/guestbook-cloud-datastore/src/main/java/com/example/guestbook/Guestbook.java +++ b/appengine/guestbook-cloud-datastore/src/main/java/com/example/guestbook/Guestbook.java @@ -52,11 +52,11 @@ public Key getKey() { public List getGreetings() { // This query requires the index defined in index.yaml to work because of the orderBy on date. EntityQuery query = - Query.entityQueryBuilder() - .kind("Greeting") - .filter(hasAncestor(key)) - .orderBy(desc("date")) - .limit(5) + Query.newEntityQueryBuilder() + .setKind("Greeting") + .setFilter(hasAncestor(key)) + .setOrderBy(desc("date")) + .setLimit(5) .build(); QueryResults results = getDatastore().run(query); diff --git a/appengine/guestbook-cloud-datastore/src/main/java/com/example/guestbook/Persistence.java b/appengine/guestbook-cloud-datastore/src/main/java/com/example/guestbook/Persistence.java index 3dbc2285743..bb6b53a16fe 100644 --- a/appengine/guestbook-cloud-datastore/src/main/java/com/example/guestbook/Persistence.java +++ b/appengine/guestbook-cloud-datastore/src/main/java/com/example/guestbook/Persistence.java @@ -25,7 +25,8 @@ public class Persistence { public static Datastore getDatastore() { if (datastore.get() == null) { - datastore.set(DatastoreOptions.builder().projectId("your-project-id-here").build().service()); + datastore.set(DatastoreOptions.newBuilder().setProjectId("your-project-id-here") + .build().getService()); } return datastore.get(); @@ -36,7 +37,7 @@ public static void setDatastore(Datastore datastore) { } public static KeyFactory getKeyFactory(Class c) { - return getDatastore().newKeyFactory().kind(c.getSimpleName()); + return getDatastore().newKeyFactory().setKind(c.getSimpleName()); } } //[END all] diff --git a/appengine/guestbook-cloud-datastore/src/test/java/com/example/guestbook/TestUtils.java b/appengine/guestbook-cloud-datastore/src/test/java/com/example/guestbook/TestUtils.java index 7a9716e467b..3780f0266f2 100644 --- a/appengine/guestbook-cloud-datastore/src/test/java/com/example/guestbook/TestUtils.java +++ b/appengine/guestbook-cloud-datastore/src/test/java/com/example/guestbook/TestUtils.java @@ -18,7 +18,7 @@ public class TestUtils { public static void startDatastore() { try { datastore.start(); - Persistence.setDatastore(datastore.options().service()); + Persistence.setDatastore(datastore.getOptions().getService()); } catch (IOException | InterruptedException e) { throw new RuntimeException(e); } @@ -35,7 +35,8 @@ public static void stopDatastore() { public static void wipeDatastore() { Datastore datastore = getDatastore(); - QueryResults guestbooks = datastore.run(Query.keyQueryBuilder().kind("Greeting").build()); + QueryResults guestbooks = datastore.run(Query.newKeyQueryBuilder().setKind("Greeting") + .build()); ArrayList keys = Lists.newArrayList(guestbooks); if (!keys.isEmpty()) { diff --git a/appengine/guestbook-objectify/src/main/webapp/WEB-INF/appengine-web.xml b/appengine/guestbook-objectify/src/main/webapp/WEB-INF/appengine-web.xml index 8bf645d1013..4d46047edb6 100644 --- a/appengine/guestbook-objectify/src/main/webapp/WEB-INF/appengine-web.xml +++ b/appengine/guestbook-objectify/src/main/webapp/WEB-INF/appengine-web.xml @@ -3,7 +3,7 @@ your-app-id ${appengine.app.version} true - + diff --git a/appengine/helloworld-new-plugins/README.md b/appengine/helloworld-new-plugins/README.md index fe76dd711f2..c3624160fb0 100644 --- a/appengine/helloworld-new-plugins/README.md +++ b/appengine/helloworld-new-plugins/README.md @@ -18,7 +18,7 @@ Use either: ### Running locally $ mvn appengine:run - + ### Deploying $ mvn appengine:deploy @@ -36,7 +36,7 @@ If you do not have gradle installed, you can run using `./gradlew appengineRun`. If you do not have gradle installed, you can deploy using `./gradlew appengineDeploy`. -