Package com.google.appengine.api.datastore

Examples of com.google.appengine.api.datastore.PropertyProjection


  @Override
  public Set<String> getRootPipelinesDisplayName() {
    Query query = new Query(JobRecord.DATA_STORE_KIND);
    query.addProjection(
        new PropertyProjection(JobRecord.ROOT_JOB_DISPLAY_NAME, String.class));
    query.setDistinct(true);
    final PreparedQuery preparedQuery = dataStore.prepare(query);
    return tryFiveTimes(new Operation<Set<String>>("getRootPipelinesDisplayName") {
      @Override
      public Set<String> call() {
View Full Code Here


    if (this.hybrid != null && this.hybrid)
      throw new IllegalStateException("You cannot ask for both hybrid and projections in the same query. That makes no sense!");

    for (String field: fields) {
      this.actual.addProjection(new PropertyProjection(field, null));
    }
  }
View Full Code Here

            .withProperty("weight", 10L)
            .store();

        Query query = new Query("Product")
            .setAncestor(key)
            .addProjection(new PropertyProjection("price", Long.class))
            .addProjection(new PropertyProjection("percent", Double.class))
            .addProjection(new PropertyProjection("x", Double.class))
            .addProjection(new PropertyProjection("diff", Long.class));

        PreparedQuery preparedQuery = service.prepare(query);
        Entity result = preparedQuery.asSingleEntity();
        assertEquals(e.getKey(), result.getKey());
        assertEquals(e.getProperty("price"), result.getProperty("price"));
View Full Code Here

            .withProperty("bar", "bar")
            .store();

        Query query = new Query("Kind")
            .setAncestor(key)
            .addProjection(new PropertyProjection("foo", String.class));

        List<Entity> results = service.prepare(query).asList(withDefaults());
        assertEquals(Collections.singletonList(e1), results);
    }
View Full Code Here

            .withProperty("foo", null)
            .store();

        Query query = new Query("Kind")
            .setAncestor(key)
            .addProjection(new PropertyProjection("foo", String.class));

        List<Entity> results = service.prepare(query).asList(withDefaults());
        assertEquals(Collections.singletonList(e1), results);
    }
View Full Code Here

            .withProperty("baz", "baz")
            .store();

        Query query = new Query("Kind")
            .setAncestor(key)
            .addProjection(new PropertyProjection("foo", String.class))
            .addProjection(new PropertyProjection("bar", String.class));

        List<Entity> results = service.prepare(query).asList(withDefaults());
        assertEquals(Collections.singletonList(e1), results);
    }
View Full Code Here

            .withProperty("long", 123L)
            .store();

        Query query = new Query("Product")
            .setAncestor(key)
            .addProjection(new PropertyProjection("long", null));

        PreparedQuery preparedQuery = service.prepare(query);
        Entity result = preparedQuery.asSingleEntity();
        assertEquals(e.getKey(), result.getKey());
View Full Code Here

            .withProperty("prop", Arrays.asList("bbb", "ccc", "aaa"))
            .store();

        Query query = new Query(entityKind)
            .setAncestor(key)
            .addProjection(new PropertyProjection("prop", String.class))
            .addSort("prop");

        PreparedQuery preparedQuery = service.prepare(query);
        List<Entity> results = preparedQuery.asList(withDefaults());
        assertEquals(3, results.size());
View Full Code Here

            .withProperty("price", Arrays.asList(10L, 20L))
            .store();

        Query query = new Query("Product")
            .setAncestor(key)
            .addProjection(new PropertyProjection("name", String.class))
            .setFilter(new Query.FilterPredicate("price", GREATER_THAN, 0L))
            .addSort("price")
            .addSort("name");

        PreparedQuery preparedQuery = service.prepare(query);
View Full Code Here

            .withProperty("prop", Arrays.asList("aaa", "bbb", "ccc"))
            .store();

        Query query = new Query("test")
            .setAncestor(key)
            .addProjection(new PropertyProjection("prop", String.class))
            .addSort("prop");

        assertEquals(3, service.prepare(query).asList(withDefaults()).size());

        e = createEntity(e.getKey())
View Full Code Here

TOP

Related Classes of com.google.appengine.api.datastore.PropertyProjection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.