diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/query/sql/ClassIdNativeQueryTest.java b/hibernate-core/src/test/java/org/hibernate/orm/test/query/sql/ClassIdNativeQueryTest.java index 8d62110e1ce2..adb94986f9d8 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/query/sql/ClassIdNativeQueryTest.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/query/sql/ClassIdNativeQueryTest.java @@ -79,6 +79,22 @@ public void testNativeQueryWithPlaceholders(SessionFactoryScope scope) { ); } + @Test + @JiraKey( "HHH-18629" ) + public void testNativeQueryWithResultClassAndPlaceholders(SessionFactoryScope scope) { + scope.inTransaction( + session -> { + NativeQuery query = session + .createNativeQuery( + "select {book.*} from BOOK_T book", Book.class ); + query.addEntity( "book", Book.class ); + List results = query.list(); + + assertEquals( 1, results.size() ); + } + ); + } + @Entity(name = "Book") @IdClass(BookPK.class) @Table(name = "BOOK_T")