@Test public void checkIfResourceEntryExistsForUser() { assertTrue("Exists should return true for an entity with a valid ID", resourceEntryDao.exists("first", "user1")); assertFalse("Exists should return false for an entity with a invalid ID", resourceEntryDao.exists("second", "user1")); }
@Override public boolean exists(String id, String userId) { return findById(id, userId) != null; }
MongoResourceEntryDao extends MongoDao<ResourceEntry, String> implements ResourceEntryDao { @Override public boolean exists(String id, String userId) { return findById(id, userId) != null; } }
MongoResourceEntryDao extends MongoDao<ResourceEntry, String> implements ResourceEntryDao { @Override public boolean exists(String id, String userId) { return findById(id, userId) != null; } @Inject  MongoResourceEntryDao(Datastore datastore); }
MongoResourceEntryDao extends MongoDao<ResourceEntry, String> implements ResourceEntryDao { @Override public boolean exists(String id, String userId) { return findById(id, userId) != null; } @Inject  MongoResourceEntryDao(Datastore datastore); @Override ResourceEntry save(ResourceEntry resourceEntry, String userId); @Override ResourceEntry update(ResourceEntry resourceEntry, String userId); @Override boolean exists(String id, String userId); @Override List<ResourceEntry> findAllWithResource(String resource, String userId); @Override ResourceEntry findById(String id, String userId); @Override ResourceEntry findByResourceAndName(String resource, String resourceEntryName, String userId); @Override void delete(ResourceEntry resourceEntry, String userId); @Override void deleteById(String id, String userId); }
MongoResourceEntryDao extends MongoDao<ResourceEntry, String> implements ResourceEntryDao { @Override public boolean exists(String id, String userId) { return findById(id, userId) != null; } @Inject  MongoResourceEntryDao(Datastore datastore); @Override ResourceEntry save(ResourceEntry resourceEntry, String userId); @Override ResourceEntry update(ResourceEntry resourceEntry, String userId); @Override boolean exists(String id, String userId); @Override List<ResourceEntry> findAllWithResource(String resource, String userId); @Override ResourceEntry findById(String id, String userId); @Override ResourceEntry findByResourceAndName(String resource, String resourceEntryName, String userId); @Override void delete(ResourceEntry resourceEntry, String userId); @Override void deleteById(String id, String userId);  }