diff --git a/hibernate-core/src/main/java/org/hibernate/action/internal/AbstractEntityInsertAction.java b/hibernate-core/src/main/java/org/hibernate/action/internal/AbstractEntityInsertAction.java index cd40658164..eef6f3a2c5 100644 --- a/hibernate-core/src/main/java/org/hibernate/action/internal/AbstractEntityInsertAction.java +++ b/hibernate-core/src/main/java/org/hibernate/action/internal/AbstractEntityInsertAction.java @@ -182,14 +182,14 @@ public abstract class AbstractEntityInsertAction extends EntityAction { if ( attribute.isPluralAttributeMapping() ) { addCollectionKey( attribute.asPluralAttributeMapping(), - descriptor.getValue( object, i ), + attribute.getValue( object ), persistenceContext ); } else if ( attribute.isEmbeddedAttributeMapping() ) { visitEmbeddedAttributeMapping( attribute.asEmbeddedAttributeMapping(), - descriptor.getValue( object, i ), + attribute.getValue( object ), persistenceContext ); } diff --git a/hibernate-core/src/main/java/org/hibernate/engine/internal/StatefulPersistenceContext.java b/hibernate-core/src/main/java/org/hibernate/engine/internal/StatefulPersistenceContext.java index 731fba3d51..f7b274e6b9 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/internal/StatefulPersistenceContext.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/internal/StatefulPersistenceContext.java @@ -412,7 +412,7 @@ public class StatefulPersistenceContext implements PersistenceContext { } @Override - public @Nullable EntityHolderImpl getEntityHolder(EntityKey key) { + public EntityHolderImpl getEntityHolder(EntityKey key) { return entitiesByKey == null ? null : entitiesByKey.get( key ); } @@ -525,7 +525,7 @@ public class StatefulPersistenceContext implements PersistenceContext { } @Override - public @Nullable EntityHolderImpl removeEntityHolder(EntityKey key) { + public EntityHolderImpl removeEntityHolder(EntityKey key) { final EntityHolderImpl holder; if ( entitiesByKey != null ) { holder = entitiesByKey.remove( key ); @@ -1316,7 +1316,7 @@ public class StatefulPersistenceContext implements PersistenceContext { */ @Override @Deprecated - public @Nullable Map,CollectionEntry> getCollectionEntries() { + public Map,CollectionEntry> getCollectionEntries() { return collectionEntries; } diff --git a/hibernate-core/src/main/java/org/hibernate/type/ComponentType.java b/hibernate-core/src/main/java/org/hibernate/type/ComponentType.java index fc95692401..37ac9dd9c9 100644 --- a/hibernate-core/src/main/java/org/hibernate/type/ComponentType.java +++ b/hibernate-core/src/main/java/org/hibernate/type/ComponentType.java @@ -398,18 +398,7 @@ public class ComponentType extends AbstractType implements CompositeTypeImplemen return ((Object[]) component)[i]; } else { - final EmbeddableMappingType embeddableMappingType = embeddableTypeDescriptor(); - if ( embeddableMappingType.isPolymorphic() ) { - final EmbeddableMappingType.ConcreteEmbeddableType concreteEmbeddableType = embeddableMappingType.findSubtypeBySubclass( - component.getClass().getName() - ); - return concreteEmbeddableType.declaresAttribute( i ) - ? embeddableMappingType.getValue( component, i ) - : null; - } - else { - return embeddableMappingType.getValue( component, i ); - } + return embeddableTypeDescriptor().getValue( component, i ); } }