Skip to content

Commit 21c998c

Browse files
committed
Proper fix
1 parent 855e16a commit 21c998c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/NHibernate/Type/EmbeddedComponentType.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ public override bool IsEmbedded
1919

2020
public override object Instantiate(object parent, ISessionImplementor session)
2121
{
22-
bool useParent= false;
23-
// NH Different implementation : since we are not sure about why H3.2 use the "parent"
24-
//useParent = parent != null && base.ReturnedClass.IsInstanceOfType(parent);
22+
var useParent =
23+
parent != null &&
24+
//TODO: Yuck! This is not quite good enough, it's a quick
25+
//hack around the problem of having a to-one association
26+
//that refers to an embedded component:
27+
ReturnedClass.IsInstanceOfType(parent);
2528

2629
return useParent ? parent : base.Instantiate(parent, session);
2730
}

0 commit comments

Comments
 (0)