views:

20

answers:

0

Hi, I'm having a problem mapping the following classes

public class Cat { public virtual int id { get; set; } public virtual string name { get; set; } }

public class House { public virtual int id { get; set; } public virtual string name { get; set; } public virtual IList Cats{ get; set; } }

And my DB tables look like this:

T_Cats

ID, Name, House_Id

T_Houses

ID, Name

Well, basically i tried mapping it with the HasMany Fluent method but because i only have a reference to the cat list on the House class i'm having problems making NHibernate insert the house_id into the T_Cats column.. My mapping of the house includes this: .HasMany(x => x.Cats).AsList().Inverse.Cascade.ForeignKeyConstraint("House_Id");

please help me, Adi..