急寻:oracle数据库查询问题

来源:百度知道 编辑:UC知道 时间:2024/06/29 02:58:01
请问各位下面这个hql的查询语句select sole from Sole as sole left join sole.userIds as userId where sole.deletted=0 and sole.Code=:Code and userId=:userId,查不到结果,是什么原因呢?最后告诉我怎样转换成sql语句,因为查到结果为空,所以我想拿到数据库中去执行,看问题出在哪里?谢谢了

先在数据库中执行下
select *
from Sole sole
left join sole.userIds userId on(sole.deletted=0 and sole.Code='此处填你要查找的code的具体数据' and userId='此处填你要查找的userid的具体数据')

问一下你left join sole.userIds 的条件是什么呀? 我没看出来。 如果想看它解析出来的sql 的话 在配置文件里加上 加上 <property name="show_sql">true</property> 运行的时候就可以在控制台看到解析后的sql 了!!

把where改成on