请教一个NHibernate的多表查询的问题

最近刚学习NHibernate,但是做一个多表查询就出了问题

 _session.CreateQuery("select distinct c from Usr c ,"
                + " c.OrderTbls o where o.OrderDesc like :orderDate").SetString("orderDate", "%" + strOrderDesc + "%")
                .List<Usr>();

上面是我写的HQL,但总是报c.OrderTbls is not mapped [select distinct c from myProject.Model.Usr c , c.OrderTbls o where o.OrderDesc like :orderDate]


慕神8447489
浏览 353回答 2
2回答

繁花如伊

left join fetch c.OrderTbls&nbsp;o 试试

慕桂英4014372

集合需要join查询。。
打开App,查看更多内容
随时随地看视频慕课网APP