File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
hibernate-testsuite/src/test/java/org/hibernate/test/annotations/query Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -158,6 +158,9 @@ public void testImportQueryFromMappedSuperclass() {
158
158
}
159
159
160
160
public void testSQLQueryWithManyToOne () {
161
+ Statistics stats = getSessions ().getStatistics ();
162
+ stats .clear ();
163
+ stats .setStatisticsEnabled ( true );
161
164
Night n = new Night ();
162
165
Calendar c = new GregorianCalendar ();
163
166
c .set ( 2000 , 2 , 2 );
@@ -179,10 +182,8 @@ public void testSQLQueryWithManyToOne() {
179
182
s .close ();
180
183
s = openSession ();
181
184
tx = s .beginTransaction ();
182
- Statistics stats = getSessions ().getStatistics ();
183
- stats .setStatisticsEnabled ( true );
184
185
Query q = s .getNamedQuery ( "night&areaCached" );
185
- List result = q .list ();
186
+ List result = q .setCacheable ( true ). list ();
186
187
assertEquals ( 1 , result .size () );
187
188
assertEquals ( 1 , stats .getQueryCachePutCount () );
188
189
q .list ();
You can’t perform that action at this time.
0 commit comments