HHH-17415 Add test for issue

This commit is contained in:
Marco Belladelli 2023-11-10 15:31:07 +01:00
parent 017325e1f5
commit bc7746ac5d
1 changed files with 19 additions and 0 deletions

View File

@ -153,6 +153,25 @@ public class EntityValuedPathsGroupByOrderByTest {
).getSingleResult().get( 1 ) ).isEqualTo( 3L ) );
}
@Test
@Jira( "https://hibernate.atlassian.net/browse/HHH-17415" )
public void testInSubqueryGroupBy(SessionFactoryScope scope) {
scope.inTransaction( session -> assertThat( session.createQuery(
"select a from EntityA a where a.secondary in (select b2 from EntityB b2 group by b2)",
Tuple.class
).getResultList() ).hasSize( 2 ) );
}
@Test
@Jira( "https://hibernate.atlassian.net/browse/HHH-17415" )
public void testInSubqueryGroupByImplicitJoin(SessionFactoryScope scope) {
scope.inTransaction( session -> assertThat( session.createQuery(
"select a from EntityA a where a.secondary in" +
" (select a2.secondary from EntityA a2 group by a2.secondary)",
Tuple.class
).getResultList() ).hasSize( 2 ) );
}
@Entity( name = "EntityA" )
public static class EntityA {
@Id