allow long as return type of mutation @Query method

required by Jakarta Data

Signed-off-by: Gavin King <gavin@hibernate.org>
This commit is contained in:
Gavin King 2024-03-29 14:26:25 +01:00 committed by Christian Beikov
parent 31b5af94c1
commit 17ab28a220
1 changed files with 5 additions and 2 deletions

View File

@ -2262,7 +2262,9 @@ public class AnnotationMetaEntity extends AnnotationMeta {
boolean reactive = usingReactiveSession( sessionType );
if ( !isValidUpdateReturnType( returnType, method, reactive ) ) {
message( method, mirror, value,
"return type of mutation query method must be " + (!reactive ? "'int', 'boolean' or 'void'" : "'Uni<Integer>', 'Uni<Boolean>' or 'Uni<Void>'"),
"return type of mutation query method must be "
+ (!reactive ? "'int', 'long', 'boolean' or 'void'"
: "'Uni<Integer>', 'Uni<Boolean>' or 'Uni<Void>'"),
Diagnostic.Kind.ERROR );
}
}
@ -2283,7 +2285,8 @@ public class AnnotationMetaEntity extends AnnotationMeta {
// non-reactive
return returnType.getKind() == TypeKind.VOID
|| returnType.getKind() == TypeKind.BOOLEAN
|| returnType.getKind() == TypeKind.INT;
|| returnType.getKind() == TypeKind.INT
|| returnType.getKind() == TypeKind.LONG;
}
}