Skip to content

Commit e9da600

Browse files
authored
Merge pull request #516 from GoogleCloudPlatform/datastore_fixes
Upgrading library to 0.9.2-beta, adding retrieve entity to quickstart
2 parents d1bfd3a + 31fb75f commit e9da600

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

datastore/cloud-client/src/main/java/com/example/datastore/QuickstartSample.java

+6
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ public static void main(String... args) throws Exception {
4444
datastore.put(task);
4545

4646
System.out.printf("Saved %s: %s%n", task.getKey().getName(), task.getString("description"));
47+
48+
//Retrieve entity
49+
Entity retrieved = datastore.get(taskKey);
50+
51+
System.out.printf("Retrieved %s: %s%n", taskKey.getName(), retrieved.getString("description"));
52+
4753
}
4854
}
4955
// [END datastore_quickstart]

datastore/cloud-client/src/test/java/com/example/datastore/QuickstartSampleIT.java

+1
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,6 @@ public void testQuickstart() throws Exception {
6767
QuickstartSample.main();
6868
String got = bout.toString();
6969
assertThat(got).contains("Saved sampletask1: Buy milk");
70+
assertThat(got).contains("Retrieved sampletask1: Buy milk");
7071
}
7172
}

datastore/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
<dependency>
3636
<groupId>com.google.cloud</groupId>
3737
<artifactId>google-cloud-datastore</artifactId>
38-
<version>0.8.1-beta</version>
38+
<version>0.9.2-beta</version>
3939
</dependency>
4040

4141
<!-- Test dependencies -->

0 commit comments

Comments
 (0)