Beginner |
|
Joined: Mon Jan 09, 2006 8:02 am Posts: 22
|
Hi. I am very new to nHibernate so forgive me if this Question is Foolish. I am Trying to Create a One to many mapping I am getting a Run time error. INVALIDCASTEXCEPTON
The Basic ideas is an Account can have Many Transactions.....
1)Account File:-
Mapping Files:-
<id name="ACCOUNT_NUMBER" column="ACCOUNT_NUMBER" type="System.String">
<generator class="assigned"/>
</id>
......
<bag name="Transaction" table = "Trans_History">
<key column="TRANS_ID"/>
<one-to-many class="Prasanth.TRANS_HISTORYEntity, Prasanth"/> </bag>
Class File:-
[Serializable]
public class ACCOUNT_DETAILSEntity
{
private string _ACCOUNT_NUMBER;
private IList Transaction; // To store Transactions.
}
2nd) Transaction File:-
Mapping File:-
<id name="TRANS_ID" column="TRANS_ID" type="System.Double">
<generator class="assigned"/>
</id>
<many-to-one name="ACCOUNT_NUMBER" column="ACCOUNT_NUMBER" class="Prasanth.ACCOUNT_DETAILSEntity, Prasanth"/>
The Respictive Class File:
private string Trans_id;
private IDictionary Account_Number;
Now this Throws an Error. Can Anyone help me out with this..
Thanking You
|
|