views:

96

answers:

1

Hi I have an entity: public class Message:Entity { public virtual IList<Message> ReplayMessages { set; get; } public virtual Message ParentMessage { set; get; } }

I try to override the mapping: mapping.HasMany(x => x.ReplayMessages) .AsSet() .KeyColumnNames.Add("ParentId");

but in the hbm.xml file I get:

<set name="ReplayMessages"> <key column="MessageFk" /> <one-to-many class="Edi.Core.Model.Message, Edi.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" /> </set>

Why the column key name didn't change?

A: 

When I use HasMany it looks like this:

HasMany(x => x.OrderItems)
    .KeyColumn("OrderId")
    .AsSet()
    .Cascade.All();

I don't know what KeyColumnNames is used for...

Nicolas Cadilhac
I don't get KeyColumn, only KeyColumnNames. Why?
Lullaby
You need to update your copy of Fluent NHibernate. 1.0 RTM was released a couple of months ago now.
James Gregory