hibernate多对一查询问题
来源:互联网 发布:曼尼托巴大学 知乎 编辑:程序博客网 时间:2024/05/16 06:44
来源:http://zhidao.baidu.com/question/65107582.html?fr=qrl
staff(用户表)字段为{id,name,dept_id}
dept(部门表)字段为{dept_id,dept_name}
staff-->dept已经建立多对一关系
-----------------------------------------------------------
Staff生成的pojo 包括如下属性
private String id;
private String name;
private Dept dept;
-----------------------------------------------------------
Dept生成的pojo 包括如下属性
private String dept_id;
private String dept_name;
-----------------------------------------------------------
我现在想通过部门编号查询所有员工
大家帮帮忙,看应该怎么写这个语句啊
比如
String qhl=" from staff where 这里条件不知该怎么写";
答案:
String hql="from Staff where dept.dept_id=?"
HQL语句应该这么写 ,然后在传进来你想要的那个部门id号就可以啦~
- hibernate多对一查询问题
- Hibernate级联查询(多对一)
- hibernate中多对一映射查询
- Hibernate 一对多 多对一 实例 及一些 问题(1)插入及查询
- Hibernate的多表查询问题一
- hibernate一对多,多对一问题
- hibernate的多对一问题
- Hibernate中多对一问题详解
- hibernate 多对一 查询 多的一方如何分页?
- Hibernate 多对一查询,以及一对多关联删除
- hibernate DetachedCriteria多对一关联 内连接查询
- Hibernate多对一
- hibernate多对一
- hibernate多对一
- hibernate多对一...
- hibernate多对一
- hibernate 多对一
- Hibernate多对多查询
- 解读makefile和source文件
- rootkit for linux 2.寻找入口点
- ▲什么是截拳道(莲达.李)
- 获取客户端的真实IP地址
- hibernate中对象的3种状态----瞬时态、持久态、脱管态
- hibernate多对一查询问题
- Semantic Web
- 为maven安装jta
- Axure RP Pro - 相关问题 - 如何获取IFrame的URL
- ubuntu8.10下java中文乱码问题
- 大屏一体机!奥可视新品A5亮点浅析
- 关于stdlib
- C#重启动WINCE系统
- jQuery鼠标提示效果