File tree Expand file tree Collapse file tree 2 files changed +13
-10
lines changed
hibernate-core/src/main/java/org/hibernate Expand file tree Collapse file tree 2 files changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -169,7 +169,7 @@ protected LockStrategy determineLockingStrategy(
169169 if ( followOnStrategy == Locking .FollowOn .DISALLOW ) {
170170 throw new IllegalQueryOperationException ( "Locking with set operators is not supported" );
171171 }
172- else if ( followOnStrategy ! = Locking .FollowOn .IGNORE ) {
172+ else if ( followOnStrategy = = Locking .FollowOn .IGNORE ) {
173173 strategy = LockStrategy .NONE ;
174174 }
175175 else {
@@ -181,7 +181,7 @@ else if ( followOnStrategy != Locking.FollowOn.IGNORE ) {
181181 if ( followOnStrategy == Locking .FollowOn .DISALLOW ) {
182182 throw new IllegalQueryOperationException ( "Locking with set operators is not supported" );
183183 }
184- else if ( followOnStrategy ! = Locking .FollowOn .IGNORE ) {
184+ else if ( followOnStrategy = = Locking .FollowOn .IGNORE ) {
185185 strategy = LockStrategy .NONE ;
186186 }
187187 else {
@@ -193,7 +193,7 @@ else if ( followOnStrategy != Locking.FollowOn.IGNORE ) {
193193 if ( followOnStrategy == Locking .FollowOn .DISALLOW ) {
194194 throw new IllegalQueryOperationException ( "Locking with OFFSET/FETCH is not supported" );
195195 }
196- else if ( followOnStrategy ! = Locking .FollowOn .IGNORE ) {
196+ else if ( followOnStrategy = = Locking .FollowOn .IGNORE ) {
197197 strategy = LockStrategy .NONE ;
198198 }
199199 else {
Original file line number Diff line number Diff line change 1616import org .hibernate .metamodel .mapping .PluralAttributeMapping ;
1717import org .hibernate .metamodel .mapping .internal .BasicValuedCollectionPart ;
1818import org .hibernate .persister .entity .EntityPersister ;
19- import org .hibernate .persister .entity .JoinedSubclassEntityPersister ;
2019import org .hibernate .sql .ast .SqlAstJoinType ;
2120import org .hibernate .sql .ast .spi .ForUpdateClauseStrategy ;
2221import org .hibernate .sql .ast .spi .SqlAppender ;
@@ -113,9 +112,11 @@ private void trackJoin(TableGroupJoin join) {
113112 @ Override
114113 public boolean containsOuterJoins () {
115114 for ( TableGroup tableGroup : rootsToLock ) {
116- if ( tableGroup .getModelPart () instanceof JoinedSubclassEntityPersister ) {
117- // inherently has outer joins
118- return true ;
115+ if ( tableGroup .getModelPart () instanceof EntityPersister entityMapping ) {
116+ if ( entityMapping .hasMultipleTables () ) {
117+ // joined inheritance and/or secondary tables - inherently has outer joins
118+ return true ;
119+ }
119120 }
120121 }
121122
@@ -129,9 +130,11 @@ public boolean containsOuterJoins() {
129130 && !joinedGroup .isVirtual () ) {
130131 return true ;
131132 }
132- if ( joinedGroup .getModelPart () instanceof JoinedSubclassEntityPersister ) {
133- // inherently has outer joins
134- return true ;
133+ if ( joinedGroup .getModelPart () instanceof EntityPersister entityMapping ) {
134+ if ( entityMapping .hasMultipleTables () ) {
135+ // joined inheritance and/or secondary tables - inherently has outer joins
136+ return true ;
137+ }
135138 }
136139 }
137140
You can’t perform that action at this time.
0 commit comments