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 2323
2424import java .time .LocalDate ;
2525import java .util .List ;
26+ import java .util .Optional ;
2627
2728@ Repository
2829public interface Library2 {
@@ -32,6 +33,9 @@ public interface Library2 {
3233 @ Find
3334 Uni <Book > book (String isbn );
3435
36+ @ Find
37+ Uni <Optional <Book >> maybeBook (String isbn );
38+
3539 @ Find
3640 Uni <List <Book >> books (@ By ("isbn" ) List <String > isbns );
3741
Original file line number Diff line number Diff line change @@ -85,6 +85,13 @@ public String getAttributeDeclarationString() {
8585
8686 private void throwIfNull (StringBuilder declaration ) {
8787 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+ }
8895 declaration
8996 .append (')' );
9097 }
@@ -157,7 +164,7 @@ private void varOrReturn(StringBuilder declaration) {
157164 declaration
158165 .append ("\t try {\n \t " );
159166 }
160- if (containerType != null ) {
167+ if (containerType != null && ! isReactive () ) {
161168 declaration
162169 .append ("\t return " )
163170 .append (annotationMetaEntity .staticImport (containerType , "ofNullable" ))
You can’t perform that action at this time.
0 commit comments