如何将以下查询转换为detachedCriteria:
select * from (
select a.* ,row_number() over (partition by hotel_id order by EXECUTION_START_DATE desc) rnk
from HOLIDAY_PACKAGES a
)
where rnk = 1发布于 2011-06-19 22:42:58
我不认为您能够使用Criteria API构建这样的查询。唯一的方法是通过Native SQL支持,或者在最坏的情况下使用存储过程。
http://www.nhforge.org/doc/nh/en/index.html#manipulatingdata-nativesql
https://stackoverflow.com/questions/6401134
复制相似问题