Skip to content

Commit 473965f

Browse files
committed
allow long as return type of mutation @query method
required by Jakarta Data Signed-off-by: Gavin King <[email protected]>
1 parent b281d8b commit 473965f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2262,7 +2262,9 @@ private void validateUpdateHql(
22622262
boolean reactive = usingReactiveSession( sessionType );
22632263
if ( !isValidUpdateReturnType( returnType, method, reactive ) ) {
22642264
message( method, mirror, value,
2265-
"return type of mutation query method must be " + (!reactive ? "'int', 'boolean' or 'void'" : "'Uni<Integer>', 'Uni<Boolean>' or 'Uni<Void>'"),
2265+
"return type of mutation query method must be "
2266+
+ (!reactive ? "'int', 'long', 'boolean' or 'void'"
2267+
: "'Uni<Integer>', 'Uni<Boolean>' or 'Uni<Void>'"),
22662268
Diagnostic.Kind.ERROR );
22672269
}
22682270
}
@@ -2283,7 +2285,8 @@ private boolean isValidUpdateReturnType(@Nullable TypeMirror returnType, Executa
22832285
// non-reactive
22842286
return returnType.getKind() == TypeKind.VOID
22852287
|| returnType.getKind() == TypeKind.BOOLEAN
2286-
|| returnType.getKind() == TypeKind.INT;
2288+
|| returnType.getKind() == TypeKind.INT
2289+
|| returnType.getKind() == TypeKind.LONG;
22872290
}
22882291
}
22892292

0 commit comments

Comments
 (0)