
Foreign key (FK69321271EAA48866:hsysWebUserTablePref [Property])) must
have same number of columns as the referenced primary key (hsysObjPrp
[Object, SubObject, PrpName])
this is when I try to map
public class hsysObjPrp
{
public virtual string Object { get; set; }
public virtual string SubObject { get; set; }
public virtual string PrpName { get; set; }
public virtual System.Nullable<byte> PrpType { get; set; }
public virtual string PrpValue { get; set; }
public virtual System.Nullable<bool> Added { get; set; }
}
with
public class hsysWebUserTablePref
{
public virtual hsysUser User { get; protected set; }
public virtual hsysObjPrp Property { get; protected set; }
public virtual bool Hide { get; set; }
public virtual bool CanView { get; set; }
public virtual bool CanEdit { get; set; }
}
like so
public class hsysWebUserTablePrefMap : ClassMapping<hsysWebUserTablePref>
{
public hsysWebUserTablePrefMap()
{
Lazy(true);
ComposedId(x => x.ManyToOne(y => y.User));
ComposedId(x => x.ManyToOne(y => y.Property));
Property(x => x.Hide);
Property(x => x.CanView);
Property(x => x.CanEdit);
}
}