From cca52f8cccb1882ae87a5d2972c94f1433e18cf4 Mon Sep 17 00:00:00 2001 From: Christian Beikov Date: Tue, 23 Jul 2024 20:25:20 +0200 Subject: [PATCH] HHH-18410 Make use of getter/setter cache as much as possible --- .../internal/EmbeddableMappingTypeImpl.java | 41 ------------------- 1 file changed, 41 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/EmbeddableMappingTypeImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/EmbeddableMappingTypeImpl.java index 2ab36ebb2b..83d91bde3b 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/EmbeddableMappingTypeImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/mapping/internal/EmbeddableMappingTypeImpl.java @@ -680,47 +680,6 @@ public class EmbeddableMappingTypeImpl extends AbstractEmbeddableMapping impleme return span; } - @Override - public int forEachJdbcValue( - Object value, - int offset, - X x, - Y y, - JdbcValuesBiConsumer valuesConsumer, - SharedSessionContractImplementor session) { - int span = 0; - if ( value == null ) { - for ( int i = 0; i < attributeMappings.size(); i++ ) { - final AttributeMapping attributeMapping = attributeMappings.get( i ); - if ( attributeMapping instanceof PluralAttributeMapping ) { - continue; - } - span += attributeMapping.forEachJdbcValue( null, span + offset, x, y, valuesConsumer, session ); - } - if ( isPolymorphic() ) { - span += discriminatorMapping.forEachJdbcValue( null, offset + span, x, y, valuesConsumer, session ); - } - } - else { - final ConcreteEmbeddableType concreteEmbeddableType = findSubtypeBySubclass( value.getClass().getName() ); - for ( int i = 0; i < attributeMappings.size(); i++ ) { - final AttributeMapping attributeMapping = attributeMappings.get( i ); - if ( attributeMapping instanceof PluralAttributeMapping ) { - continue; - } - final Object attributeValue = concreteEmbeddableType == null || !concreteEmbeddableType.declaresAttribute( attributeMapping ) - ? null - : getValue( value, i ); - span += attributeMapping.forEachJdbcValue( attributeValue, span + offset, x, y, valuesConsumer, session ); - } - if ( isPolymorphic() ) { - final Object d = concreteEmbeddableType == null ? null : concreteEmbeddableType.getDiscriminatorValue(); - span += discriminatorMapping.forEachJdbcValue( d, offset + span, x, y, valuesConsumer, session ); - } - } - return span; - } - @Override public int decompose( Object domainValue,