Given this 3 entities:
@Entity
class Department{
Set<Employee> employees;
Set<Employee> getEmployees(){
return this.employees;
};
}
@Entity
class Employee{
Nationality nationality;
Nationality getNationality(){
this.nationality;
}
}
@Entity
class Nationality{
}
I want to create a projection for Department
that returns all departments with their employees and nationalities. What I have achieved is to return all departments with their employees using:
@Projection(name = "fullDepartment", types = { Department.class })
public interface DepartmentsProjection {
Set<Employee> getEmployees();
}
@RepositoryRestResource(collectionResourceRel = "department", path = "departments")
public interface DepartmentRepository extends JpaRepository<Department, Long> {
}