Closed gastonlagaf closed 1 year ago
Maybe there should be considered a case when returned instance class is interface of domain type
This is the actual bug. If the domain type is implementing the returned interface, then it is no longer a projection. Instead, we should read the domain type.
Got this on Version: 3.4.5
Steps For Reproduction:
Got Entity Class:
And repository interface to it:
Repository interface parent, supplied with additional interface, required for rest of the repositories
Expected Behaviour: Mind that CassandraUserByEmail implements User interface. I expect that findByEmail method will return interface implementation, specified in generic.
Actual Behaviour: Error with message
Investigations: In CassandraAbstractQuery class there is a snippet (https://github.com/spring-projects/spring-data-cassandra/blob/9c009bc572abf3fda06a28d1a681900cf380305b/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/repository/query/AbstractCassandraQuery.java#L105-L111)
Maybe there should be considered a case when returned instance class is interface of domain type