-
Notifications
You must be signed in to change notification settings - Fork 92
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
unknown ClassCastException #1885
Comments
Hi and thanks for reporting this issue. It seems like something (Spring ORM integration?) creates a proxy for a created query which then fails to unwrap correctly. Do you think you could provide a reproducer for this? |
IIRC Projections.bean is a factory expression that has to be used with a query transformer (query().transform(Projections.bean(…)) and cannot be used as a select expression directly. I don’t think this is specific to the integration, does it work in standard Querydsl? |
In Querydsl, this code can run normally. It's only after switching to BlazeJPAQuery that I encountered this issue. |
I apologize, but it's not convenient for me to provide the complete code from the team project. |
Sure, that's fine, but maybe you can create a small reproducer application e.g. based on our quickstarts? |
spring-examples.zip |
I just checked the reproducer and this seems to be an issue with Spring Data. A proxy created by |
One possible workaround is to mark the method as |
We can probably close this issue then right? Or do you see a way to workaround this limitation that we can implement? |
Yes, I'm going to close this issue. |
Description
As Querydsl recommends the use of blaze-persistence after version 5.0.0, I integrated it. Some simple single-table queries worked fine, but when I tried to execute the following query, I encountered a ClassCastException.
Steps to reproduce
code:
exception log:
maven dependency:
Environment
Version: 1.6.11
JPA-Provider: Hibernate 6.4.1
DBMS: Postgres 16
springboot: 3.2.2
jdk: 17
The text was updated successfully, but these errors were encountered: