Fluent Nhibernate - Mapping child in parent when Child has reference to parent and not using a list

Posted by Josh on Stack Overflow See other posts from Stack Overflow or by Josh
Published on 2010-05-17T18:55:59Z Indexed on 2010/05/17 19:00 UTC
Read the original article Hit count: 250

I have a child object in the database that looks like this:

CREATE TABLE Child
(
ChildId  uniqueidentifier not null,
ParentId uniqueidentifier not null
)

An then I have a parent like so.

CREATE TABLE Parent
(
ParentId uniqueidentifier not null
)

Now, the problem is that in my Parent class, I have

public virtual Child Child { get; set; }

I've tried references, hasone, referencesany and can't seem to get the mapping right. Anyone have any ideas?

Thanks,

© Stack Overflow or respective owner

Related posts about fluent-nhibernate

Related posts about nhibernate