首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

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

2011-11-29 
请教hibernate高手一个 HQL查询方法一个THouse表里面对应字段有idname(房屋名字)houseType(房屋类型)现在

请教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.

热点排行