8
8
import java .util .ArrayList ;
9
9
import java .util .List ;
10
10
11
+ import org .hibernate .community .dialect .InformixDialect ;
11
12
import org .hibernate .dialect .SybaseASEDialect ;
12
13
import org .hibernate .query .criteria .HibernateCriteriaBuilder ;
13
14
import org .hibernate .query .criteria .JpaCriteriaQuery ;
19
20
import org .hibernate .testing .orm .junit .SessionFactory ;
20
21
import org .hibernate .testing .orm .junit .SessionFactoryScope ;
21
22
import org .hibernate .testing .orm .junit .SkipForDialect ;
22
- import org .junit .jupiter .api .AfterAll ;
23
- import org .junit .jupiter .api .BeforeAll ;
23
+ import org .junit .jupiter .api .AfterEach ;
24
+ import org .junit .jupiter .api .BeforeEach ;
24
25
import org .junit .jupiter .api .Test ;
25
26
26
27
import jakarta .persistence .Entity ;
47
48
} )
48
49
@ SessionFactory
49
50
public class CriteriaMultiselectGroupByAndOrderByTest {
50
- @ BeforeAll
51
+ @ BeforeEach
51
52
public void setUp (SessionFactoryScope scope ) {
52
53
scope .inTransaction ( session -> {
53
54
final Secondary secondaryA = new Secondary ( 1 , "a" );
@@ -69,12 +70,9 @@ public void setUp(SessionFactoryScope scope) {
69
70
} );
70
71
}
71
72
72
- @ AfterAll
73
+ @ AfterEach
73
74
public void tearDown (SessionFactoryScope scope ) {
74
- scope .inTransaction ( session -> {
75
- session .createMutationQuery ( "delete from Primary" ).executeUpdate ();
76
- session .createMutationQuery ( "delete from Secondary" ).executeUpdate ();
77
- } );
75
+ scope .getSessionFactory ().getSchemaManager ().truncate ();
78
76
}
79
77
80
78
@ Test
@@ -129,14 +127,20 @@ public void testSubqueryGroupBy(SessionFactoryScope scope) {
129
127
130
128
@ Test
131
129
@ Jira ( "https://hibernate.atlassian.net/browse/HHH-17231" )
132
- @ SkipForDialect ( dialectClass = SybaseASEDialect .class , reason = "Sybase doesn't support order by + offset in subqueries" )
130
+ @ SkipForDialect ( dialectClass = SybaseASEDialect .class ,
131
+ reason = "Sybase doesn't support order by + offset in subqueries" )
132
+ @ SkipForDialect ( dialectClass = InformixDialect .class ,
133
+ reason = "Informix doesn't support offset in subqueries" )
133
134
public void testSubqueryGroupByAndOrderBy (SessionFactoryScope scope ) {
134
135
executeSubquery ( scope , true , false );
135
136
}
136
137
137
138
@ Test
138
139
@ Jira ( "https://hibernate.atlassian.net/browse/HHH-17231" )
139
- @ SkipForDialect ( dialectClass = SybaseASEDialect .class , reason = "Sybase doesn't support order by + offset in subqueries" )
140
+ @ SkipForDialect ( dialectClass = SybaseASEDialect .class ,
141
+ reason = "Sybase doesn't support order by + offset in subqueries" )
142
+ @ SkipForDialect ( dialectClass = InformixDialect .class ,
143
+ reason = "Informix doesn't support offset in subqueries" )
140
144
public void testSubqueryGroupByAndOrderByAndHaving (SessionFactoryScope scope ) {
141
145
executeSubquery ( scope , true , true );
142
146
}
0 commit comments