HHH-18610 - Fix SingleTableNativeQueryTest to only use Java 11

This commit is contained in:
Stephen Allen 2024-09-24 12:16:12 -04:00
parent 4e0b9a6216
commit e3c64387fa
1 changed files with 2 additions and 1 deletions

View File

@ -10,6 +10,7 @@ import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors;
import jakarta.persistence.CascadeType; import jakarta.persistence.CascadeType;
import jakarta.persistence.Column; import jakarta.persistence.Column;
@ -66,7 +67,7 @@ public class SingleTableNativeQueryTest extends BaseEntityManagerFunctionalTestC
doInHibernate(this::entityManagerFactory, session -> { doInHibernate(this::entityManagerFactory, session -> {
loadData(session); loadData(session);
List<Object> results = session.createNativeQuery("select {p.*} from person p order by p.name", Object.class).addEntity("p", Person.class).list(); List<Object> results = session.createNativeQuery("select {p.*} from person p order by p.name", Object.class).addEntity("p", Person.class).list();
assertThat( results.stream().map(p -> ((Person)p).getName()).toList(), contains("Jane", "John", "Mark", "Susan") ); assertThat( results.stream().map(p -> ((Person)p).getName()).collect(Collectors.toList()), contains("Jane", "John", "Mark", "Susan") );
} ); } );
} }