org.hibernate.QueryException: illegal attempt to dereference collection

今天做hibernate的一对多双向关联查询,出现org.hibernate.QueryException: illegal attempt to dereference collection错误,百度了一下,发现原因:

自己使用的hibernate版本是3.2.3,我写的hql语句是:

getHibernateTemplate().find("from Oamail o where o.receivers.receiverid="+receiverid);

只有3.2.2及以前才可以这样写,如果是3.2.2,不能这样写

详细:http://blog.leegang.org/simple/index.php?type=blog&itemid=52

posted @ 2009-01-01 03:10  陆陆通通  阅读(165)  评论(0编辑  收藏  举报