I have a field with the same name in both tables. How do I get NHibernate to update both fields with the same value. At the moment I can get it to set either but not both.
Code:
<class name="NH_FF_TestApp.Party, NH-FF-TestApp" table="tblParty874a">
<id name="Wid" column="PartyWID" type="String" length="20">
<generator class="assigned" />
</id>
<property name="MainName" />
<property name="TableCode" />
<property name="ClientRefWID" />
<property name="PartyTypeWID" />
</class>
<joined-subclass name="NH_FF_TestApp.Person, NH-FF-TestApp" extends="NH_FF_TestApp.Party, NH-FF-TestApp"
table="tblClientPerson910">
<key column="WID" />
<property name="Surname" />
<!--
<property name="ClientRefWID" />
-->
</joined-subclass>
Code:
public class Party
{
private string _wid;
private string _mainName;
private int _tableCode;
private string _clientRefWID;
private string _partyTypeWID;
public Party()
{
}
public virtual string Wid
{
get { return _wid; }
set { _wid = value; }
}
public virtual string MainName
{
get { return _mainName; }
set { _mainName = value; }
}
public virtual int TableCode
{
get {return _tableCode;}
set {_tableCode = value;}
}
public virtual string ClientRefWID
{
get {return _clientRefWID;}
set {_clientRefWID = value;}
}
public virtual string PartyTypeWID
{
get {return _partyTypeWID;}
set {_partyTypeWID = value;}
}
}
public class Person:Party
{
private string _surname;
// private string _wid;
// private string _clientRefWID;
public Person()
{
}
// public virtual string Wid
// {
// get { return _wid; }
// set { _wid = value; }
// }
public virtual string Surname
{
get { return _surname; }
set { _surname = value; }
}
// public new string ClientRefWID
// {
// get {return base.ClientRefWID;}
// set {base.ClientRefWID = value;}
// }
}
The ClientRefWID is a required field in both tables.
Regards
Tim