Skip to content

Commit 6a145b0

Browse files
committed
HHH-19602 - Adjust JdbcOperation to allow more-than-one statement
HHH-19782 - Oracle support for locking across joins
1 parent 4e747e3 commit 6a145b0

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

hibernate-core/src/main/java/org/hibernate/sql/ast/internal/StandardLockingClauseStrategy.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,6 @@ private void addColumnRefs(TableGroup tableGroup, List<String> lockItems) {
247247
final String[] keyColumns = determineKeyColumnNames( tableGroup );
248248
final String tableAlias = tableGroup.getPrimaryTableReference().getIdentificationVariable();
249249
for ( int i = 0; i < keyColumns.length; i++ ) {
250-
// NOTE: in some tests with Oracle, the qualifiers are being applied twice;
251-
// still need to track that down. possibly, unexpected calls to
252-
// `Dialect#applyLocksToSql`?
253-
assert !keyColumns[i].contains( "." );
254250
lockItems.add( tableAlias + "." + keyColumns[i] );
255251
}
256252

@@ -311,8 +307,8 @@ else if ( tableGroup.getModelPart() instanceof EntityPersister entityPersister )
311307
else if ( tableGroup.getModelPart() instanceof PluralAttributeMapping pluralAttributeMapping ) {
312308
return extractColumnNames( pluralAttributeMapping.getKeyDescriptor() );
313309
}
314-
else if ( tableGroup instanceof EntityAssociationMapping entityAssociationMapping ) {
315-
return extractColumnNames( entityAssociationMapping.getForeignKeyDescriptor() );
310+
else if ( tableGroup.getModelPart() instanceof EntityAssociationMapping entityAssociationMapping ) {
311+
return extractColumnNames( entityAssociationMapping.getAssociatedEntityMappingType().getIdentifierMapping() );
316312
}
317313
else {
318314
throw new AssertionFailure( "Unable to determine columns for locking" );

0 commit comments

Comments
 (0)