The way to do this is to create a projection for your nested object, and then use this projection in a more global one. So, following your problem, you can create a forecast for citizenship, and then another for the Department, which has a getter to track the projection of Citizenship, and finally another projection to get the department object.
@Projection(name = "NationalityProjection", types = { Nationality.class }) public interface NationalityProjection{ // getters of all attributes you want to project } @Projection(name = "EmployeeProjection", types = { Employee.class }) public interface EmployeeProjection{ NationalityProjection getNationality(); } @Projection(name = "DepartmentProjection", types = { Department.class }) public interface DepartmentProjection{ Set<EmployeeProjection> getEmployees(); }
Hope this helps!
source share