HHH-18399 Avoid collecting duplicate attribute for to-one inverse table
This commit is contained in:
parent
d44f6ba630
commit
0755134224
|
@ -3547,6 +3547,8 @@ public abstract class AbstractEntityPersister
|
||||||
final TableMappingBuilder tableMappingBuilder;
|
final TableMappingBuilder tableMappingBuilder;
|
||||||
|
|
||||||
final TableMappingBuilder existing = tableBuilderMap.get( tableExpression );
|
final TableMappingBuilder existing = tableBuilderMap.get( tableExpression );
|
||||||
|
|
||||||
|
final boolean inverseTable = isInverseTable( relativePosition );
|
||||||
if ( existing == null ) {
|
if ( existing == null ) {
|
||||||
final Consumer<SelectableConsumer> selectableConsumerConsumer = tableKeyColumnVisitationSupplier.get();
|
final Consumer<SelectableConsumer> selectableConsumerConsumer = tableKeyColumnVisitationSupplier.get();
|
||||||
final List<EntityTableMapping.KeyColumn> keyColumns = new ArrayList<>();
|
final List<EntityTableMapping.KeyColumn> keyColumns = new ArrayList<>();
|
||||||
|
@ -3577,7 +3579,7 @@ public abstract class AbstractEntityPersister
|
||||||
relativePosition,
|
relativePosition,
|
||||||
new EntityTableMapping.KeyMapping( keyColumns, identifierMapping ),
|
new EntityTableMapping.KeyMapping( keyColumns, identifierMapping ),
|
||||||
!isIdentifierTable && isNullableTable( relativePosition ),
|
!isIdentifierTable && isNullableTable( relativePosition ),
|
||||||
isInverseTable( relativePosition ),
|
inverseTable,
|
||||||
isIdentifierTable,
|
isIdentifierTable,
|
||||||
insertExpectations[ relativePosition ],
|
insertExpectations[ relativePosition ],
|
||||||
customInsertSql,
|
customInsertSql,
|
||||||
|
@ -3599,7 +3601,9 @@ public abstract class AbstractEntityPersister
|
||||||
tableMappingBuilder = existing;
|
tableMappingBuilder = existing;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( !inverseTable ) {
|
||||||
collectAttributesIndexesForTable( relativePosition, tableMappingBuilder.attributeIndexes::add );
|
collectAttributesIndexesForTable( relativePosition, tableMappingBuilder.attributeIndexes::add );
|
||||||
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
final EntityTableMapping[] list = new EntityTableMapping[tableBuilderMap.size()];
|
final EntityTableMapping[] list = new EntityTableMapping[tableBuilderMap.size()];
|
||||||
|
|
Loading…
Reference in New Issue