HHH-18272 Add test for issue
This commit is contained in:
parent
7fb23cd783
commit
e57a2ab7d6
|
@ -119,6 +119,15 @@ public class EntityValuedPathsGroupByOrderByTest {
|
|||
).getSingleResult().get( 1 ) ).isEqualTo( 3L ) );
|
||||
}
|
||||
|
||||
@Test
|
||||
@Jira( "https://hibernate.atlassian.net/browse/HHH-18272" )
|
||||
public void testJoinSelectAliasAndGroupByAndOrderBy(SessionFactoryScope scope) {
|
||||
scope.inTransaction( session -> assertThat( session.createQuery(
|
||||
"select b as secondary, sum(a.amount) from EntityA a join a.secondary b where b.id = 1 group by secondary order by secondary",
|
||||
Tuple.class
|
||||
).getSingleResult().get( 1 ) ).isEqualTo( 3L ) );
|
||||
}
|
||||
|
||||
// Implicit join ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@Test
|
||||
|
@ -153,6 +162,15 @@ public class EntityValuedPathsGroupByOrderByTest {
|
|||
).getSingleResult().get( 1 ) ).isEqualTo( 3L ) );
|
||||
}
|
||||
|
||||
@Test
|
||||
@Jira( "https://hibernate.atlassian.net/browse/HHH-18272" )
|
||||
public void testImplicitJoinSelectAliasAndGroupByAndOrderBy(SessionFactoryScope scope) {
|
||||
scope.inTransaction( session -> assertThat( session.createQuery(
|
||||
"select a.secondary as a_secondary, sum(a.amount) from EntityA a where a.secondary.id = 1 group by a_secondary order by a_secondary",
|
||||
Tuple.class
|
||||
).getSingleResult().get( 1 ) ).isEqualTo( 3L ) );
|
||||
}
|
||||
|
||||
@Test
|
||||
@Jira( "https://hibernate.atlassian.net/browse/HHH-17415" )
|
||||
public void testInSubqueryGroupBy(SessionFactoryScope scope) {
|
||||
|
|
Loading…
Reference in New Issue