Package com.google.appengine.api.datastore

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


        assertEquals(count, service.prepare(query).countEntities(fetchOption));
    }

    private void checkQueryType(String property, Class<?> type) {
        Query query = new Query(kindName, rootKey);
        query.addProjection(new PropertyProjection(property, type));
        String sql = "SELECT " + property + " FROM " + kindName + " WHERE __ancestor__ is " + rootKey;
        assertEquals(sql.toLowerCase(), query.toString().toLowerCase());
        List<Entity> results = service.prepare(query).asList(fetchOption);
        for (Entity e : results) {
            assertEquals(1, e.getProperties().size());
View Full Code Here


    }

    private void checkQueryWithLimit(int limit) {
        FetchOptions fo = FetchOptions.Builder.withLimit(limit);
        Query query = new Query(kindName, rootKey);
        query.addProjection(new PropertyProjection("stringData", String.class));
        List<Entity> results = service.prepare(query).asList(fo);
        assertEquals(limit, results.size());
    }
View Full Code Here

            query.addSort(sort.getKey(), querySortDirection);
        }

        // 3. Projections
        for (final Projection projection : projections) {
            query.addProjection(new PropertyProjection(projection.getKey(), projection.getType()));
        }

        return get(query, currentPageNum, pageSize, pageCount, cacheKey);
    }
View Full Code Here

    return transacao;
  }

  public static List<String> listarTiposTransacao() {
    Query query = new Query("Transacao");
    query.addProjection(new PropertyProjection("trans_type", String.class));
    query.setDistinct(true);

    Iterable<Entity> iterable = DatastoreServiceFactory
        .getDatastoreService().prepare(query).asIterable();
    List<String> tipos = new ArrayList<String>();
View Full Code Here

  }

  public static List<String> listarTiposFraudes()
  {
      Query query = new Query("Fraude");
      query.addProjection(new PropertyProjection("fraude_type", String.class));
      query.setDistinct(true);

      Iterable<Entity> iterable = DatastoreServiceFactory.getDatastoreService().prepare(query).asIterable();
      List<String> tipos = new ArrayList<String>();
     
View Full Code Here

      return null;
    }
   
    Query query = new Query("Localidade");
    query.addFilter("localidade_country", FilterOperator.EQUAL, pais);
    query.addProjection(new PropertyProjection("localidade_state", String.class));
    query.setDistinct(true);

    return DatastoreServiceFactory.getDatastoreService().prepare(query).asIterable();
  }
View Full Code Here

      return null;
    }
   
    Query query = new Query("Localidade");
    query.addFilter("localidade_state", FilterOperator.EQUAL, estado);
    query.addProjection(new PropertyProjection("localidade_city", String.class));
    query.setDistinct(true);

    return DatastoreServiceFactory.getDatastoreService().prepare(query).asIterable();
  }
View Full Code Here

  }

  public static List<String> listarPaises()
  {
      Query query = new Query("Localidade");
      query.addProjection(new PropertyProjection("localidade_country", String.class));
      query.setDistinct(true);

      Iterable<Entity> iterable = DatastoreServiceFactory.getDatastoreService().prepare(query).asIterable();
      List<String> paises = new ArrayList<String>();
     
View Full Code Here

  }

  public static List<String> listarBandeiras()
  {
      Query query = new Query("Midia");
      query.addProjection(new PropertyProjection("midia_bandeira", String.class));
      query.setDistinct(true);

      Iterable<Entity> iterable = DatastoreServiceFactory.getDatastoreService().prepare(query).asIterable();
      List<String> bandeiras = new ArrayList<String>();
     
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.