HHH-17415 Add test for issue
This commit is contained in:
parent
017325e1f5
commit
bc7746ac5d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue