Open MaykoST opened 1 year ago
I think if you use evm.applySetting
you should remove any select
statement from your query.
I tried it before, but i got another error
stackTrace: java.lang.NullPointerException
at com.blazebit.persistence.querydsl.BlazeCriteriaBuilderRenderer$CTERenderVisitor.visit(BlazeCriteriaBuilderRenderer.java:1526)
at com.querydsl.core.types.SubQueryExpressionImpl.accept(SubQueryExpressionImpl.java:57)
at com.querydsl.core.support.FetchableSubQueryBase.accept(FetchableSubQueryBase.java:150)
at com.blazebit.persistence.querydsl.BlazeCriteriaBuilderRenderer.renderCTEs(BlazeCriteriaBuilderRenderer.java:367)
at com.blazebit.persistence.querydsl.BlazeCriteriaBuilderRenderer.render(BlazeCriteriaBuilderRenderer.java:130)
at com.betha.pessoal.folha.integracao.esocial.application.ESocialResource.buscaConfiguracao(ESocialResource.java:158)
at com.betha.pessoal.folha.integracao.esocial.application.ESocialResource$$FastClassBySpringCGLIB$$8ca41cf5.invoke(
Yeah, I think the NPE there is wrong. We should fix it.
Are you sure you have shared the full query with us however? This method is for rendering CTE's and not simple queries like the one demonstrated in the issue.
Yes i did, I added the screenshot of the code. I also found it strange that the error happened in the cte-related part, but that was exactly the code I ran. The NPE happens if i remove the select part.
Hi. I am facing the same issue. Could you provide a deeper explanation on the NPE problem? Is there any workaround to get working the queryDSL integration with Entity Views at the moment, please?
It would be very helpful if you could provide us a reproducer for this issue. Maybe try using the archetype for this purpose: mvn archetype:generate "-DarchetypeGroupId=com.blazebit" "-DarchetypeArtifactId=blaze-persistence-archetype-entity-view-sample" "-DarchetypeVersion=1.6.8"
Thanks for a really quick reply! Please find the reproducer here https://github.com/NorbertKominak/BlazePersistenceEntityViewError. It is a simple Spring Boot app.
Thanks for a really quick reply! Please find the reproducer here https://github.com/NorbertKominak/BlazePersistenceEntityViewError. It is a simple Spring Boot app.
@beikov could you confirm if you can run the reproducer and see the error, please?
Thanks for the reproducer. I didn't try it myself, but since @jwgmeligmeyling will be working on this, I'm sure he has :)
@jwgmeligmeyling Is there any workaround at the moment on how to avoid the NPE and use queryDSL with the Entity View module, please?
I don't think there is an easy workaround although it should be relatively easy to fix.
Basically add a null-check on the result of queryMetadata.getProjection()
here and here.
I am currently working on Hibernate 6 support for Querydsl, Querydsl Hibernate Types and Querydsl Blaze-Persistence integrations, so I can't pick this up right now but I'll try to squeeze it in before the next Blaze-Persistence release.
I don't think there is an easy workaround although it should be relatively easy to fix.
Basically add a null-check on the result of
queryMetadata.getProjection()
here and here.I am currently working on Hibernate 6 support for Querydsl, Querydsl Hibernate Types and Querydsl Blaze-Persistence integrations, so I can't pick this up right now but I'll try to squeeze it in before the next Blaze-Persistence release.
Thanks! When is the next released planned, please?
The next release is dependent on Spring Boot 3 and Hibernate 6.2 support, and it currently looks like this will take at least 2 more weeks.
I'm trying to use the QueryDSL integration with EntityViews as suggested here https://github.com/Blazebit/blaze-persistence/issues/1643, but i found a problem in the object construction code.
Code:
Map:
Error:
As can be seen in the image the wrong positions are used to access the object in the array.
My dependencies
querydsl:4.1.4 spring-boot:2.0.0 spring:5.0.4 laze-persistence: 1.6.8
java8