You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When querying using a projection interface and the entity implements said interface than it tries to convert an array to the projection interface [DATAJPA-1644] #1947
When we create a projection query (i.e. use an interface to denote which fields we want to fetch). And the entity of the repo implements the interface as well.
Then we are unable to execute the query in the repository of the entity.
The same query does work in other repositories.
classXimplementsY {
... lotsoffields
}
interfaceY {
StringgetMyField
}
interfacexRepoimplementsJpaRepository<X, ID> {
@Query("select x.myField as myField from X x")
List<Y> selectProjection();
}
This query yields the following error message:
No converter found capable of converting from type [java.lang.String] to type[@org.springframework.data.jpa.repository.Query Y]
Workaround:
Place the query in a different repository.
Added as attachment a maven project with the problem and workaround.