@Test public void queryEntities() { Query<TestEntity> testQuery = mongoDao.query(); TestEntity responseEntity = testQuery.field("stringField") .equal(mockedEntity.getStringField()).get(); assertEquals("Query response entity should match the mocked entity", mockedEntity, responseEntity); assertEquals("Query for countAll() should return 1", 1, testQuery.countAll()); }
public Query<T> query() { return datastore.createQuery(persistentClass); }
MongoDao implements GenericDao<T, ID> { public Query<T> query() { return datastore.createQuery(persistentClass); } }
MongoDao implements GenericDao<T, ID> { public Query<T> query() { return datastore.createQuery(persistentClass); } @Inject  MongoDao(Datastore datastore, Class<T> persistentClass); }
MongoDao implements GenericDao<T, ID> { public Query<T> query() { return datastore.createQuery(persistentClass); } @Inject  MongoDao(Datastore datastore, Class<T> persistentClass); @Override boolean exists(ID id); @Override List<T> findAll(); @Override T findById(ID id); @Override T save(T entity); @Override T update(T entity); @Override void delete(T entity); @Override void deleteById(ID id); Query<T> query(); }
MongoDao implements GenericDao<T, ID> { public Query<T> query() { return datastore.createQuery(persistentClass); } @Inject  MongoDao(Datastore datastore, Class<T> persistentClass); @Override boolean exists(ID id); @Override List<T> findAll(); @Override T findById(ID id); @Override T save(T entity); @Override T update(T entity); @Override void delete(T entity); @Override void deleteById(ID id); Query<T> query();  }