新人 关于hibernate的hql一对多查询有关问题
新人求助 关于hibernate的hql一对多查询问题
比如有两张表
一个部门表 一个员工表
怎么查询一个部门里的所有员工
select e from Employee e where e.dept.id = ?
这样写对吗?
------解决方案--------------------
from Employee e where e.字段名 = ?
没仔细看你后面怎么写的,我上面写错了
把两个表名贴出来,重要字段贴出来,
还是那句话对不对运行一下就知道了
------解决方案--------------------
from Employee e where e.dept.id = ?
这样写可以的。
------解决方案--------------------
from Employee as e where e.dept.id = ? 试一下。
比如有两张表
一个部门表 一个员工表
怎么查询一个部门里的所有员工
select e from Employee e where e.dept.id = ?
这样写对吗?
------解决方案--------------------
from Employee e where e.字段名 = ?
没仔细看你后面怎么写的,我上面写错了
把两个表名贴出来,重要字段贴出来,
还是那句话对不对运行一下就知道了
------解决方案--------------------
from Employee e where e.dept.id = ?
这样写可以的。
------解决方案--------------------
from Employee as e where e.dept.id = ? 试一下。