From 1273aaffd6cf96c6e67f2dde92c41f93d3185c92 Mon Sep 17 00:00:00 2001 From: Christian Beikov Date: Fri, 3 Mar 2017 09:04:31 +0100 Subject: [PATCH] HHH-11540 - Fix for registering embeddable with actual component type --- .../hibernate/metamodel/internal/AttributeFactory.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/AttributeFactory.java b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/AttributeFactory.java index 1b8c060a41..0f0633ed44 100755 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/AttributeFactory.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/AttributeFactory.java @@ -212,8 +212,15 @@ public class AttributeFactory { } case EMBEDDABLE: { final Component component = (Component) typeContext.getValue(); + Class javaType; + if ( component.getComponentClassName() == null ) { + javaType = typeContext.getBindableType(); + } + else { + javaType = component.getComponentClass(); + } final EmbeddableTypeImpl embeddableType = new EmbeddableTypeImpl( - typeContext.getBindableType(), + javaType, typeContext.getAttributeMetadata().getOwnerType(), (ComponentType) typeContext.getValue().getType() );