code: public List<Entity> run(String parentKeyName) {
      Datastore datastore = transaction.getDatastore();
      // [START run]
      KeyFactory keyFactory = datastore.newKeyFactory().setKind("ParentKind");
      Key parentKey = keyFactory.newKey(parentKeyName);
      // Build a query
      Query<Entity> query =
          Query.newEntityQueryBuilder()
              .setKind("MyKind")
              .setFilter(PropertyFilter.hasAncestor(parentKey))
              .build();
      QueryResults<Entity> results = transaction.run(query);
      List<Entity> entities = Lists.newArrayList();
      while (results.hasNext()) {
        Entity result = results.next();
        // do something with result
        entities.add(result);
      }
      transaction.commit();
      // [END run]
      return entities;
    }
docs: [VARIABLE "my_parent_key_name"]