diff --git a/datastore/pom.xml b/datastore/pom.xml
index 68806fa3731..7f51d55b23b 100644
--- a/datastore/pom.xml
+++ b/datastore/pom.xml
@@ -15,7 +15,7 @@
com.google.gcloud
gcloud-java-datastore
- 0.1.3
+ 0.1.4
junit
@@ -31,8 +31,8 @@
maven-compiler-plugin
2.5.1
- 1.8
- 1.8
+ 1.7
+ 1.7
diff --git a/datastore/src/main/java/com/google/datastore/snippets/Concepts.java b/datastore/src/main/java/com/google/datastore/snippets/Concepts.java
index 1f6295524c5..30954447e8b 100644
--- a/datastore/src/main/java/com/google/datastore/snippets/Concepts.java
+++ b/datastore/src/main/java/com/google/datastore/snippets/Concepts.java
@@ -104,7 +104,7 @@ public class Concepts {
@BeforeClass
public static void beforeClass() throws IOException, InterruptedException {
if (!LocalGcdHelper.isActive(PROJECT_ID, PORT)) {
- gcdHelper = LocalGcdHelper.start(PROJECT_ID, PORT);
+ gcdHelper = LocalGcdHelper.start(PROJECT_ID, PORT, 1.0);
}
}
@@ -232,8 +232,8 @@ public void testProperties() {
public void testArrayValue() {
// [START array_value]
Entity task = Entity.builder(taskKey)
- .set("tags", StringValue.of("fun"), StringValue.of("programming"))
- .set("collaborators", StringValue.of("alice"), StringValue.of("bob"))
+ .set("tags", "fun", "programming")
+ .set("collaborators", "alice", "bob")
.build();
// [END array_value]
assertValidEntity(task);
@@ -374,7 +374,7 @@ private void setUpQueryTests() {
.set("created", includedDate)
.set("percent_complete", 10.0)
.set("description", StringValue.builder("Learn Cloud Datastore").indexed(false).build())
- .set("tag", StringValue.of("fun"), StringValue.of("l"), StringValue.of("programming"))
+ .set("tag", "fun", "l", "programming")
.build());
}
@@ -748,9 +748,8 @@ public void testUnindexedPropertyQuery() {
public void testExplodingProperties() {
// [START exploding_properties]
Entity task = Entity.builder(taskKey)
- .set("tags", StringValue.of("fun"), StringValue.of("programming"), StringValue.of("learn"))
- .set("collaborators", StringValue.of("alice"), StringValue.of("bob"),
- StringValue.of("charlie"))
+ .set("tags", "fun", "programming", "learn")
+ .set("collaborators", "alice", "bob", "charlie")
.set("created", DateTime.now())
.build();
// [END exploding_properties]
@@ -912,12 +911,12 @@ public void testPropertyRunQuery() {
setUpQueryTests();
// [START property_run_query]
Query query = Query.keyQueryBuilder().kind("__property__").build();
- QueryResults results = datastore.run(query);
+ QueryResults keys = datastore.run(query);
Map> propertiesByKind = new HashMap<>();
- while (results.hasNext()) {
- Key property = results.next();
- String kind = property.ancestors().get(property.ancestors().size() - 1).name();
- String propertyName = property.name();
+ while (keys.hasNext()) {
+ Key key = keys.next();
+ String kind = key.parent().name();
+ String propertyName = key.name();
Collection properties = propertiesByKind.get(kind);
if (properties == null) {
properties = new HashSet<>();
@@ -943,10 +942,9 @@ public void testPropertyByKindRunQuery() {
QueryResults results = datastore.run(query);
Map> representationsByProperty = new HashMap<>();
while (results.hasNext()) {
- Entity property = results.next();
- String propertyName = property.key().name();
- List representations =
- (List) property.getList("property_representation");
+ Entity result = results.next();
+ String propertyName = result.key().name();
+ List representations = result.getList("property_representation");
Collection currentRepresentations = representationsByProperty.get(propertyName);
if (currentRepresentations == null) {
currentRepresentations = new HashSet<>();
@@ -973,20 +971,20 @@ public void testPropertyByKindRunQuery() {
public void testPropertyFilteringRunQuery() {
setUpQueryTests();
// [START property_filtering_run_query]
- Key key = datastore.newKeyFactory()
+ Key startKey = datastore.newKeyFactory()
.kind("__property__")
.ancestors(PathElement.of("__kind__", "Task"))
.newKey("priority");
Query query = Query.keyQueryBuilder()
.kind("__property__")
- .filter(PropertyFilter.ge("__key__", key))
+ .filter(PropertyFilter.ge("__key__", startKey))
.build();
Map> propertiesByKind = new HashMap<>();
- QueryResults results = datastore.run(query);
- while (results.hasNext()) {
- Key property = results.next();
- String kind = property.ancestors().get(property.ancestors().size() - 1).name();
- String propertyName = property.name();
+ QueryResults keys = datastore.run(query);
+ while (keys.hasNext()) {
+ Key key = keys.next();
+ String kind = key.parent().name();
+ String propertyName = key.name();
Collection properties = propertiesByKind.get(kind);
if (properties == null) {
properties = new HashSet();