Commit de0d0c6f authored by Grzegorz Pietrusza's avatar Grzegorz Pietrusza

fix get all tasks

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