infobip / infobip-spring-data-querydsl

Infobip Spring Data Querydsl provides new functionality that enables the user to leverage the full power of Querydsl API on top of Spring Data repository infrastructure.
Apache License 2.0
281 stars 56 forks source link

Spring Boot 3 RC1 w/ R2DBC mapping error #73

Closed mycroft11 closed 1 year ago

mycroft11 commented 1 year ago

Hello,

Calling the following:

dao().getRepository().query(query -> query
                      .select(
                                    entity1.currencyId,
                                    entity1.defaultCurrency,
                                    entity1.depositEnabled,
                                    entity1.withdrawEnabled,
                                    entity2.title
                      )
                      .from(entity1)
                      .innerJoin(entity2)
                      .on(entity1.currencyId.eq(entity2.currencyCode))
                      .where(entity1.memberId.eq(testId)))
.all()
.collectList()

Generates an exception:

org.springframework.data.mapping.model.MappingInstantiationException: Failed to instantiate com.querydsl.core.Tuple using constructor NO_CONSTRUCTOR with arguments 
    at org.springframework.data.mapping.model.ReflectionEntityInstantiator.instantiateClass(ReflectionEntityInstantiator.java:102) ~[spring-data-commons-3.0.0-RC1.jar:3.0.0-RC1]
    at org.springframework.data.mapping.model.ReflectionEntityInstantiator.createInstance(ReflectionEntityInstantiator.java:53) ~[spring-data-commons-3.0.0-RC1.jar:3.0.0-RC1]
    at org.springframework.data.mapping.model.ClassGeneratingEntityInstantiator.createInstance(ClassGeneratingEntityInstantiator.java:98) ~[spring-data-commons-3.0.0-RC1.jar:3.0.0-RC1]
    at org.springframework.data.relational.core.conversion.BasicRelationalConverter.createInstance(BasicRelationalConverter.java:132) ~[spring-data-relational-3.0.0-RC1.jar:3.0.0-RC1]
    at org.springframework.data.r2dbc.convert.MappingR2dbcConverter.createInstance(MappingR2dbcConverter.java:319) ~[spring-data-r2dbc-3.0.0-RC2.jar:3.0.0-RC2]
lpandzic commented 1 year ago

I assume you're using 8.0.0-M2, does this work with 7.2.0?

mycroft11 commented 1 year ago

Thank for the reply @lpandzic ! Yes, both 8.0.0.-M2 and 7.2.0 fail with spring boot 3 rc2 :(

I tried to figure out where the converter fails to register, but no luck. Can you help?

lpandzic commented 1 year ago

7.2.0 doesn't work with Spring Boot 3, does it work with 7.2.0 and Spring Boot 2?

lpandzic commented 1 year ago

I'm closing this down as stale. Feel free to reopen if you can provide more info or a reproduction.