|
8 | 8 | import org.hibernate.Locking;
|
9 | 9 | import org.hibernate.dialect.Dialect;
|
10 | 10 | import org.hibernate.dialect.RowLockStrategy;
|
11 |
| -import org.hibernate.internal.util.collections.ArrayHelper; |
12 | 11 | import org.hibernate.internal.util.collections.CollectionHelper;
|
13 | 12 | import org.hibernate.metamodel.mapping.EntityAssociationMapping;
|
14 | 13 | import org.hibernate.metamodel.mapping.ForeignKeyDescriptor;
|
|
17 | 16 | import org.hibernate.metamodel.mapping.ValuedModelPart;
|
18 | 17 | import org.hibernate.metamodel.mapping.internal.BasicValuedCollectionPart;
|
19 | 18 | import org.hibernate.persister.entity.EntityPersister;
|
20 |
| -import org.hibernate.persister.entity.mutation.EntityMutationTarget; |
21 | 19 | import org.hibernate.sql.ast.SqlAstJoinType;
|
22 | 20 | import org.hibernate.sql.ast.spi.LockingClauseStrategy;
|
23 | 21 | import org.hibernate.sql.ast.spi.SqlAppender;
|
@@ -75,11 +73,9 @@ public StandardLockingClauseStrategy(
|
75 | 73 | @Override
|
76 | 74 | public void registerRoot(TableGroup root) {
|
77 | 75 | if ( !queryHasOuterJoins && !dialect.supportsOuterJoinForUpdate() ) {
|
78 |
| - if ( root.getModelPart() instanceof EntityMutationTarget entityMapping ) { |
79 |
| - if ( ArrayHelper.size( entityMapping.getTableMappings() ) > 1 ) { |
80 |
| - // joined inheritance and/or secondary tables - inherently has outer joins |
81 |
| - queryHasOuterJoins = true; |
82 |
| - } |
| 76 | + if ( CollectionHelper.isNotEmpty( root.getTableReferenceJoins() ) ) { |
| 77 | + // joined inheritance and/or secondary tables - inherently has outer joins |
| 78 | + queryHasOuterJoins = true; |
83 | 79 | }
|
84 | 80 | }
|
85 | 81 |
|
|
0 commit comments