Open SeaLife opened 11 months ago
Hi and thanks for the report. The compilation error you are observing happens for the generated metamodel. As a workaround, you should be able to disable metamodel generation by e.g. excluding the blaze-persistence-entity-view-processor
dependency. The runtime error is due to the fact that you did not annotate the entity view mapping with @MappingSingular
, which is necesary: https://persistence.blazebit.com/documentation/1.6/entity-view/manual/en_US/index.html#singular-collection-type-mappings
Hi and thanks for the report. The compilation error you are observing happens for the generated metamodel. As a workaround, you should be able to disable metamodel generation by e.g. excluding the
blaze-persistence-entity-view-processor
dependency. The runtime error is due to the fact that you did not annotate the entity view mapping with@MappingSingular
, which is necesary: https://persistence.blazebit.com/documentation/1.6/entity-view/manual/en_US/index.html#singular-collection-type-mappings
Hey, i stated above in my report, that i tried using @MappingSingular
. We rescheduled the project involved with this issue so i dont have time to check excluding the dependency right now. :)
I encountered the same issue with:
@MappingSingular
Map<String, Object> getInfo();
It will generate the wrong type: MethodSingularAttribute<PersonView, Map<StringObject>>
, obviously missing a comma between String
and Object
in the generics of Map.
The version I am using is 1.6.11. Currently, the issue can be resolved by removing the blaze-persistence-entity-view-processor
dependency, but then we lose the benefits of performance improvement in static typing brought by blaze-persistence-entity-view-processor
.
It will generate the wrong type: MethodSingularAttribute<PersonView, Map
>, obviously missing a comma between String and Object in the generics of Map.
Thanks for the details. That should be easy to fix then.
@beikov Thanks for your work, looking forward to it being fixed.
Error mapping a Map<String, Integer> stored as JSON using EntityViews
So my Entity has a Map defined like this:
I tried to return this field in a EV. I tried no Annotation, i tried "MappingSingular" and i tried "Basic"-Annotation. With "MappingSingular" i get:
(produced code looks like this):
Using no annotation or Basic-Annnotation results in a runtime error:
Expected behavior
I expect the application to start up and run.
Steps to reproduce
Environment
Version: 1.6.10 JPA-Provider: Hibernate 6.2.13-FINAL DBMS: MariaDB Application Server: Spring Boot 3.1.5