micronaut-projects / micronaut-data

Ahead of Time Data Repositories
Apache License 2.0
464 stars 195 forks source link

Micronaut Data method is missing compilation time query information - when using inheritance to define a core repository and then add driver specific config in a derived interface (Works in MN3, fails when ported to MN4) #2465

Closed ianibo closed 1 year ago

ianibo commented 1 year ago

Expected Behavior

We have an existing MN3 project which defines a core reusable repository interface and then decorates a derived interface with the postgres specific repository. MN4 should support the same behaviour as MN3.

A clean mn4 project has been created with

mn create-app --build=gradle --jdk=17 --lang=java --test=junit --features=data-r2dbc,r2dbc,postgres,micrometer-datadog,validation,lombok,graalvm,openapi,micronaut-http-validation,security-jwt,flyway explore

and a single domain class, flyway migration and repository added.

A fresh test has been added that does the minimum to recreate the issue the test should create a single object in the DB and then execute the findAll method without error.

Actual Behaviour

./gradle clean build fails when the test fails with the message

io.micronaut.transaction.exceptions.TransactionSystemException: Error invoking doInTransaction handler: Micronaut Data method is missing compilation time query information. Ensure that the Micronaut Data annotation processors are declared in your build and try again with a clean re-build." type="io.micronaut.transaction.exceptions.TransactionSystemException

Steps To Reproduce

git clone https://github.com/ianibo/mn4-r2dbc-error.git cd mn4-r2dbc-error ./gradlew clean build

test fails.

Environment Information

OS: Linux Java: Temurin 17.0.3-tem

Example Application

https://github.com/ianibo/mn4-r2dbc-error

Version

4.0.5

ianibo commented 1 year ago

Possibly a regression from #1957?

dstepanov commented 1 year ago

It looks like the conflict between the method in ReactiveStreamsCrudRepository and AgencyRepository break is somehow. If you rename it to queryAll it works

ianibo commented 1 year ago

Oh thats amazing - thanks so much!

On Sat, 26 Aug 2023 at 08:09, Denis Stepanov @.***> wrote:

It looks like the conflict between the method in ReactiveStreamsCrudRepository and AgencyRepository break is somehow. If you rename it to queryAll it works

— Reply to this email directly, view it on GitHub https://github.com/micronaut-projects/micronaut-data/issues/2465#issuecomment-1694206049, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAANAIZOWV2M75ROLHPIVCLXXGOKNANCNFSM6AAAAAA37GYJXE . You are receiving this because you authored the thread.Message ID: @.***>

-- Ian Ibbotson W: http://ianibbo.me E: @.*** skype: ianibbo twitter: ianibbo GoodReads: https://www.goodreads.com/user/show/3106516-ian-ibbotson

dstepanov commented 1 year ago

This should be fixed