HHH-11540 - Fix for registering embeddable with actual component type

This commit is contained in:
Christian Beikov 2017-03-03 09:04:31 +01:00 committed by Andrea Boriero
parent ff582903aa
commit 1273aaffd6
1 changed files with 8 additions and 1 deletions

View File

@ -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<Y> embeddableType = new EmbeddableTypeImpl<Y>(
typeContext.getBindableType(),
javaType,
typeContext.getAttributeMetadata().getOwnerType(),
(ComponentType) typeContext.getValue().getType()
);