@Test public void findAllTopologiesForUser() { List<Topology> topologies = topologyDao.findAll("user1"); assertEquals("There should be 2 topologies for the user", 2, topologies.size()); assertEquals("The first item in the topology list should have and id of \"first\"", "first", topologies.get(0).getId()); assertEquals("The second item in the topology list should have and id of \"third\"", "third", topologies.get(1).getId()); }
@Override public List<Topology> findAll(String userId) { return query().field("userId").equal(userId).order("name").asList(); }
MongoTopologyDao extends MongoDao<Topology, String> implements TopologyDao { @Override public List<Topology> findAll(String userId) { return query().field("userId").equal(userId).order("name").asList(); } }
MongoTopologyDao extends MongoDao<Topology, String> implements TopologyDao { @Override public List<Topology> findAll(String userId) { return query().field("userId").equal(userId).order("name").asList(); } @Inject  MongoTopologyDao(Datastore datastore); }
MongoTopologyDao extends MongoDao<Topology, String> implements TopologyDao { @Override public List<Topology> findAll(String userId) { return query().field("userId").equal(userId).order("name").asList(); } @Inject  MongoTopologyDao(Datastore datastore); @Override boolean exists(String id, String userId); @Override List<Topology> findAll(String userId); @Override Topology findById(String id, String userId); @Override Topology findByName(String name, String userId); @Override Topology save(Topology topology, String userId); @Override Topology update(Topology topology, String userId); @Override void delete(Topology topology, String userId); @Override void deleteById(String id, String userId); }
MongoTopologyDao extends MongoDao<Topology, String> implements TopologyDao { @Override public List<Topology> findAll(String userId) { return query().field("userId").equal(userId).order("name").asList(); } @Inject  MongoTopologyDao(Datastore datastore); @Override boolean exists(String id, String userId); @Override List<Topology> findAll(String userId); @Override Topology findById(String id, String userId); @Override Topology findByName(String name, String userId); @Override Topology save(Topology topology, String userId); @Override Topology update(Topology topology, String userId); @Override void delete(Topology topology, String userId); @Override void deleteById(String id, String userId);  }