Closed shuaqiu closed 9 months ago
Care to upgrade to Spring Data Relational/R2DBC 3.2.1-SNAPSHOT for both artifacts and retest?
I'm not able to reproduce the issue without further details.
Please provide a minimal yet complete sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue.
I extract a test project. You can run the unit test at MemberRepoTest.java
to reproduct the problem.
Care to upgrade to Spring Data Relational/R2DBC 3.2.1-SNAPSHOT for both artifacts and retest?
I'm not able to reproduce the issue without further details.
Please provide a minimal yet complete sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue.
Thanks a lot. The difference is that your entity implements the interface and effectively it isn't a projection.
Now I have an another question.
For my use case, I should use .as(IMember.class)
method as above
, or use .map(Function.identity())
as
public Mono<IMember> findById(final String id) {
final Query query = Query
.query(CriteriaBuilder.buildIdQuery(id));
return entityTemplate.select(MemberBo.class)
.from(TABLE__MEMBER)
.matching(query)
.first()
.map(Function.identity());
}
I have define a query as
while
IMember
is the super interface ofMemberBo
.The query can correctly run at version 3.1.5 of
spring-data-r2dbc
, but throws exception after upgrade to version 3.2.0