21
21
import org .springframework .aot .hint .TypeReference ;
22
22
import org .springframework .data .neo4j .core .mapping .callback .AfterConvertCallback ;
23
23
import org .springframework .data .neo4j .core .mapping .callback .BeforeBindCallback ;
24
+ import org .springframework .data .neo4j .core .mapping .callback .ReactiveBeforeBindCallback ;
24
25
import org .springframework .data .neo4j .core .schema .GeneratedValue ;
25
26
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 ;
26
29
import org .springframework .data .neo4j .repository .query .SimpleQueryByExampleExecutor ;
30
+ import org .springframework .data .neo4j .repository .query .SimpleReactiveQueryByExampleExecutor ;
27
31
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 ;
28
35
import org .springframework .lang .Nullable ;
29
36
30
37
import java .util .Arrays ;
@@ -51,5 +58,31 @@ public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader)
51
58
),
52
59
builder -> builder .withMembers (MemberCategory .INVOKE_DECLARED_CONSTRUCTORS ,
53
60
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
+
54
87
}
55
88
}
0 commit comments