日期:2014-05-20  浏览次数:20749 次

hibernate查询问题
我一个表里用了多对一:               user.hbm.xml
<many-to-one   name= "sration "
                class= "org.yao.Srporation "
                  column= "userId "
                  > </many-to-one>
所以这个xml文件中没了userId字段,但我要查这个user表中所有userid为5的记录怎么查呀!
我这样写了不得行:select   *     from   user   as   s   where   s.userid=5说这个xml文件中没有userid这个字段

------解决方案--------------------
s.sration.userid