开发者

Translating to detachedCriteria

开发者 https://www.devze.com 2023-03-14 02:53 出处:网络
How can I translate the following query to detachedCriteria: select * from ( select a.* ,row_num开发者_运维问答ber() over (partition by hotel_id order byEXECUTION_START_DATE desc)rnk

How can I translate the following query to detachedCriteria:

select * from (
    select a.* ,row_num开发者_运维问答ber() over (partition by hotel_id order by  EXECUTION_START_DATE desc)  rnk  
    from HOLIDAY_PACKAGES a
)
where rnk = 1


I don't think you will be able to construct such a query using the Criteria API. The only way to go is through the Native SQL support or in the worst case scenario use a stored procedure.

http://www.nhforge.org/doc/nh/en/index.html#manipulatingdata-nativesql

0

精彩评论

暂无评论...
验证码 换一张
取 消