use of io.crnk.example.dropwizard.mongo.domain.model.Task in project crnk-framework by crnk-project.
the class TaskToProjectRepository method findManyTargets.
@Override
public ResourceList<Project> findManyTargets(ObjectId objectId, String fieldName, QuerySpec requestParams) {
Task task = taskRepository.findOne(objectId, requestParams);
try {
DefaultResourceList<Project> result = new DefaultResourceList<>();
result.addAll((Collection<Project>) PropertyUtils.getProperty(task, fieldName));
return result;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
Aggregations