I have the table structure like this
AccountID Code Description AccountTypeID IsActive CloseToAccountID UseCurrentFXRate
where AccountId is primary key and CloseToAccountID is foreign key withreference to AccontID column of the same table
I have the mapping file like this
<property column="Code" type="String" name="Code" not-null="true" length="50" />
<property column="Description" type="String" name="Description" length="100" />
<many-to-one name="AccountTypeid" column="AccountTypeID" class="Model.CaxAccountType,Model" />
<property column="IsActive" type="Byte" name="IsActive" not-null="true" />
<many-to-one name="CloseToAccountid" column="CloseToAccountID" class="Model.CaxAccount,Model" />
<property column="UseCurrentFXRate" type="Boolean" name="UseCurrentfxRate" not-null="true" />
And my class defination is like this
public CaxAccount()
{
_accountid = 0;
_code = String.Empty;
_description = String.Empty;
_accounttypeid = new CaxAccountType() _isactive = new byte();
_closetoaccountid = new CaxAccount();
_usecurrentfxrate = false;
}
When i m using this for ex. using NUnit for Test purpose, it gives circular reference at _closetoaccountid = new CaxAccount();
can anyone tell what is the alternative for this kind of situations
|