Skip to content

Commit 76df41f

Browse files
jrenaatsebersole
authored andcommitted
HHH-18537 - Support Session#createNamedSelectionQuery for native-query
Signed-off-by: Jan Schatteman <[email protected]>
1 parent 80b12c4 commit 76df41f

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

hibernate-core/src/main/java/org/hibernate/internal/AbstractSharedSessionContract.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,14 +1065,7 @@ private NamedNativeQueryMemento getNativeQueryMemento(String queryName) {
10651065
private <R> SelectionQuery<R> createNamedNativeSelectionQuery(
10661066
NamedNativeQueryMemento memento,
10671067
Class<R> expectedResultType) {
1068-
throw new UnsupportedOperationException(
1069-
String.format(
1070-
Locale.ROOT,
1071-
"Support for `@%s` + `%s` is not (yet) implemented",
1072-
NamedNativeQuery.class.getName(),
1073-
SelectionQuery.class.getName()
1074-
)
1075-
);
1068+
return memento.toQuery( this, expectedResultType );
10761069
}
10771070

10781071
private <R> SqmSelectionQuery<R> createNamedSqmSelectionQuery(

hibernate-core/src/test/java/org/hibernate/orm/test/jpa/query/NamedNativeQueryWithResultMappingTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
@SessionFactory
1919
@DomainModel(annotatedClasses = NamedNativeQueryWithResultMappingTest.Mapped.class)
20-
@FailureExpected( jiraKey = "HHH-18537", reason = "Call to #createNamedSelectionQuery for native-query, which never worked." )
2120
@Jira( "https://hibernate.atlassian.net/browse/HHH-18537" )
2221
public class NamedNativeQueryWithResultMappingTest {
2322
@Test void test(SessionFactoryScope scope) {

0 commit comments

Comments
 (0)