Search in sources :

Example 1 with ProjectEager

use of io.crnk.core.mock.models.ProjectEager in project crnk-framework by crnk-project.

the class ProjectToProjectEagerRepository method findOneTarget.

@Override
public ProjectEager findOneTarget(Long sourceId, String fieldName, QueryParams queryParams) {
    Map<Relation<Project>, Integer> repo = getRepo();
    for (Relation<Project> relation : repo.keySet()) {
        if (relation.getSource().getId().equals(sourceId) && relation.getFieldName().equals(fieldName)) {
            ProjectEager task = new ProjectEager();
            task.setId((Long) relation.getTargetId());
            return task;
        }
    }
    return null;
}
Also used : Project(io.crnk.core.mock.models.Project) Relation(io.crnk.core.mock.repository.util.Relation) ProjectEager(io.crnk.core.mock.models.ProjectEager)

Aggregations

Project (io.crnk.core.mock.models.Project)1 ProjectEager (io.crnk.core.mock.models.ProjectEager)1 Relation (io.crnk.core.mock.repository.util.Relation)1