spring-data-jpa icon indicating copy to clipboard operation
spring-data-jpa copied to clipboard

AOT repository fragment generation fails with a custom QueryEnhancerSelector

Open ryujungkyun opened this issue 1 month ago • 0 comments

Configuring a custom QueryEnhancerSelector through @EnableJpaRepositories causes AOT repository fragment generation to fail.

Steps to reproduce

  1. Implement a custom QueryEnhancerSelector that delegates to QueryEnhancerSelector.DEFAULT_SELECTOR.

  2. Configure it using @EnableJpaRepositories(queryEnhancerSelector = CustomQueryEnhancerSelector.class).

  3. Generate the repository's AOT fragment.

Expected behavior

AOT repository fragment generation succeeds with the configured selector.

Actual behavior

Generation fails with:

Image

The exception originates from JpaRepositoryContributor.customizeConstructor(), which uses T$ instead of the JavaPoet type placeholder $T:

Image

Verification

Reproduced on 4.2.0-SNAPSHOT at commit effece10 with a regression test in JpaRepositoryContributorConfigurationTests. Replacing T$ with $T allows the test to generate, compile, and instantiate the AOT fragment successfully.

ryujungkyun avatar Oct 08 '26 14:10 ryujungkyun