Hello,
I have the following issue (SDN 6.1.5 and 6.2.0-SNAPSHOT) when executing a query returning a projection
java.lang.ClassCastException:
Cannot cast org.springframework.data.neo4j.integration.movies.shared.Movie
to
org.springframework.data.neo4j.integration.movies.imperative.AdvancedMappingIT$MovieRefProjectionClass
The error happens when using classes (and not interfaces) for the projection and when the projection class has a field pointing to a projection class.
Sample projection class (using the testcase from SDN):
static class MovieWithSequelProjectionClass {
private String title;
private MovieWithSequelProjectionClass sequel;
public MovieWithSequelProjectionClass getSequel() {
return sequel;
}
public void setSequel(MovieWithSequelProjectionClass sequel) {
this.sequel = sequel;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
}
Please note that we don't have this issue when using projection interfaces.
Steps to reproduce:
- clone GitHub - gonzalad/spring-data-neo4j: Provide support to increase developer productivity in Java when using Neo4j. Uses familiar Spring concepts such as a template classes for core API usage and lightweight repository style data access.
- checkout issue-projection-relation-classcast
- run the AdvancedMappingIT#projectDirectCycleProjectionReferenceWithProjectionClasses
spring-data-neo4j/AdvancedMappingIT.java at issue-projection-relation-classcast · gonzalad/spring-data-neo4j · GitHub
Should I open an issue on github ?
Thanks