Adding returnClass as createNamedQuery parameter will create TypedQuery and avoid irritating compilation time warnings

This commit is contained in:
Čedomir Igaly 2024-07-09 11:02:38 +02:00 committed by Gavin King
parent dd0b1b27aa
commit d779632f15
1 changed files with 3 additions and 1 deletions

View File

@ -71,7 +71,9 @@ class NamedQueryMethod implements MetaAttribute {
.append(sessionVariableName)
.append(".createNamedQuery(")
.append(fieldName())
.append(")");
.append(", ")
.append( annotationMeta.importType( resultType( select, annotationMeta.getContext() ) ) )
.append( ".class)");
for ( SqmParameter<?> param : sortedParameters ) {
declaration
.append("\n\t\t\t.setParameter(")