Commit de0d0c6f authored by Grzegorz Pietrusza's avatar Grzegorz Pietrusza

fix get all tasks

parent 1e5d0a1c
......@@ -9,6 +9,9 @@ public class Flag {
private String value;
private static int flagLength = 32;
public Flag() {
}
public Flag(String value) {
this.value = value;
}
......
......@@ -24,17 +24,7 @@ public class Task {
this.name = name;
}
public Task() {
}
public ObjectId getId() {
return id;
}
public void setId(ObjectId id) {
this.id = id;
}
public Task() {}
public String getName() {
return name;
......
package repositories;
import java.util.List;
/**
* Created by gpietrus on 20.02.2016.
*/
public interface Repository {
// void get(UUID uuid);
// List<Task> getAll();
List getAll();
// void add(User user); //todo: not user //todo: use generics?
}
......@@ -39,11 +39,7 @@ public class TasksRepository implements Repository {
}
public List<Task> getAll() {
return null; //todo
// return mongoDBConnector.getCollection("tasks")
// .stream()
// .map(Task::new)
// .collect(Collectors.toList());
return datastore.createQuery(Task.class).asList();
}
public void add(Task task) {
......
......@@ -34,7 +34,6 @@ public class TeamsRepository implements Repository {
}
//todo: move this to inteface!!!
public List<Team> getAll() {
return datastore.createQuery(Team.class).asList();
}
......
......@@ -6,6 +6,7 @@ import org.mongodb.morphia.Datastore;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.List;
import java.util.Optional;
/**
......@@ -54,6 +55,11 @@ public class UsersRepository implements Repository {
return userOptional;*/
}
@Override
public List getAll() {
return null;
}
// public void get(UUID uuid) {
// }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment