Click here to Skip to main content
15,890,282 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
I have several tables. I 'm using nhibernate in my desktop project. But when I try to save some data into my any of table through nhibernate it gives me following error
{"An association from the table p_returnitem refers to an unmapped class: SmartWarehouse.Order"}



My Preturnitementity is following
class PReturnitemEntity : Entity
{
    //public virtual int id { get; set; }
    public virtual string purchase_items { get; set; }
    public virtual double return_sum { get; set; }
    public virtual double rate { get; set; }
    public virtual int r_count { get; set; }
    public virtual bool deleted { get; set; }
    public virtual DateTime create_date { get; set; }
    public virtual DateTime update_date { get; set; }

    public virtual UsersEntity user { get; set; }
    public virtual PurchaseEntity purchase { get; set; }
    public virtual CurrencyEntity currency { get; set; }


}


Preturitem Mapping Class

class PreturnItemMap : ClassMap<PReturnitemEntity>
   {
       public PreturnItemMap()
       {
           Id(x => x.Id);
           Map(x => x.purchase_items);
           Map(x => x.return_sum);
           Map(x => x.rate);
           Map(x => x.r_count);

           Map(x => x.deleted);
           Map(x => x.create_date);
           Map(x => x.update_date);

           References(x => x.user).ForeignKey("user_id").Cascade.None();
           References(x => x.currency,"cur_code").PropertyRef(x => x.code).Cascade.None();
           References(x => x.purchase,"purchase_id").Cascade.None();

           Table("p_returnitem");
       }
   }

what might be wrong in here please suggest to me what to do

What I have tried:

I checked all entity class and all mapping class double check everything is connected well
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900