@@ -108,7 +108,7 @@ public BulkOperationCleanupAction(SharedSessionContractImplementor session, Set<
108
108
final LinkedHashSet <String > spacesList = new LinkedHashSet <>( tableSpaces );
109
109
110
110
final var metamodel = session .getFactory ().getMappingMetamodel ();
111
- metamodel .forEachEntityDescriptor ( ( entityDescriptor ) -> {
111
+ metamodel .forEachEntityDescriptor ( entityDescriptor -> {
112
112
final String [] entitySpaces = (String []) entityDescriptor .getQuerySpaces ();
113
113
if ( affectedEntity ( tableSpaces , entitySpaces ) ) {
114
114
addAll ( spacesList , entitySpaces );
@@ -145,9 +145,7 @@ public static void schedule(SharedSessionContractImplementor session, SqmDmlStat
145
145
}
146
146
for ( var cteStatement : statement .getCteStatements () ) {
147
147
if ( cteStatement .getCteDefinition () instanceof SqmDmlStatement <?> dmlStatement ) {
148
- entityPersisters .add (
149
- metamodel .getEntityDescriptor ( dmlStatement .getTarget ().getEntityName () )
150
- );
148
+ entityPersisters .add ( metamodel .getEntityDescriptor ( dmlStatement .getTarget ().getEntityName () ) );
151
149
}
152
150
}
153
151
@@ -194,13 +192,14 @@ private boolean affectedEntity(Set<?> affectedTableSpaces, Serializable[] checkT
194
192
if ( affectedTableSpaces == null || affectedTableSpaces .isEmpty () ) {
195
193
return true ;
196
194
}
197
-
198
- for ( Serializable checkTableSpace : checkTableSpaces ) {
199
- if ( affectedTableSpaces .contains ( checkTableSpace ) ) {
200
- return true ;
195
+ else {
196
+ for ( Serializable checkTableSpace : checkTableSpaces ) {
197
+ if ( affectedTableSpaces .contains ( checkTableSpace ) ) {
198
+ return true ;
199
+ }
201
200
}
201
+ return false ;
202
202
}
203
- return false ;
204
203
}
205
204
206
205
@ Override
@@ -216,17 +215,17 @@ public BeforeTransactionCompletionProcess getBeforeTransactionCompletionProcess(
216
215
@ Override
217
216
public AfterTransactionCompletionProcess getAfterTransactionCompletionProcess () {
218
217
return (success , session ) -> {
219
- for ( EntityCleanup cleanup : entityCleanups ) {
218
+ for ( var cleanup : entityCleanups ) {
220
219
cleanup .release ();
221
220
}
222
221
entityCleanups .clear ();
223
222
224
- for ( NaturalIdCleanup cleanup : naturalIdCleanups ) {
223
+ for ( var cleanup : naturalIdCleanups ) {
225
224
cleanup .release ();
226
225
}
227
226
naturalIdCleanups .clear ();
228
227
229
- for ( CollectionCleanup cleanup : collectionCleanups ) {
228
+ for ( var cleanup : collectionCleanups ) {
230
229
cleanup .release ();
231
230
}
232
231
collectionCleanups .clear ();
0 commit comments