实体类 InfoFIle.java private Long id; private String fileId; private String title; private String subtitle; private Integer filetype; private Date updatetime; private String author; InfoFileOther.java private Long id; private Long clicknum; private Long downloadnum; private String fileId; private String varchar1; private String varchar2; private String varchar3; String hql =" from InfoFile as a , InfoFileOther as b where a.fileId = b.fileId "; hql中select a.id,b,id from .....返回的是Object[], 一个对象数组 因此这里有一种方法可以得到表连接返回的数据 list = this.getHibernateTemplate().find(hql); if(list != null){ Iterator it =list.iterator(); while(it.hasNext()){ Object[] o =(Object[])it.next(); InfoFile info =(InfoFile)o[0]; //得到InfoFile对象 InfoFileOther ifo=(InfoFileOther)o[1]; //得到InfoFileOther System.out.println(info.getId()); //对数据进行操作 } } http://blog.csdn.net/guliangliang/archive/2010/05/26/5625475.aspx 相关文章: Hibernate之多表查询 2021-06-08 Hibernate HQL多表查询 2021-11-20 hibernate多表查询HQL 2021-11-20 Hibernate多表查询 - FreeSkyCD 2021-11-20 Hibernate hql 多表查询 2021-09-05 hibernate总结多表查询 2021-11-05 Hibernate的HQL多表查询 2021-11-20 hibernate 多表联合查询 2021-11-30