Skip to content

Support interface projections on reference/association properties. #3913

Open
@christophstrobl

Description

@christophstrobl

Currently it is only possible to include the target type within an interface projection when operating upon associations. It should be allowed to use interface projections on references using @DBRef.

public class WithRefs { // source domain type
	@Id String id;
	@DBRef Planet planet;
}
public interface ProjectPlanetUsingOriginalTargetType {
	Planet getPlanet(); 
}

template.query(WithRefs.class).as(ProjectPlanetUsingOriginalTargetType.class) // works
public interface ProjectPlanetUsingInterfaceProjection {
	PlanetProjection getPlanet(); // fails
}

public interface PlanetProjection {
	String getName();
}

template.query(WithRefs.class).as(ProjectPlanetUsingInterfaceProjection.class) // fails

Related Issue: #3894

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions