Skip to content

Commit d779632

Browse files
cigalygavinking
authored andcommitted
Adding returnClass as createNamedQuery parameter will create TypedQuery and avoid irritating compilation time warnings
1 parent dd0b1b2 commit d779632

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ public String getAttributeDeclarationString() {
7171
.append(sessionVariableName)
7272
.append(".createNamedQuery(")
7373
.append(fieldName())
74-
.append(")");
74+
.append(", ")
75+
.append( annotationMeta.importType( resultType( select, annotationMeta.getContext() ) ) )
76+
.append( ".class)");
7577
for ( SqmParameter<?> param : sortedParameters ) {
7678
declaration
7779
.append("\n\t\t\t.setParameter(")

0 commit comments

Comments
 (0)