Commit dc8677f7 authored by Grzegorz Pietrusza's avatar Grzegorz Pietrusza

use morphia filter

parent bf6e9172
...@@ -25,10 +25,10 @@ public class SolutionsRepository extends Repository<Solution> ...@@ -25,10 +25,10 @@ public class SolutionsRepository extends Repository<Solution>
public Map<Integer, List<String>> getTeamSolutions(Team team) public Map<Integer, List<String>> getTeamSolutions(Team team)
{ {
//todo: use morphia filter //todo: do not identify team by name? conflict in team ids?
return datastore.createQuery(Solution.class).asList() return datastore.createQuery(Solution.class)
.filter("team.name",team.getName()).asList()
.stream() .stream()
.filter(solution -> solution.getTeam().equals(team))
.collect(Collectors.groupingBy(new Function<Solution, Task>() .collect(Collectors.groupingBy(new Function<Solution, Task>()
{ {
@Override @Override
......
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