In NHibernate (Fluent), How do you map a property on referenced object into parent object?

Posted by JChristian on Stack Overflow See other posts from Stack Overflow or by JChristian
Published on 2010-05-04T17:34:36Z Indexed on 2010/05/04 17:38 UTC
Read the original article Hit count: 166

I want to map the Name column from the Child table into the Parent object. How do you do this (using Fluent NHibernate)?

public class Parent
{
   public int Key { get; set; }
   public string ChildName { get; set; }
}

Tables

+--------------+          +------------------+
| Parent       |          | Child            |
+--------------+          +------------------+
| Key      INT |     +--->| Key  INT         |
| ChildKey INT |-----+    | Name VARCHAR(20) |
+--------------+          +------------------+

© Stack Overflow or respective owner

Related posts about nhibernate

Related posts about fluent-nhibernate