Skip to content

Commit

Permalink
Adapt to changes in ORM core AttributeMappingsList [HHH-16705]
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanne committed May 31, 2023
1 parent 11fb9ee commit 8be33c5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,9 @@ default NaturalIdMapping generateNaturalIdMapping(
// in the collected names. iterate here because it is already alphabetical

final List<SingularAttributeMapping> collectedAttrMappings = new ArrayList<>();
for ( AttributeMapping attributeMapping : getAttributeMappings() ) {
final AttributeMappingsList attributeMappings = getAttributeMappings();
for ( int i = 0; i < attributeMappings.size(); i++ ) {
AttributeMapping attributeMapping = attributeMappings.get( i );
if ( attributeNames.contains( attributeMapping.getAttributeName() ) ) {
collectedAttrMappings.add( (SingularAttributeMapping) attributeMapping );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.metamodel.mapping.AttributeMapping;
import org.hibernate.metamodel.mapping.AttributeMappingsList;
import org.hibernate.metamodel.mapping.SingularAttributeMapping;
import org.hibernate.persister.entity.AbstractEntityPersister;
import org.hibernate.reactive.persister.entity.mutation.ReactiveDeleteCoordinator;
Expand All @@ -27,7 +28,9 @@ public static ReactiveUpdateCoordinator buildUpdateCoordinator(
AbstractEntityPersister entityPersister,
SessionFactoryImplementor factory) {
// we only have updates to issue for entities with one or more singular attributes
for ( AttributeMapping attributeMapping : entityPersister.getAttributeMappings() ) {
final AttributeMappingsList attributeMappings = entityPersister.getAttributeMappings();
for ( int i = 0; i < attributeMappings.size(); i++ ) {
AttributeMapping attributeMapping = attributeMappings.get( i );
if ( attributeMapping instanceof SingularAttributeMapping ) {
return new ReactiveUpdateCoordinatorStandard( entityPersister, factory );
}
Expand Down

0 comments on commit 8be33c5

Please sign in to comment.