I have the following mapped classes
Trade { ID, AccountFrom, AccountTo } Account {ID, Company} Company {ID}
Now I cannot figure out a way s
Try:
return session.CreateCriteria() .CreateAlias("AccountFrom", "af") .CreateAlias("AccountTo", "at") .Add(Restrictions.Or( Restrictions.Eq("af.Company.CompanyId", companyId), Restrictions.Eq("at.Company.CompanyId", companyId))) .List();
I don't think you will need to alias Company.