File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
tooling/metamodel-generator/src
jakartaData/java/org/hibernate/processor/test/data/reactive
main/java/org/hibernate/processor/annotation Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 23
23
24
24
import java .time .LocalDate ;
25
25
import java .util .List ;
26
+ import java .util .Optional ;
26
27
27
28
@ Repository
28
29
public interface Library2 {
@@ -32,6 +33,9 @@ public interface Library2 {
32
33
@ Find
33
34
Uni <Book > book (String isbn );
34
35
36
+ @ Find
37
+ Uni <Optional <Book >> maybeBook (String isbn );
38
+
35
39
@ Find
36
40
Uni <List <Book >> books (@ By ("isbn" ) List <String > isbns );
37
41
Original file line number Diff line number Diff line change @@ -85,6 +85,13 @@ public String getAttributeDeclarationString() {
85
85
86
86
private void throwIfNull (StringBuilder declaration ) {
87
87
if (containerType != null ) {
88
+ if ( isReactive () ) {
89
+ declaration
90
+ .append ("\n \t \t \t .map(" )
91
+ .append (annotationMetaEntity .importType (containerType ))
92
+ .append ("::" )
93
+ .append ("ofNullable" );
94
+ }
88
95
declaration
89
96
.append (')' );
90
97
}
@@ -157,7 +164,7 @@ private void varOrReturn(StringBuilder declaration) {
157
164
declaration
158
165
.append ("\t try {\n \t " );
159
166
}
160
- if (containerType != null ) {
167
+ if (containerType != null && ! isReactive () ) {
161
168
declaration
162
169
.append ("\t return " )
163
170
.append (annotationMetaEntity .staticImport (containerType , "ofNullable" ))
You can’t perform that action at this time.
0 commit comments