Skip to content

Commit 72f94b3

Browse files
committed
Add workaround for deferred constructor argument discovery.
1 parent 9fc4240 commit 72f94b3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/main/java/org/springframework/data/repository/aot/generate/RepositoryContributor.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,12 @@ public void contribute(GenerationContext generationContext) {
9696
.withConstructorCustomizer(this::customizeConstructor) //
9797
.withQueryMethodContributor(this::contributeQueryMethod); //
9898

99+
// TODO: temporary fix until we have a better representation of constructor arguments
100+
// decouple the description of arguments from the actual code used in the constructor initialization, super calls,
101+
// etc.
102+
RepositoryConstructorBuilder constructorBuilder = new RepositoryConstructorBuilder(builder.getGenerationMetadata());
103+
customizeConstructor(constructorBuilder);
104+
99105
GeneratedClass generatedClass = generationContext.getGeneratedClasses().getOrAddForFeatureComponent(FEATURE_NAME,
100106
builder.getClassName(), targetTypeSpec -> {
101107

0 commit comments

Comments
 (0)