Hello Guys,

I have a class called Load which maps to a Load table and this table
has foreign keys to Load_Type table and Truck_Type table.

Now I can query the load table with all the columns using criteria API
but when I try to query using the foreign key it gives me an error
saying could not resolve property,

Here is the method

   public IList<Load> GetLoadsByLoadType(int loadType)
        {
            return _session.CreateCriteria(typeof(Load))
               .Add(Expression.Eq(Load.MappingNames.LoadTypeId,
loadType))
               .List<Load>();
        }

Here is the mapping in the Load.hbm.xml

  <many-to-one name="LoadType" cascade="save-update"
column="`LoadtypeId`"/>

I donno why I get these errors only when I try to query using the
Foreign key.

Hoping for some help.

Ash


-- 
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