use of io.crnk.legacy.repository.annotations.JsonApiFindManyTargets in project crnk-framework by crnk-project.
the class UserToTaskRepository method findManyTargets.
@JsonApiFindManyTargets
public ResourceList<Task> findManyTargets(Long sourceId, String fieldName, QuerySpec querySpec) {
ResourceList<Task> projects = new DefaultResourceList<>();
for (Relation<User> relation : THREAD_LOCAL_REPOSITORY.keySet()) {
if (relation.getSource().getId().equals(sourceId) && relation.getFieldName().equals(fieldName)) {
Task project = new Task();
project.setId((Long) relation.getTargetId());
projects.add(project);
}
}
return projects;
}
Aggregations