I have entity class vendor, it maps to my database table
"my_tbl_vendor".
The vendor class is like:
 public class Vendor : Entity
    {
        public Vendor() { }

        public Vendor(string vendor_name) {
            My_Vendor_Name = vendor_name;
        }


        public virtual int My_Vendor_ID { get; set; }
...
my mapping class is like:
class VendorMap : IAutoMappingOverride<Vendor>
        {
                   public void Override (AutoMapping<Vendor> mapping)
                   {
                            mapping.Table("my_tbl_vendor");
                            mapping.Id(x=>x.Id, 
"My_Vendor_ID").GeneratedBy.Identity();

...


...
My test is like this:
  [Test]
        public void CanGetVendorByVendorID()
        {
            Vendor vendor = VendorRepository.Get(1);

            Assert.AreEqual(vendor.A2Z_Vendor_ISN, 1);


        }
Then I got error:
Tests.myDeals.Data.VendorRepositoryTests.CanGetVendorByVendorID:
NHibernate.Exceptions.GenericADOException : could not load an entity:
[myDeals.Core.Vendor#1]
[SQL: SELECT vendor0_.Id as Id0_0_, vendor0_.CategoryName as
Category2_0_0_, vendor0_.My_Vendor_ISN as A3_0_0_,
vendor0_.My_Vendor_Name as A4_0_0_, vendor0_.My_BookMark as A5_0_0_,
vendor0_.My_Vendor_Changed_By as A45_0_0_ FROM [Vendor] vendor0_ WHERE
vendor0_.Id=?]
  ----> System.Data.SqlClient.SqlException : Invalid object name
'Vendor'.
It seems that my class Vendor is not Mapping to table my_tbl_vendor.
How could I map my class vendor to table "my_tbl_vendor"?
I am using sharp Architecture templates which use FluentNHibernate.
Thank you for your help.
Li Aishen

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to