Skip to content

Commit ce72f4d

Browse files
committed
GH-2725 - Add missing runtime hints.
1 parent d890a65 commit ce72f4d

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

src/main/java/org/springframework/data/neo4j/aot/Neo4jRuntimeHints.java

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,14 @@
2323
import org.springframework.data.neo4j.core.mapping.callback.BeforeBindCallback;
2424
import org.springframework.data.neo4j.core.schema.GeneratedValue;
2525
import org.springframework.data.neo4j.core.support.UUIDStringGenerator;
26+
import org.springframework.data.neo4j.repository.query.QuerydslNeo4jPredicateExecutor;
27+
import org.springframework.data.neo4j.repository.query.ReactiveQuerydslNeo4jPredicateExecutor;
2628
import org.springframework.data.neo4j.repository.query.SimpleQueryByExampleExecutor;
29+
import org.springframework.data.neo4j.repository.query.SimpleReactiveQueryByExampleExecutor;
2730
import org.springframework.data.neo4j.repository.support.SimpleNeo4jRepository;
31+
import org.springframework.data.neo4j.repository.support.SimpleReactiveNeo4jRepository;
32+
import org.springframework.data.querydsl.QuerydslUtils;
33+
import org.springframework.data.util.ReactiveWrappers;
2834
import org.springframework.lang.Nullable;
2935

3036
import java.util.Arrays;
@@ -51,5 +57,30 @@ public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader)
5157
),
5258
builder -> builder.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,
5359
MemberCategory.INVOKE_PUBLIC_METHODS));
60+
61+
if (ReactiveWrappers.isAvailable(ReactiveWrappers.ReactiveLibrary.PROJECT_REACTOR)) {
62+
hints.reflection().registerTypes(
63+
Arrays.asList(
64+
TypeReference.of(SimpleReactiveQueryByExampleExecutor.class),
65+
TypeReference.of(SimpleReactiveNeo4jRepository.class)
66+
),
67+
builder -> builder.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.INVOKE_PUBLIC_METHODS));
68+
}
69+
70+
if (QuerydslUtils.QUERY_DSL_PRESENT) {
71+
registerQuerydslHints(hints);
72+
}
73+
}
74+
75+
private static void registerQuerydslHints(RuntimeHints hints) {
76+
77+
hints.reflection().registerType(QuerydslNeo4jPredicateExecutor.class,
78+
MemberCategory.INVOKE_PUBLIC_METHODS, MemberCategory.INVOKE_DECLARED_CONSTRUCTORS);
79+
80+
if (ReactiveWrappers.isAvailable(ReactiveWrappers.ReactiveLibrary.PROJECT_REACTOR)) {
81+
hints.reflection().registerType(ReactiveQuerydslNeo4jPredicateExecutor.class,
82+
MemberCategory.INVOKE_PUBLIC_METHODS, MemberCategory.INVOKE_DECLARED_CONSTRUCTORS);
83+
}
84+
5485
}
5586
}

0 commit comments

Comments
 (0)