Skip to content

Support interface projections on reference/association properties. #3913

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
christophstrobl opened this issue Dec 13, 2021 · 0 comments
Open
Labels
type: enhancement A general enhancement

Comments

@christophstrobl
Copy link
Member

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

@mp911de mp911de added the type: enhancement A general enhancement label Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants