Skip to content

Commit 86497df

Browse files
Add missing runtime hints for ReactiveBeforeBindCallback
See #2798.
1 parent 175cc34 commit 86497df

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

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

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,17 @@
2121
import org.springframework.aot.hint.TypeReference;
2222
import org.springframework.data.neo4j.core.mapping.callback.AfterConvertCallback;
2323
import org.springframework.data.neo4j.core.mapping.callback.BeforeBindCallback;
24+
import org.springframework.data.neo4j.core.mapping.callback.ReactiveBeforeBindCallback;
2425
import org.springframework.data.neo4j.core.schema.GeneratedValue;
2526
import org.springframework.data.neo4j.core.support.UUIDStringGenerator;
27+
import org.springframework.data.neo4j.repository.query.QuerydslNeo4jPredicateExecutor;
28+
import org.springframework.data.neo4j.repository.query.ReactiveQuerydslNeo4jPredicateExecutor;
2629
import org.springframework.data.neo4j.repository.query.SimpleQueryByExampleExecutor;
30+
import org.springframework.data.neo4j.repository.query.SimpleReactiveQueryByExampleExecutor;
2731
import org.springframework.data.neo4j.repository.support.SimpleNeo4jRepository;
32+
import org.springframework.data.neo4j.repository.support.SimpleReactiveNeo4jRepository;
33+
import org.springframework.data.querydsl.QuerydslUtils;
34+
import org.springframework.data.util.ReactiveWrappers;
2835
import org.springframework.lang.Nullable;
2936

3037
import java.util.Arrays;
@@ -51,5 +58,31 @@ public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader)
5158
),
5259
builder -> builder.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS,
5360
MemberCategory.INVOKE_PUBLIC_METHODS));
61+
62+
if (ReactiveWrappers.isAvailable(ReactiveWrappers.ReactiveLibrary.PROJECT_REACTOR)) {
63+
hints.reflection().registerTypes(
64+
Arrays.asList(
65+
TypeReference.of(SimpleReactiveNeo4jRepository.class),
66+
TypeReference.of(SimpleReactiveQueryByExampleExecutor.class),
67+
TypeReference.of(ReactiveBeforeBindCallback.class)
68+
),
69+
builder -> builder.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.INVOKE_PUBLIC_METHODS));
70+
}
71+
72+
if (QuerydslUtils.QUERY_DSL_PRESENT) {
73+
registerQuerydslHints(hints);
74+
}
75+
}
76+
77+
private static void registerQuerydslHints(RuntimeHints hints) {
78+
79+
hints.reflection().registerType(QuerydslNeo4jPredicateExecutor.class,
80+
MemberCategory.INVOKE_PUBLIC_METHODS, MemberCategory.INVOKE_DECLARED_CONSTRUCTORS);
81+
82+
if (ReactiveWrappers.isAvailable(ReactiveWrappers.ReactiveLibrary.PROJECT_REACTOR)) {
83+
hints.reflection().registerType(ReactiveQuerydslNeo4jPredicateExecutor.class,
84+
MemberCategory.INVOKE_PUBLIC_METHODS, MemberCategory.INVOKE_DECLARED_CONSTRUCTORS);
85+
}
86+
5487
}
5588
}

0 commit comments

Comments
 (0)