File tree 1 file changed +16
-0
lines changed
hibernate-core/src/test/java/org/hibernate/orm/test/query/dynamic
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -176,6 +176,22 @@ void testSimpleMutationRestrictionAsReference(SessionFactoryScope factoryScope)
176
176
assertThat ( sqlCollector .getSqlQueries ().get ( 0 ) ).contains ( " where be1_0.position between ? and ?" );
177
177
}
178
178
179
+ @ Test
180
+ void testSimpleMutationRestrictionStatelessAsReference (SessionFactoryScope factoryScope ) {
181
+ final SQLStatementInspector sqlCollector = factoryScope .getCollectingStatementInspector ();
182
+ var deleteBasicEntity = MutationSpecification
183
+ .create ( BasicEntity .class , "delete BasicEntity" )
184
+ .restrict ( Restriction .restrict ( BasicEntity_ .position , Range .closed ( 1 , 5 ) ) )
185
+ .reference ();
186
+ factoryScope .inStatelessTransaction ( statelessSession -> {
187
+ sqlCollector .clear ();
188
+ statelessSession .createQuery ( deleteBasicEntity ).executeUpdate ();
189
+ } );
190
+
191
+ assertThat ( sqlCollector .getSqlQueries () ).hasSize ( 1 );
192
+ assertThat ( sqlCollector .getSqlQueries ().get ( 0 ) ).contains ( " where be1_0.position between ? and ?" );
193
+ }
194
+
179
195
@ Test
180
196
void testRootEntityForm (SessionFactoryScope factoryScope ) {
181
197
final SQLStatementInspector sqlCollector = factoryScope .getCollectingStatementInspector ();
You can’t perform that action at this time.
0 commit comments