当前位置: 代码迷 >> Java Web开发 >> 请问hibernate高手一个 HQL查询方法
  详细解决方案

请问hibernate高手一个 HQL查询方法

热度:70   发布时间:2016-04-17 14:13:28.0
请教hibernate高手一个 HQL查询方法
一个THouse表   里面对应字段有   id     name(房屋名字)   houseType(房屋类型)  
现在我要查询的是每种房屋类型列出三条记录来
用sql语句实现就是下面这个情况


select   t   from   THouse   as   t   where   t.id   in  
(select   top   3   a.id   from   THous   as   a   where   t.houseType=a.houseType)

------解决方案--------------------
you can use the native sql function of hibernate.
  相关解决方案