Examples of countEntities()


Examples of com.google.appengine.api.datastore.PreparedQuery.countEntities()

    Query q = new Query(table);
    q = q.addFilter(field,qf,convert(value));
     DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
        PreparedQuery pq = datastore.prepare(q) ;
    int ezt = pq.countEntities();
    if (ezt > fLimit)
      throw JGException.get("result_too_large",table + " Result too LARGE. Try narrowing query by adding more filters: " + ezt + ":" + qf + ":" + field + ":" + value + ":" + value.getClass().getName());

    Iterator lst = pq.asIterator();
         //if (lst == null || !lst.hasNext())
View Full Code Here

Examples of com.google.appengine.api.datastore.PreparedQuery.countEntities()

   
    Query query = new Query("Patient");
    query.setKeysOnly();
    DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
    PreparedQuery pq = datastore.prepare(query);
    report+= "Patients in system: " + pq.countEntities(Builder.withDefaults());
   
    Query de_query = new Query("DataEntry");
    query.setKeysOnly();
    PreparedQuery de_q = datastore.prepare(de_query);
    report+= "<br>Studies in system: " + de_q.countEntities(Builder.withDefaults());
View Full Code Here

Examples of com.google.appengine.api.datastore.PreparedQuery.countEntities()

    report+= "Patients in system: " + pq.countEntities(Builder.withDefaults());
   
    Query de_query = new Query("DataEntry");
    query.setKeysOnly();
    PreparedQuery de_q = datastore.prepare(de_query);
    report+= "<br>Studies in system: " + de_q.countEntities(Builder.withDefaults());
   
    Query u_query = new Query("User");
    query.setKeysOnly();
    PreparedQuery u_q = datastore.prepare(u_query);
    report+= "<br>Users in system: " + u_q.countEntities(Builder.withDefaults());
View Full Code Here

Examples of com.google.appengine.api.datastore.PreparedQuery.countEntities()

    report+= "<br>Studies in system: " + de_q.countEntities(Builder.withDefaults());
   
    Query u_query = new Query("User");
    query.setKeysOnly();
    PreparedQuery u_q = datastore.prepare(u_query);
    report+= "<br>Users in system: " + u_q.countEntities(Builder.withDefaults());
    return report;
  }
 
  public ArrayList<Key> searchByUser(String email) {
    if(email == null || email.equals(""))
View Full Code Here

Examples of com.google.appengine.api.datastore.PreparedQuery.countEntities()

  }

  public void testCreatePluginAddsPluginDescriptionEntity() throws FileNotFoundException, IOException {
    store.createPlugin(new PluginDescription("foo", "wohoo"), new FileInputStream(FILE2));
    final PreparedQuery pq = db.prepare(new Query(PluginDescription.class.getSimpleName()));
    assertEquals(1, pq.countEntities());
  }

  public void testCreatePluginAddsTwoBytecodeEntities() throws FileNotFoundException, IOException {
    store.createPlugin(new PluginDescription("foo", "wohoo"), new FileInputStream(FILE2));
    final PreparedQuery pq = db.prepare(new Query(PluginClassBytecode.class.getSimpleName()));
View Full Code Here

Examples of com.google.appengine.api.datastore.PreparedQuery.countEntities()

  }

  public void testCreatePluginAddsTwoBytecodeEntities() throws FileNotFoundException, IOException {
    store.createPlugin(new PluginDescription("foo", "wohoo"), new FileInputStream(FILE2));
    final PreparedQuery pq = db.prepare(new Query(PluginClassBytecode.class.getSimpleName()));
    assertEquals(2, pq.countEntities());
  }

  public void testCreatePluginCallInLessThanTenMilliseconds() throws IOException {
    final double count = 1000;
    final PluginDescription d = new PluginDescription("foo", "bar");
View Full Code Here

Examples of com.google.appengine.api.datastore.PreparedQuery.countEntities()

    assertEquals(COUNT, entities.size());

    final PreparedQuery pq = db.prepare(new Query(Contact.class.getSimpleName()));

    assertEquals(COUNT, pq.countEntities());

    assertTrue(entities.get(keys.get(0)) instanceof Serializable);
  }

  public void testAddingEntityKind() {
View Full Code Here

Examples of com.google.appengine.api.datastore.PreparedQuery.countEntities()

    final Long value = 23L;
    newKind.setProperty("foo", value);
    db.put(newKind);

    final PreparedQuery pq = db.prepare(new Query("NewKind"));
    assertEquals(1, pq.countEntities());

    final Entity gotEntity = pq.asSingleEntity();
    assertEquals(newKind.getProperty("foo"), gotEntity.getProperty("foo"));
  }
}
View Full Code Here

Examples of com.google.appengine.api.datastore.PreparedQuery.countEntities()

    deletor.delete("Contact", creator.create(contact));

    final PreparedQuery pq = db.prepare(new Query("Contact"));
   
    assertEquals(0, pq.countEntities());
  }
 
  public void testDeleteOne() {
    final ArrayList<Long> ids = new ArrayList<Long>();
   
View Full Code Here

Examples of com.google.appengine.api.datastore.PreparedQuery.countEntities()

    deletor.delete("Contact", ids.get(0));
   
    final PreparedQuery pq = db.prepare(new Query("Contact"));
   
    // only 9 contacts should have survived this
    assertEquals(9, pq.countEntities());
   
    // the deleted entity should not be retrieved because it should have been deleted.
    for (final Entity entity: pq.asIterable()) {
      assertFalse(ids.get(0) == entity.getKey().getId());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.